Skip to content

Commit

Permalink
Improve history for atmospheric compensation for Nortek instruments
Browse files Browse the repository at this point in the history
  • Loading branch information
dnowacki-usgs committed Feb 28, 2024
1 parent 5120e67 commit c08e76f
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions stglib/aqd/aqdutils.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,12 @@ def atmos_correct(ds, atmpres):
- met["atmpres"].reindex_like(ds["Pressure"], method="nearest", tolerance="5s")
- met["atmpres"].attrs["offset"]
)
print(
f"Atmospherically correcting using time-series from {atmpres} and offset of {met['atmpres'].offset}"
)
ds["Pressure_ac"].attrs = attrs

histtext = f"Atmospherically corrected using time-series from {atmpres} and offset of {met['atmpres'].offset}"

ds = utils.insert_history(ds, histtext)

ds.attrs["atmospheric_pressure_correction_file"] = atmpres
ds.attrs["atmospheric_pressure_correction_offset_applied"] = met["atmpres"].attrs[
"offset"
Expand Down Expand Up @@ -1217,10 +1218,6 @@ def add_attributes(var, dsattrs):

add_attributes(ds["P_1ac"], ds.attrs)

histtext = "Atmospheric pressure compensated."

ds = utils.insert_history(ds, histtext)

if "bin_depth" in ds:
ds["bin_depth"].attrs.update({"units": "m", "long_name": "bin depth"})

Expand Down

0 comments on commit c08e76f

Please sign in to comment.