Skip to content

Commit 84348f5

Browse files
Merge pull request #199 from nsidc/fix-nrt-time-units-calendar
Fix nrt time units calendar
2 parents 89d90ad + a6d0d1b commit 84348f5

2 files changed

Lines changed: 13 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@
1919
* Update NSIDC infrastructure NFS paths to reflect new product major versions.
2020
* Update `pm_tb_data` dependency to >=v0.6. This allows utilizing `earthaccess`
2121
to fetch NSDIC-0001 data.
22+
* BUGFIX: `time` variable in published G10016 daily files now has `units`
23+
attribute of "days since 1970-01-01" and sets the `calendar` attribute to
24+
"standard". This resolves an issue where the `units` attr was dependent on the
25+
file creation date and the `calendar` attribute showed
26+
"proleptic_gregorian". This ensures consistency between G10016 and G02202
27+
daily output files.
28+
2229

2330

2431
# v1.1.0

seaice_ecdr/publish_daily.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,12 @@ def make_publication_ready_ds(
150150
add_coordinate_coverage_content_type(complete_daily_ds)
151151
add_coordinates_attr(complete_daily_ds)
152152

153+
# Ensure consistency of time units
154+
complete_daily_ds.time.encoding["units"] = "days since 1970-01-01"
155+
complete_daily_ds.time.encoding["calendar"] = "standard"
156+
157+
complete_daily_ds = remove_FillValue_from_coordinate_vars(complete_daily_ds)
158+
153159
return complete_daily_ds
154160

155161

@@ -272,11 +278,6 @@ def publish_daily_nc(
272278
platform_id=platform.id,
273279
)
274280

275-
# Ensure consistency of time units
276-
complete_daily_ds.time.encoding["units"] = "days since 1970-01-01"
277-
complete_daily_ds.time.encoding["calendar"] = "standard"
278-
279-
complete_daily_ds = remove_FillValue_from_coordinate_vars(complete_daily_ds)
280281
complete_daily_ds.to_netcdf(complete_daily_filepath)
281282
logger.success(f"Staged NC file for publication: {complete_daily_filepath}")
282283

0 commit comments

Comments
 (0)