From 485e3881d6cc24e78606ef0e4f5ada2e33604b57 Mon Sep 17 00:00:00 2001 From: That Dai Hai Ton Date: Thu, 16 Apr 2026 20:32:58 -0700 Subject: [PATCH] Add AMSR2 product class and support .he5 file extension in XCAL --- staremaster/products/__init__.py | 3 ++- staremaster/products/amsr2.py | 5 +++++ staremaster/products/xcal.py | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) create mode 100644 staremaster/products/amsr2.py diff --git a/staremaster/products/__init__.py b/staremaster/products/__init__.py index 5db5e98..c13bd3c 100644 --- a/staremaster/products/__init__.py +++ b/staremaster/products/__init__.py @@ -8,4 +8,5 @@ from staremaster.products.satcorps import satCORPS from staremaster.products.modis_tilegrid import ModisTile from staremaster.products.goes_abi_fixed_grid import GOES_ABI_FIXED_GRID -from staremaster.products.merra2 import MERRA2 \ No newline at end of file +from staremaster.products.merra2 import MERRA2 +from staremaster.products.amsr2 import AMSR2 \ No newline at end of file diff --git a/staremaster/products/amsr2.py b/staremaster/products/amsr2.py new file mode 100644 index 0000000..217ae04 --- /dev/null +++ b/staremaster/products/amsr2.py @@ -0,0 +1,5 @@ +from staremaster.products.xcal import XCAL + + +class AMSR2(XCAL): + scans = ['HDFEOS/SWATHS/AMSR2_L1R/Geolocation Fields/'] diff --git a/staremaster/products/xcal.py b/staremaster/products/xcal.py index 17002be..97dca91 100644 --- a/staremaster/products/xcal.py +++ b/staremaster/products/xcal.py @@ -24,7 +24,7 @@ def _detect_file_format(self): if file_ext in ['.nc', '.nc4', '.netcdf']: return 'netcdf4' - elif file_ext in ['.h5', '.hdf5', '.hdf']: + elif file_ext in ['.he5', '.h5', '.hdf5', '.hdf']: return 'hdf5' else: # Try to detect by attempting to open with each format