This repository enables users to generate daily NetCDF files from AMSR2 binary sea ice concentration data for the NSIDC-0803 dataset. The tool creates CF-compliant NetCDF files with proper metadata and coordinate reference system information using pyproj for authoritative CRS definitions.
- This repository is not actively supported by NSIDC but we welcome issue submissions and pull requests in order to foster community contribution.
See the LICENSE for details on permissions and warranties. Please contact [email protected] for more information.
- Python 3.8+
- conda or mamba
All Python dependencies are managed via the included environment.yml
file.
There is a conda environment that is built automatically on the spinup of the virutal machine so no manual installation needed.
The main script processes binary AMSR2 files and generates CF-compliant NetCDF files with proper metadata following the approved NSIDC-0803 specification.
# Process yesterday's data with all defaults
python nsidc0803_generator.py
# Process specific date
python nsidc0803_generator.py -s 2024-01-05 -e 2024-01-05
# Process date range
python nsidc0803_generator.py -s 2024-01-05 -e 2024-01-10
# Process only northern hemisphere
python nsidc0803_generator.py -s 2024-01-05 -h north
-b, --binary-dir
: Directory containing binary input files (default:/disks/sidads_staging/DATASETS/nsidc0740_AS2_nrt_nasateam_seaice_v1/
)-o, --output-dir
: Directory for NetCDF output files (default:/share/apps/nsidc0803/
)-t, --template
: CDL template file (default:nsidc0803_template.cdl
)-s, --start-date
: Start date YYYY-MM-DD or YYYYMMDD (default: yesterday)-e, --end-date
: End date YYYY-MM-DD or YYYYMMDD (default: yesterday)-h, --hemisphere
: north/south/both (default: both)-v, --verbose
: Verbose output
The tool accepts dates in two formats:
YYYY-MM-DD
(e.g.,2024-01-05
)YYYYMMDD
(e.g.,20240105
)
# Process yesterday's data (simplest usage)
python nsidc0803_generator.py
# Process specific date with dashes
python nsidc0803_generator.py -s 2024-01-05 -e 2024-01-05
# Process date range, northern hemisphere only
python nsidc0803_generator.py -s 2024-01-05 -e 2024-01-10 -h north
# Custom directories and template
python nsidc0803_generator.py \
-b /custom/binary/path \
-o /custom/output/path \
-t custom_template.cdl \
-s 2024-01-05
# Verbose output for debugging
python nsidc0803_generator.py -v
nt_YYYYMMDD_as2_nrt_n.bin
(Northern Hemisphere)nt_YYYYMMDD_as2_nrt_s.bin
(Southern Hemisphere)
NSIDC-0803_SEAICE_AMSR2_N_YYYYMMDD_v2.0.nc
(Northern Hemisphere)NSIDC-0803_SEAICE_AMSR2_S_YYYYMMDD_v2.0.nc
(Southern Hemisphere)
Files are organized in date-based subdirectories:
output_dir/
├── 2024.01.05/
│ ├── NSIDC-0803_SEAICE_AMSR2_N_20240105_v2.0.nc
│ └── NSIDC-0803_SEAICE_AMSR2_S_20240105_v2.0.nc
├── 2024.01.06/
│ ├── NSIDC-0803_SEAICE_AMSR2_N_20240106_v2.0.nc
│ └── NSIDC-0803_SEAICE_AMSR2_S_20240106_v2.0.nc
└── ...
Default paths are defined in utils.py
and can be modified:
INPUT_DIR = "/disks/sidads_staging/DATASETS/nsidc0740_AS2_nrt_nasateam_seaice_v1/"
OUTPUT_DIR = "/share/apps/nsidc0803/"
The codebase is organized into:
nsidc0803_generator.py
: Main CLI interface and orchestrationutils.py
: Core utility functions for file processingnsidc0803_template.cdl
: NetCDF template with metadata
Missing binary files:
No binary file found: 2024-01-05 north
- Check that binary files exist in the specified directory
- Verify file naming convention:
nt_YYYYMMDD_as2_nrt_[n|s].bin
ncgen errors:
ncgen failed: syntax error
- Ensure
ncgen
is installed and available in PATH - Check CDL template syntax
Import errors:
- Verify conda environment is activated
- Check that all dependencies are installed:
conda env update -f environment.yml
Use -v
flag for detailed processing information:
python nsidc0803_generator.py -v
This content was developed by the National Snow and Ice Data Center with funding from multiple sources.