- Home
- Documentation
- API reference
- Readers
- hyperproc.readers.pace
hyperproc.readers.pace¶
Source-derived reference
Generated from the current hyperproc 0.1.2 checkout.
Implementation: hyperproc/readers/pace.py. Signatures, defaults, docstrings, and expandable source are extracted statically; the module is not imported or executed. Names beginning with _ are implementation details, not a stable public API.
Use the function signature as the authority for individual parameter defaults and return annotations. Original docstrings sometimes group parameter names or wrap return descriptions across lines; these descriptions are preserved rather than inferred or rewritten.
PACE OCI (NASA) reader for L1B and L2 SFREFL granules.
OCI is a very different instrument from the land imagers in this package: a ~1 km ocean-colour spectrometer on a wide swath. One granule here covers 25 to 49 degrees north and 119 to 84 degrees west - most of the continental US - so it is a global-scale product, not a scene.
======= ========================== ================== ===================
level variable bands geometry
======= ========================== ================== ===================
L1B rhot TOA reflectance 291 (blue+red+SWIR) full, in-file
L2 rhos surface reflectance 122 none - from L1B
======= ========================== ================== ===================
Three things catch people out:
- L1B splits the detector into three arrays -
rhot_blue(119 bands, 315-606 nm),rhot_red(163, 600-895 nm) andrhot_SWIR(9, 940-2258 nm), which overlap slightly. They are read, concatenated and sorted here. - L1B stores bands first,
(band, scan, pixel), not last. Reading it naively transposes the image. - L2 carries some geometry.
scan_line_attributes/csol_zgives a per-scan-line centre solar zenith andnavigation_data/tiltthe OCI tilt (used to dodge sunglint); both are read here and broadcast across track. The full per-pixelsaa/vza/vaalive only in the L1B granule for the same timestamp, which is located automatically when it sits alongside. - Neither level ships FWHM. The 5 nm hyperspectral sampling is used as a documented nominal; the SWIR bands get their real bandpass, which runs 15-80 nm and is nothing like 5.
Both levels are swaths with per-pixel lat/lon and no CRS. Use
:func:hyperproc.georeference to put them on a grid; it defaults to EPSG:4326
here rather than a UTM zone, because the swath is far too wide for one.
FILL = -32767.0
module-attribute
¶
NOMINAL_FWHM_NM = 5.0
module-attribute
¶
SWIR_BANDPASS = {939.71: 45.0, 1038.32: 80.0, 1250.38: 30.0, 1248.55: 30.0, 1378.17: 15.0, 1619.62: 75.0, 1618.03: 75.0, 2130.59: 50.0, 2258.43: 75.0}
module-attribute
¶
ARMS = ('blue', 'red', 'SWIR')
module-attribute
¶
FLAGS = ('ATMFAIL', 'LAND', 'HIGLINT', 'HILT', 'HISATZEN', 'COASTZ', 'STRAYLIGHT', 'CLDICE', 'TURBIDW', 'HISOLZEN', 'NAVFAIL', 'CLDSHDSTL')
module-attribute
¶
GEOM = {'solar_zenith': 'sza', 'solar_azimuth': 'saa', 'sensor_zenith': 'vza', 'sensor_azimuth': 'vaa', 'height': 'elev', 'watermask': 'water'}
module-attribute
¶
_GRANULE = re.compile('^PACE_OCI\\.(?P<stamp>\\d{8}T\\d{6})\\.(?P<level>L1B|L2)\\.(?P<rest>.+)\\.nc$', re.IGNORECASE)
module-attribute
¶
open_pace(path: str | Path, wl_range: tuple[float, float] | None = None, flags: bool = True, geometry: bool = True, latlon: bool = True) -> xr.Dataset
¶
Open a PACE OCI granule.
| PARAMETER | DESCRIPTION |
|---|---|
path
|
TYPE:
|
wl_range
|
TYPE:
|
flags
|
decode
TYPE:
|
geometry
|
attach angles. L2 always gets its own
TYPE:
|
latlon
|
attach the
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Dataset
|
Dataset with |
Dataset
|
levels are swaths. |
Source code in hyperproc/readers/pace.py
_fwhm_for(wl: np.ndarray) -> np.ndarray
¶
Nominal 5 nm below 900 nm; the real SWIR bandpass above it.
Source code in hyperproc/readers/pace.py
_read_l2(path: Path)
¶
Source code in hyperproc/readers/pace.py
_read_l1b(path: Path)
¶
Merge the three detector arrays. Each is (band, scan, pixel).
Source code in hyperproc/readers/pace.py
_add_latlon(ds: xr.Dataset, path: Path, level: str) -> None
¶
Source code in hyperproc/readers/pace.py
_add_flags(ds: xr.Dataset, path: Path) -> None
¶
Source code in hyperproc/readers/pace.py
_add_scanline(ds: xr.Dataset, path: Path) -> None
¶
Geometry the L2 granule carries itself, so it is usable standalone.
csol_z is a per-scan-line centre solar zenith and tilt the OCI
tilt used to dodge sunglint. Both vary only along track, so they are
broadcast across it - approximate off-centre, but far better than nothing
when no L1B sibling is present.
Source code in hyperproc/readers/pace.py
_add_geometry(ds: xr.Dataset, path: Path, level: str, stamp: str) -> None
¶
Full per-pixel angles from L1B; L2 also keeps its own scan-line values.