Skip to content

Commit 00c2e17

Browse files
committed
Merge branch 'main' into issue-259
2 parents 1492f0d + 7bc6e4d commit 00c2e17

File tree

13 files changed

+97
-136
lines changed

13 files changed

+97
-136
lines changed

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,16 @@
22

33
* Issue-259: Fix white space bug in handling of `.premet` contents.
44

5+
## v1.11.0rc2 (2025-08-21)
6+
7+
* Issue-250: Use the current date/time to populate `ProductionDateTime` in UMM-G
8+
output for all collections.
9+
* Issue-251: Look for (and use if available) a `spatial_ref` attribute associated with
10+
a NetCDF file's grid mapping variable if the variable doesn't have a `crs_wkt` attribute.
11+
512
## v1.11.0rc1 (2025-08-20)
613

7-
* Update templates to use `short_name` rather than `auth_id`.
14+
* Issue-241 patch: Update templates to use `short_name` rather than `auth_id`.
815

916
## v1.11.0rc0 (2025-08-19)
1017

README.md

Lines changed: 32 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,17 @@ science files.
163163

164164
| Attribute used by MetGenC (location in netCDF file) | ACDD | CF Conventions | NSIDC Guidelines | Notes |
165165
| ----------------------------- | ---- | -------------- | ---------------- | ------- |
166-
| date_modified (global) | S | | R | 1, OC |
167-
| time_coverage_start (global) | R | | R | 2, OC, P |
168-
| time_coverage_end (global) | R | | R | 2, OC, P |
169-
| grid_mapping_name (variable) | | RequiredC | R+ | 3 |
170-
| crs_wkt (variable with `grid_mapping_name` attribute) | | | R | 4 |
171-
| GeoTransform (variable with `grid_mapping_name` attribute) | | | R | 5, OC |
172-
| standard_name, `projection_x_coordinate` (variable) | | RequiredC | | 6 |
173-
| standard_name, `projection_y_coordinate` (variable) | | RequiredC | | 7 |
166+
| time_coverage_start (global) | R | | R | 1, OC, P |
167+
| time_coverage_end (global) | R | | R | 1, OC, P |
168+
| grid_mapping_name (variable) | | RequiredC | R+ | 2 |
169+
| crs_wkt (variable with `grid_mapping_name` attribute) | | | R | 3 |
170+
| GeoTransform (variable with `grid_mapping_name` attribute) | | | R | 4, OC |
171+
| geospatial_lon_min (global) | R | | R | |
172+
| geospatial_lon_max (global) | R | | R | |
173+
| geospatial_lat_min (global) | R | | R | |
174+
| geospatial_lat_max (global) | R | | R | |
175+
| standard_name, `projection_x_coordinate` (variable) | | RequiredC | | 5 |
176+
| standard_name, `projection_y_coordinate` (variable) | | RequiredC | | 6 |
174177

175178
Notes column key:
176179

@@ -181,33 +184,28 @@ Notes column key:
181184
P = Premet file attributes that may be specified in a premet file; when used, a
182185
`premet_dir`path must be defined in the .ini file.
183186

184-
1 = Used to populate the ProductionDateTime field in UMM-G files when the global attributes
185-
date_modified or date_created are absent from a netCDF file. The date_modified ini file attribute
186-
is also a required .ini file attribute when running MetGenC on collections not comprising
187-
netCDF files See: [Required and Optional Configuration Elements](#required-and-optional-configuration-elements)
188-
189-
2 = Used to populate the time begin and end UMM-G values; OC .ini attribute for
187+
1 = Used to populate the time begin and end UMM-G values; OC .ini attribute for
190188
time_coverage_start is `time_start_regex` = \<value\>, and for time_coverage_end the
191189
.ini attribute is `time_coverage_duration` = \<value\>.
192190

193-
3 = A grid mapping variable is required if the horizontal spatial coordinates are not
191+
2 = A grid mapping variable is required if the horizontal spatial coordinates are not
194192
longitude and latitude and the intent of the data provider is to geolocate
195193
the data. `grid_mapping` and `grid_mapping_name` allow programmatic identification of
196194
the variable holding information about the horizontal coordinate reference system.
197195

198-
4 = The `crs_wkt` ("coordinate referenc system well known text") value is handed to the
196+
3 = The `crs_wkt` ("coordinate referenc system well known text") value is handed to the
199197
`CRS` and `Transformer` modules in `pyproj` to conveniently deal
200198
with the reprojection of (y,x) values to EPSG 4326 (lon, lat) values.
201199

202-
5 = The `GeoTransform` value provides the pixel size per data value, which is then used
200+
4 = The `GeoTransform` value provides the pixel size per data value, which is then used
203201
to calculate the padding added to x and y values to create a GPolygon enclosing all
204202
of the data; OC .ini attribute is `pixel_size` = <value>.
205203

206-
6 = The values of the coordinate variable identified by the `standard_name` attribute
204+
5 = The values of the coordinate variable identified by the `standard_name` attribute
207205
with a value of `projection_x_coordinate` are reprojected and thinned to create a
208206
GPolygon, bounding rectangle, etc.
209207

210-
7 = The values of the coordinate variable identified by the `standard_name` attribute
208+
6 = The values of the coordinate variable identified by the `standard_name` attribute
211209
with a value of `projection_y_coordinate` are reprojected and thinned to create a
212210
GPolygon, bounding rectangle, etc.
213211

@@ -218,7 +216,7 @@ MetGenC-required attributes. When not reported, that attribute will have to be a
218216
its associated .ini attribute being added to the .ini file. See [Optional Configuration Elements](#optional-configuration-elements)
219217
for full details/descriptions of these.
220218
```
221-
ncdump -h <file name.nc> | grep -e date_modified -e date_created -e time_coverage_start -e time_coverage_end -e GeoTransform -e crs_wkt -e spatial_ref -e grid_mapping_name -e 'standard_name = "projection_y_coordinate"' -e 'standard_name = "projection_x_coordinate"'
219+
ncdump -h <file name.nc> | grep -e time_coverage_start -e time_coverage_end -e GeoTransform -e crs_wkt -e spatial_ref -e grid_mapping_name -e 'standard_name = "projection_y_coordinate"' -e 'standard_name = "projection_x_coordinate"'
222220
```
223221

224222

@@ -230,11 +228,7 @@ ncdump -h <file name.nc> | grep -e date_modified -e date_created -e time_coverag
230228
| axis (variable) | | R | |
231229
| geospatial_bounds (global) | R | | R |
232230
| geospatial_bounds_crs (global)| R | | R |
233-
| geospatial_lat_min (global) | R | | R |
234-
| geospatial_lat_max (global) | R | | R |
235231
| geospatial_lat_units (global) | R | | R |
236-
| geospatial_lon_min (global) | R | | R |
237-
| geospatial_lon_max (global) | R | | R |
238232
| geospatial_lon_units (global) | R | | R |
239233

240234
### Attribute Reference links
@@ -361,32 +355,28 @@ in the `metgenc init` functionality.
361355

362356
See this project's GitHub file, `fixtures/test.ini` for examples.
363357

364-
| .ini element | .ini section | Attribute absent from netCDF file the .ini attribute stands in for | Attribute populated in UMMG | Note |
358+
| .ini element | .ini section | Attribute absent from netCDF file the .ini attribute stands in for | Attribute populated in UMMG | Note |
365359
| -----------------------|-------------- | ------------------- | ---------------------------| ---- |
366-
| date_modified | Collection | date_modified | ProductionDateTime | 1, R |
367-
| time_start_regex | Collection | time_coverage_start | BeginningDateTime | 2 |
368-
| time_coverage_duration | Collection | time_coverage_end | EndingDateTime | 3 |
369-
| pixel_size | Collection | GeoTransform | n/a | 4 |
360+
| time_start_regex | Collection | time_coverage_start | BeginningDateTime | 1 |
361+
| time_coverage_duration | Collection | time_coverage_end | EndingDateTime | 2 |
362+
| pixel_size | Collection | GeoTransform | n/a | 3 |
370363

371364
R = Required for all non-netCDF file types (e.g., csv, .tif, .h5, etc) and netCDF files missing
372365
the global attribute specified
373-
1. Set this to be the YYYY-MM-DD that you're running MetGenC (e.g., date_modified =
374-
2025-08-07); this value is a constant that will populate ProductionDateTime in all UMMG files.
375-
* The ProductionDateTime field in a UMMG file mustn't show as "None"; if it does, Cumulus
376-
will throw ingest errors stating that ProductionDateTime can't be "None".
377-
* This attribute should be used with "nearly" compliant netCDF files wherein their global
378-
attributes are missing the `date_modified` or `date_created` attribtes.
379-
2. This regex attribute leverages a netCDF's file name containing a date to populate UMMG files'
380-
TemporalExtent field attribute, BeginningDateTime. Must match using the named group `(?P<time_coverage_start>)`.
366+
367+
1. This regex attribute leverages a netCDF's file name containing a date to populate UMMG files'
368+
TemporalExtent field attribute, BeginningDateTime. Must match using the named group `(?P<time_coverage_start>)`.
381369
* This attribute is meant to be used with "nearly" compliant netCDF files, but not other file types
382370
(csv, tif, etc.) since these should rely on premet files containing temporal details for each file.
383-
3. The time_coverage_duration attribute value specifies the duration to be applied to the `time_coverage_start`
371+
372+
2. The time_coverage_duration attribute value specifies the duration to be applied to the `time_coverage_start`
384373
value to generate correct EndingDateTime values in UMMG files; this value is a constant that will
385374
be applied to each time_start_regex value gleaned from files. Must be a valid
386375
[ISO duration value](https://en.wikipedia.org/wiki/ISO_8601#Durations).
387376
* This attribute is meant to be used with "nearly" compliant netCDF files, but not other file types
388377
(csv, tif, etc.) since these should rely on premet files containing temporal details for each file.
389-
5. Rarely applicable for science files that aren't gridded netCDF (.txt, .csv, .jpg, .tif, etc.); this
378+
379+
3. Rarely applicable for science files that aren't gridded netCDF (.txt, .csv, .jpg, .tif, etc.); this
390380
value is a constant that will be applied to all granule-level metadata.
391381

392382
#### Granule and Browse regex
@@ -463,7 +453,6 @@ spatial_dir = spatial/ipflt1b
463453
auth_id = IPFLT1B_DUCk
464454
version = 1
465455
provider = OIB; metgenc version 1.10.0rc0
466-
date_modified = 2025-08-04
467456
granule_regex = (IPFLT1B_)(?P<granuleid>.+?(?=_)_)?(DUCk)
468457
```
469458
And a multi-file granule comprising the following files:
@@ -619,7 +608,6 @@ Using configuration:
619608
+ time_start_regex: None
620609
+ time_coverage_duration: None
621610
+ pixel_size: None
622-
+ date_modified: None
623611
+ browse_regex: _brws
624612
+ granule_regex: (NSIDC0081_SEAICE_PS_)(?P<granuleid>[NS]{1}\d{2}km_\d{8})(_v2.0_)(?:F\d{2}_)?(DUCk)
625613
```
@@ -633,7 +621,9 @@ Using configuration:
633621
* checksum_type: is another config file entry that could be changed by the operator, but should be left as-is!
634622
* number: 1000000 is the default max granule count for ingest. This value is not found in the config file, thus it can only be changed by a DUCk developer if necessary.
635623
* dry_run: reflects the option included (or not) by the operator in the command line when `metgenc process` is run.
636-
* premet_dir:, spatial_dir:, collection_geometry_override:, collection_temporal_override:, time_start_regex:, time_coverage_duration:, pixel_size:, date_modified:, browse_regex:, and granule_regex: are all optional as they're data set dependent and should be set when necessary by operators within the config file.
624+
* premet_dir:, spatial_dir:, collection_geometry_override:, collection_temporal_override:,
625+
time_start_regex:, time_coverage_duration:, pixel_size:, browse_regex:, and granule_regex:
626+
are all optional as they're data set dependent and should be set when necessary by operators within the config file.
637627
---
638628

639629
### process

docs/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
project = "MetGenC"
77
copyright = "2024, NSIDC"
88
author = "National Snow and Ice Data Center"
9-
release = "v1.11.0rc1"
10-
version = "v1.11.0rc1"
9+
release = "v1.11.0rc2"
10+
version = "v1.11.0rc2"
1111

1212
extensions = [
1313
"myst_parser",

fixtures/test.ini

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ collection_temporal_override = False
99
auth_id = IRTIT3
1010
version = 2
1111
provider = FOOBAR
12-
date_modified = 20230101
1312
time_start_regex = IRTIT3_(?P<time_coverage_start>\d{8})_
1413
pixel_size = 25
1514
time_coverage_duration = P0DT23H59M59S

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "nsidc-metgenc"
3-
version = "1.11.0rc1"
3+
version = "1.11.0rc2"
44
description = "The nsidc-metgenc package enables data producers as well as Operations staff managing the data ingest workflow to create metadata files conforming to NASA's Common Metadata Repository UMM-G specification."
55
authors = ["National Snow and Ice Data Center (NSIDC) <nsidc@nsidc.org>"]
66
readme = "README.md"
@@ -53,7 +53,7 @@ requests = "^2.32.4"
5353
beautifulsoup4 = "^4.13.4"
5454

5555
[tool.bumpversion]
56-
current_version = "1.11.0rc1"
56+
current_version = "1.11.0rc2"
5757
parse = """(?x)
5858
(?P<major>0|[1-9]\\d*)\\.
5959
(?P<minor>0|[1-9]\\d*)\\.

src/nsidc/metgen/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "v1.11.0rc1"
1+
__version__ = "v1.11.0rc2"
22

33

44
__all__ = [

src/nsidc/metgen/config.py

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ class Config:
4343
time_start_regex: Optional[str] = None
4444
time_coverage_duration: Optional[str] = None
4545
pixel_size: Optional[int] = None
46-
date_modified: Optional[str] = None
4746
browse_regex: Optional[str] = None
4847
granule_regex: Optional[str] = None
4948
reference_file_regex: Optional[str] = None
@@ -263,14 +262,6 @@ def configuration(
263262
config_parser,
264263
overrides,
265264
),
266-
_get_configuration_value(
267-
environment,
268-
"Collection",
269-
"date_modified",
270-
str,
271-
config_parser,
272-
overrides,
273-
),
274265
_get_configuration_value(
275266
environment,
276267
"Collection",

src/nsidc/metgen/metgen.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -752,10 +752,8 @@ def create_ummg(configuration: config.Config, granule: Granule) -> Granule:
752752
# }
753753

754754
summary = {
755-
"production_date_time": utilities.ensure_iso_datetime(
756-
configuration.date_modified
757-
),
758755
"size_in_bytes": granule.size(),
756+
"production_date_time": granule.submission_time,
759757
} | granule.data_reader(
760758
granule.reference_data_filename,
761759
temporal_content,

0 commit comments

Comments
 (0)