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 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}")