From 759def999efc64802621f7ccbba2eac826c536bd Mon Sep 17 00:00:00 2001 From: Trey Stafford Date: Thu, 11 Dec 2025 14:16:46 -0700 Subject: [PATCH 1/2] Update DOIs for new product versions --- CHANGELOG.md | 4 ++++ pyproject.toml | 4 ++-- seaice_ecdr/__init__.py | 2 +- seaice_ecdr/nc_attrs.py | 2 +- seaice_ecdr/nrt.py | 2 +- 5 files changed, 9 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 981e42ea..e13c3d97 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# v2.1.1 + +* Update CDR product DOIs in NetCDF metadata. + # v2.1.0 * Add `--overwrite` flag for `ecdr daily` command. diff --git a/pyproject.toml b/pyproject.toml index b4eed8ef..71ba4869 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,9 +1,9 @@ [project] name = "seaice_ecdr" -version = "2.1.0" +version = "2.1.1" [tool.bumpversion] -current_version = "2.1.0" +current_version = "2.1.1" commit = false tag = false diff --git a/seaice_ecdr/__init__.py b/seaice_ecdr/__init__.py index 406c75dd..91fcb25b 100644 --- a/seaice_ecdr/__init__.py +++ b/seaice_ecdr/__init__.py @@ -6,7 +6,7 @@ from seaice_ecdr.constants import LOGS_DIR -__version__ = "v2.1.0" +__version__ = "v2.1.1" # The standard loguru log levels, in increasing order of severity, are: # TRACE, DEBUG, INFO, SUCCESS, WARNING, ERROR, CRITICAL diff --git a/seaice_ecdr/nc_attrs.py b/seaice_ecdr/nc_attrs.py index a630b506..2426bae6 100644 --- a/seaice_ecdr/nc_attrs.py +++ b/seaice_ecdr/nc_attrs.py @@ -192,7 +192,7 @@ def get_global_attrs( product_version=ECDR_PRODUCT_VERSION.version_str, spatial_resolution=f"{resolution}km", standard_name_vocabulary="CF Standard Name Table (v83, 17 October 2023)", - id="https://doi.org/10.7265/rjzb-pf78", + id="https://doi.org/10.7265/b18j-z797", naming_authority="org.doi.dx", license="No constraints on data access or use", summary=f"This data set provides a passive microwave sea ice concentration climate data record (CDR) based on gridded brightness temperatures (TBs) from the Nimbus-7 Scanning Multichannel Microwave Radiometer (SMMR) and the Defense Meteorological Satellite Program (DMSP) series of passive microwave radiometers: the Special Sensor Microwave Imager (SSM/I) and the Special Sensor Microwave Imager/Sounder (SSMIS). The sea ice concentration CDR is an estimate of sea ice concentration that is produced by combining concentration estimates from two algorithms developed at the NASA Goddard Space Flight Center (GSFC): the NASA Team (NT) algorithm and the Bootstrap (BT) algorithm. The individual algorithms are used to process and combine brightness temperature data at NSIDC. This product is designed to provide a consistent time series of sea ice concentrations (the fraction, or percentage, of ocean area covered by sea ice) from November 1978 to the present, which spans the coverage of several passive microwave instruments. The data are gridded on the NSIDC polar stereographic grid with {resolution} km x {resolution} km grid cells and are available in NetCDF file format. Each file contains a variable with the CDR concentration values as well as variables that hold the raw NT and BT processed concentrations for reference. Variables containing standard deviation, quality flags, and projection information are also included. Files that are from 2013 to the present also contain a prototype CDR sea ice concentration based on gridded TBs from the Advanced Microwave Scanning Radiometer 2 (AMSR2) onboard the GCOM-W1 satellite.", diff --git a/seaice_ecdr/nrt.py b/seaice_ecdr/nrt.py index c814265e..43988b63 100644 --- a/seaice_ecdr/nrt.py +++ b/seaice_ecdr/nrt.py @@ -265,7 +265,7 @@ def override_attrs_for_nrt( f"This data set provides a near-real-time (NRT) passive microwave sea ice concentration climate data record (CDR) based on gridded brightness temperatures (TBs) from the Global Change Observation Mission 1st-Water (GCOM-W1) passive microwave radiometer: Advanced Microwave Scanning Radiometer 2 (AMSR2). The sea ice concentration CDR is an estimate of sea ice concentration that is produced by combining concentration estimates from two algorithms developed at the NASA Goddard Space Flight Center (GSFC): the NASA Team algorithm and the Bootstrap algorithm. The individual algorithms are used to process and combine brightness temperature data at NSIDC. This product is designed to provide an NRT time series of sea ice concentrations (the fraction, or percentage, of ocean area covered by sea ice). The data are gridded on the NSIDC polar stereographic grid with {resolution} x {resolution} km grid cells and are available in NetCDF file format. Each file contains a variable with the CDR concentration values as well as variables that hold the NASA Team and Bootstrap processed concentrations for reference. Variables containing standard deviation, quality flags, and projection information are also included." ) - override_for_nrt.attrs["id"] = "https://doi.org/10.7265/j0z0-4h87" + override_for_nrt.attrs["id"] = "https://doi.org/10.7265/tm2n-1m33" link_to_dataproduct = f"https://nsidc.org/data/g10016/versions/{ECDR_NRT_PRODUCT_VERSION.major_version_number}" override_for_nrt.attrs["metadata_link"] = link_to_dataproduct override_for_nrt.attrs["title"] = ( From 86cf97ed72dd11d39395f50864f208a2e81a31f3 Mon Sep 17 00:00:00 2001 From: Trey Stafford Date: Thu, 11 Dec 2025 14:39:06 -0700 Subject: [PATCH 2/2] Script to update DOIs --- scripts/fix_dois_202512.py | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 scripts/fix_dois_202512.py diff --git a/scripts/fix_dois_202512.py b/scripts/fix_dois_202512.py new file mode 100644 index 00000000..42ea9004 --- /dev/null +++ b/scripts/fix_dois_202512.py @@ -0,0 +1,33 @@ +"""Script to update DOIs for G02202 V6 and G10116 V4. + +On Dec. 11, 2025, we realized that the DOI for these products was wrong (used +the previous version). This script updates existing nc files to have the correct +DOI in order to avoid data reprocessing. +""" + +from pathlib import Path + +from netCDF4 import Dataset + +FINAL_DATA_DIR = Path("/share/apps/G02202_V6/v06r00_outputs/dev/trst2284/complete") +NRT_DATA_DIR = Path("/share/apps/G10016_V4/v04r00/dev/trst2284/CDR/complete/") + +FINAL_DOI = "https://doi.org/10.7265/b18j-z797" +NRT_DOI = "https://doi.org/10.7265/tm2n-1m33" + + +def update_dois(data_dir, doi): + print(f"Updating nc files in {data_dir} with doi {doi}") + for nc_file in data_dir.rglob("*.nc"): + with Dataset(str(nc_file), "a") as nc: + if "id" in nc.ncattrs(): + nc.setncattr("id", doi) + else: + print( + f"Did not update doi in {nc_file} because it lacked an `id` attr." + ) + + +if __name__ == "__main__": + update_dois(FINAL_DATA_DIR, FINAL_DOI) + update_dois(NRT_DATA_DIR, NRT_DOI)