Skip to content

Commit

Permalink
ENH: Rename the csv module to prevent errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mgrover1 committed Jan 16, 2024
1 parent 6eda11b commit 7409cce
Show file tree
Hide file tree
Showing 6 changed files with 678 additions and 352 deletions.
9 changes: 3 additions & 6 deletions act/io/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

__getattr__, __dir__, __all__ = lazy.attach(
__name__,

submodules=['arm', 'csv', 'icartt', 'mpl', 'neon', 'noaagml', 'noaapsl', 'pysp2'],
submod_attrs={
'arm': [
Expand All @@ -18,7 +17,7 @@
'check_if_tar_gz_file',
'read_arm_mmcr',
],
'csv': ['read_csv'],
'text': ['read_csv'],
'icartt': ['read_icartt'],
'mpl': ['proc_sigma_mplv5_read', 'read_sigma_mplv5'],
'neon': ['read_neon_csv'],
Expand All @@ -38,9 +37,7 @@
'read_psl_radar_fmcw_moment',
'read_psl_surface_met',
],
'pysp2': ['read_hk_file', 'read_sp2', 'read_sp2_dat'
],
'sodar' : [
'read_mfas_sodar']
'pysp2': ['read_hk_file', 'read_sp2', 'read_sp2_dat'],
'sodar': ['read_mfas_sodar'],
},
)
103 changes: 0 additions & 103 deletions act/io/csv.py

This file was deleted.

22 changes: 17 additions & 5 deletions act/io/neon.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
Modules for reading in NOAA PSL data.
"""

import pandas as pd
import xarray as xr
import datetime as dt

import numpy as np
from act.io.csv import read_csv
import pandas as pd
import xarray as xr

from act.io.text import read_csv


def read_neon_csv(files, variable_files=None, position_files=None):
Expand Down Expand Up @@ -85,8 +87,18 @@ def read_neon_csv(files, variable_files=None, position_files=None):
ds['lat'] = xr.DataArray(data=float(loc_df['referenceLatitude'].values[idx]))
ds['lon'] = xr.DataArray(data=float(loc_df['referenceLongitude'].values[idx]))
ds['alt'] = xr.DataArray(data=float(loc_df['referenceElevation'].values[idx]))
variables = ['xOffset', 'yOffset', 'zOffset', 'eastOffset', 'northOffset',
'pitch', 'roll', 'azimuth', 'xAzimuth', 'yAzimuth']
variables = [
'xOffset',
'yOffset',
'zOffset',
'eastOffset',
'northOffset',
'pitch',
'roll',
'azimuth',
'xAzimuth',
'yAzimuth',
]
for v in variables:
ds[v] = xr.DataArray(data=float(loc_df[v].values[idx]))
multi_ds.append(ds)
Expand Down
Loading

0 comments on commit 7409cce

Please sign in to comment.