Skip to content

Commit

Permalink
ENH: Rename the csv module to prevent errors (#788)
Browse files Browse the repository at this point in the history
* ENH: Rename the csv module to prevent errors

* ADD: Add pinning for sphinx

* Update sphinx theme

* ADD: Add additional pinning

* FIX: fix for path.

* FIX: Missing text in __init__.py.

* FIX: Fix import for noaapsl

* FIX: Add in relative imports

* ADD: Add text module

* FIX: Fix the pinning in the env file

---------

Co-authored-by: zssherman <[email protected]>
  • Loading branch information
mgrover1 and zssherman authored Jan 19, 2024
1 parent 6d4e594 commit 20f206c
Show file tree
Hide file tree
Showing 6 changed files with 681 additions and 254 deletions.
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

0 comments on commit 20f206c

Please sign in to comment.