Skip to content

Commit

Permalink
Found some other NA vals
Browse files Browse the repository at this point in the history
  • Loading branch information
zmoon committed Feb 7, 2024
1 parent bbf3765 commit 47951bb
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions monetio/profile/gml_ozonesonde.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"""
import re
import warnings
from typing import NamedTuple, Optional
from typing import NamedTuple, Optional, Union

import numpy as np
import pandas as pd
Expand Down Expand Up @@ -177,7 +177,7 @@ class ColInfo(NamedTuple):
name: str
long_name: str
units: str
na_val: Optional[str]
na_val: Optional[Union[str, tuple[str, ...]]]


COL_INFO_L100 = [
Expand Down Expand Up @@ -224,11 +224,11 @@ class ColInfo(NamedTuple):
#
# "O3 Res"
# TODO: goes down with height so could be total ozone above?
ColInfo("o3_col", "total column ozone above", "DU", "9999"),
ColInfo("o3_col", "total column ozone above", "DU", ("9999", "99999", "99.999")),
#
# "O3 Uncert"
# TODO: uncertainty in which ozone value?
ColInfo("o3_uncert", "uncertainty in ozone", "%", "99999.000"),
ColInfo("o3_uncert", "uncertainty in ozone", "%", ("99999.000", "99.999")),
]


Expand Down Expand Up @@ -321,10 +321,11 @@ def get_text():
df["time"] = time.tz_localize(None)
df["latitude"] = float(meta["Latitude"])
df["longitude"] = float(meta["Longitude"])
df["station"] = meta["Station"]
df["station"] = meta["Station"] # TODO: could normalize to place
df["station_height_str"] = meta["Station Height"] # e.g. '1743 meters'
df["o3_tot_cmr_str"] = meta["Sonde Total O3"]
df["o3_tot_sbuv_str"] = meta["Sonde Total O3 (SBUV)"] # e.g. '325 (62) DU'
# TODO: '99999 (99999) DU' if NA, could put empty string instead?

# Add metadata
if hasattr(df, "attrs"):
Expand Down

0 comments on commit 47951bb

Please sign in to comment.