From cd756f821a7dbf3ccd0f5e5bc26d33f800ac962d Mon Sep 17 00:00:00 2001 From: Trey Stafford Date: Tue, 23 Sep 2025 13:37:13 -0600 Subject: [PATCH 1/2] `publish_daliy.make_publication_ready_ds`: Fix bug omitting some steps Now the function sets the `time` parameter to have consistent units and calendar. Also Removes the FillValue from coordinate variables. This ensures that the daily outputs for both G10016 and G02202 are consistent Fixes an observed bug where the `time` variable has: * `units` attr that are based on the day of file creation * `calendar` attr that shows "proleptic_gregorian". --- seaice_ecdr/publish_daily.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/seaice_ecdr/publish_daily.py b/seaice_ecdr/publish_daily.py index 7cc276c4..37a130c4 100644 --- a/seaice_ecdr/publish_daily.py +++ b/seaice_ecdr/publish_daily.py @@ -150,6 +150,12 @@ def make_publication_ready_ds( add_coordinate_coverage_content_type(complete_daily_ds) add_coordinates_attr(complete_daily_ds) + # Ensure consistency of time units + complete_daily_ds.time.encoding["units"] = "days since 1970-01-01" + complete_daily_ds.time.encoding["calendar"] = "standard" + + complete_daily_ds = remove_FillValue_from_coordinate_vars(complete_daily_ds) + return complete_daily_ds @@ -272,11 +278,6 @@ def publish_daily_nc( platform_id=platform.id, ) - # Ensure consistency of time units - complete_daily_ds.time.encoding["units"] = "days since 1970-01-01" - complete_daily_ds.time.encoding["calendar"] = "standard" - - complete_daily_ds = remove_FillValue_from_coordinate_vars(complete_daily_ds) complete_daily_ds.to_netcdf(complete_daily_filepath) logger.success(f"Staged NC file for publication: {complete_daily_filepath}") From a6d0d1b5bceada6da71ea48a4f062fc9eecfc7be Mon Sep 17 00:00:00 2001 From: Trey Stafford Date: Tue, 23 Sep 2025 13:45:39 -0600 Subject: [PATCH 2/2] CHANGELOG --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a8abc66..0b1f5d3f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,13 @@ * Update NSIDC infrastructure NFS paths to reflect new product major versions. * Update `pm_tb_data` dependency to >=v0.6. This allows utilizing `earthaccess` to fetch NSDIC-0001 data. +* BUGFIX: `time` variable in published G10016 daily files now has `units` + attribute of "days since 1970-01-01" and sets the `calendar` attribute to + "standard". This resolves an issue where the `units` attr was dependent on the + file creation date and the `calendar` attribute showed + "proleptic_gregorian". This ensures consistency between G10016 and G02202 + daily output files. + # v1.1.0