Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ENH: Rename the csv module to prevent errors #788

Merged
merged 11 commits into from
Jan 19, 2024
11 changes: 4 additions & 7 deletions act/io/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,7 @@

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

submodules=['arm', 'csv', 'icartt', 'mpl', 'neon', 'noaagml', 'noaapsl', 'pysp2'],
submodules=['arm', 'text', 'icartt', 'mpl', 'neon', 'noaagml', 'noaapsl', 'pysp2'],
submod_attrs={
'arm': [
'WriteDataset',
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'],
},
)
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 .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
Loading