- Home
- Documentation
- API reference
- Readers
- hyperproc.readers.emit
hyperproc.readers.emit¶
Source-derived reference
Generated from the current hyperproc 0.1.2 checkout.
Implementation: hyperproc/readers/emit.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.
EMIT (NASA JPL, aboard the ISS) reader.
EMIT ships each granule as NetCDF-4 with three groups that xarray will not open
together, on a sensor grid (downtrack x crosstrack) rather than a map grid.
The location group carries a GLT (geometry lookup table) that maps it onto
the ortho grid, so orthorectification here is an index lookup, not a resample.
Two products are supported, and they share almost everything:
=========== ===== ================== ====================
file level variable units
=========== ===== ================== ====================
*_RFL_* L2A reflectance unitless (0-1)
*_RAD_* L1B radiance uW/cm^2/SR/nm
=========== ===== ================== ====================
The L2A_MASK and L1B_OBS siblings are picked up automatically for both,
since they describe the same scene. Needs only numpy + xarray.
GLT_NODATA = 0
module-attribute
¶
FILL_VALUE = -9999.0
module-attribute
¶
PRODUCTS = {'RFL': {'level': 'L2A', 'src': 'reflectance', 'var': 'reflectance', 'units': '1', 'long_name': 'surface reflectance'}, 'RAD': {'level': 'L1B', 'src': 'radiance', 'var': 'radiance', 'units': 'uW/cm^2/SR/nm', 'long_name': 'at-sensor calibrated radiance'}}
module-attribute
¶
MASK_FLAGS = {'cloud': 0, 'cirrus': 1, 'water': 2, 'spacecraft': 3, 'dilated_cloud': 4}
module-attribute
¶
MASK_VALUES = {'aod550': 5, 'h2o_g_cm2': 6}
module-attribute
¶
OBS_BANDS = {'path_length': 0, 'vaa': 1, 'vza': 2, 'saa': 3, 'sza': 4, 'solar_phase': 5, 'slope': 6, 'aspect': 7, 'cos_i': 8, 'utc_time': 9, 'earth_sun_distance': 10}
module-attribute
¶
_GRANULE = re.compile('^EMIT_(?P<level>L\\d[A-Z])_(?P<product>[A-Z]+)_(?P<rest>.+)\\.nc$')
module-attribute
¶
open_emit(path: str | Path, ortho: bool = True, wl_range: tuple[float, float] | None = None, good_bands_only: bool = False, masks: bool = True, geometry: bool = True) -> xr.Dataset
¶
Open an EMIT L2A reflectance or L1B radiance granule.
| PARAMETER | DESCRIPTION |
|---|---|
path
|
TYPE:
|
ortho
|
orthorectify onto the map grid using the granule's GLT.
False keeps the raw
TYPE:
|
wl_range
|
TYPE:
|
good_bands_only
|
set the bands EMIT flags as unusable to NaN (the
1320-1440 and 1770-1960 nm water-vapour windows). The band count is
unchanged - all 285 stay, 41 of them blanked - so band indices keep
lining up with the sensor's native grid. EMIT stores a constant
-0.01 sentinel in those bands, which otherwise reads as real data.
L2A only; L1B granules carry no
TYPE:
|
masks
|
fold in the
TYPE:
|
geometry
|
fold in the
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Dataset
|
Dataset with |
Dataset
|
|
Dataset
|
variables where the siblings exist. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
not an EMIT granule, or a product this reader does not handle (MASK / OBS / RFLUNCERT are read as siblings, not directly). |
Source code in hyperproc/readers/emit.py
60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 | |
_sibling(path: Path, level: str, product: str, rest: str) -> Path | None
¶
The sibling granule, tolerating a different processing-version suffix.
rest ends in the version (..._2311213_002); a MASK or OBS
reprocessed to _003 next to an RFL at _002 is still the same scene,
so fall back to the newest version of the same scene id.
Source code in hyperproc/readers/emit.py
_add_masks(ds: xr.Dataset, path: Path, rest: str, glt) -> None
¶
Source code in hyperproc/readers/emit.py
_add_geometry(ds: xr.Dataset, path: Path, rest: str, glt) -> None
¶
Source code in hyperproc/readers/emit.py
_stack_glt(loc: xr.Dataset) -> np.ndarray
¶
(y, x, 2) of 1-based (crosstrack, downtrack) lookups; 0 means no data.
_apply_glt(arr: np.ndarray, glt: np.ndarray) -> np.ndarray
¶
Map a sensor-grid array onto the ortho grid. Always returns 3-D.