Skip to content

Commit

Permalink
'siteid' in add_data output
Browse files Browse the repository at this point in the history
  • Loading branch information
zmoon committed Apr 11, 2024
1 parent 2751b13 commit 649a611
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion monetio/profile/gml_ozonesonde.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ def add_data(dates, *, location=None, n_procs=1, errors="raise"):
For example 'Boulder, Colorado'.
If not provided, all locations will be used.
Valid options correspond to the directories in https://gml.noaa.gov/aftp/data/ozwv/Ozonesonde/
and may include data from more than one unique site (output column 'station').
and may include data from more than one unique site (output column 'siteid').
n_procs : int
For Dask.
errors : {'raise', 'warn', 'skip'}
Expand Down Expand Up @@ -213,6 +213,9 @@ def func(fp_or_url):
assert set(repl.values()) <= set(LOCATIONS)
df["station"] = df["station"].replace(repl)

# Normalized station name as site ID
df = df.rename(columns={"station": "siteid"})

# Add metadata
if hasattr(df, "attrs"):
df.attrs["ds_attrs"] = {"urls": urls}
Expand Down
2 changes: 1 addition & 1 deletion tests/test_gml_ozonesonde.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def test_add_data():
assert 1 < latlon.nunique() <= 10, "multiple sites; lat/lon doesn't change in profile"

# NOTE: Similar to the place folder names, but not all the same
assert df["station"].nunique() == latlon.nunique()
assert df["siteid"].nunique() == latlon.nunique()


def test_add_data_location_sel():
Expand Down

0 comments on commit 649a611

Please sign in to comment.