diff --git a/stglib/aqd/aqdutils.py b/stglib/aqd/aqdutils.py index 4bd43883..4dc83ba0 100644 --- a/stglib/aqd/aqdutils.py +++ b/stglib/aqd/aqdutils.py @@ -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" @@ -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"})