Skip to content

Commit

Permalink
Add metadata about atmos correction
Browse files Browse the repository at this point in the history
  • Loading branch information
dnowacki-usgs committed Aug 4, 2023
1 parent 6cf314c commit 690d9ab
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions stglib/aqd/aqdutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,17 +84,20 @@ def load_cdf(cdf_filename, atmpres=False):

if atmpres is not False:
p = xr.load_dataset(atmpres)
# TODO: check to make sure this data looks OK
# need to set a tolerance since we can be off by a couple seconds somewhere
ds["Pressure_ac"] = xr.DataArray(
ds["Pressure"]
- p["atmpres"].reindex_like(
ds["Pressure"], method="nearest", tolerance="5s"
)
- p[
"atmpres"
].offset # need to set a tolerance since we can be off by a couple seconds somewhere
- p["atmpres"].attrs["offset"]
)

ds.attrs["atmospheric_pressure_correction_file"] = atmpres
ds.attrs["atmospheric_pressure_correction_offset_applied"] = p["atmpres"].attrs[
"offset"
]

return ds


Expand Down

0 comments on commit 690d9ab

Please sign in to comment.