- Home
- Documentation
- API reference
- Atmosphere
- hyperproc.atmos.process
hyperproc.atmos.process¶
Source-derived reference
Generated from the current hyperproc 0.1.2 checkout.
Implementation: hyperproc/atmos/process.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.
One call from an L1B granule to an atmospherically corrected GeoTIFF.
:func:process chains the stages the package offers and names the product by
what was done to it::
process("EMIT_L1B_RAD_....nc", "products/") -> <stem>_ac.tif
process(..., stages=("ac", "brdf")) -> <stem>_ac_brdf.tif
The atmospheric correction runs on the sensor grid (that is where the
per-pixel geometry lives) and the result is put on a map grid afterwards:
EMIT through the granule's own geographic look-up table (GLT), exactly as
JPL's L2A ortho products are made; sensors whose L1B is already projected
(AVIRIS-3/5) need nothing; lat/lon swaths go through
:func:hyperproc.georeference.
STAGES = ('ac', 'brdf')
module-attribute
¶
_open_for_ac(path: Path) -> xr.Dataset
¶
Open a granule the way the retrieval wants it.
EMIT is opened on its sensor grid (ortho=False): that is where the
per-pixel geometry lives and where JPL runs the retrieval; the GLT puts the
result on the map grid afterwards. Every other reader is opened with its
defaults: the AVIRIS-5 reader also has an ortho switch, but its sensor
grid carries no geolocation, so the correction runs on the ORT grid there.
Source code in hyperproc/atmos/process.py
_ortho_emit(ds: xr.Dataset, source: Path, window: dict | None = None) -> xr.Dataset
¶
Put a sensor-grid EMIT result on the granule's ortho grid through its GLT.
Lazy: the cube is gathered tile by tile when written. With window the
GLT is shifted to the window's origin and the ortho grid is cropped to the
cells the window covers.
Source code in hyperproc/atmos/process.py
to_map_grid(ds: xr.Dataset, source: str | Path | None = None, window: dict | None = None, like: xr.Dataset | None = None) -> xr.Dataset
¶
A projected version of a corrected dataset, whatever grid it came on.
- already has a CRS (AVIRIS-3/5 L1B, EnMAP L1C, Tanager): returned as is;
- EMIT sensor grid: gathered through the granule's GLT (needs
source, the L1B file, orattrs["source"]which :func:hyperproc.openrecords); - anything else with
lat/lonlayers (PRISMA, DESIS, PACE): :func:hyperproc.georeference, onto the grid oflikewhen given (for example ASI's PRISMA L2D, so the product compares cell for cell).
Source code in hyperproc/atmos/process.py
process(source, out_dir, work_dir=None, engine: str = 'sRTMnet', stages=('ac',), workers: int = 24, window: dict | None = None, overviews=True, layers=('aot550', 'h2o'), uncertainty: bool = False, like: xr.Dataset | None = None, brdf: dict | None = None, quality: bool | dict = True, format: str = 'GTiff', overwrite: bool = False, verbose: bool = True, **ac_kwargs) -> dict
¶
Run the requested stages on an L1B granule and write GeoTIFF products.
| PARAMETER | DESCRIPTION |
|---|---|
source
|
the L1B file (opened with the sensor-grid option where the reader has one) or an already opened hyperproc L1B dataset.
|
out_dir
|
where the products go. The reflectance is
|
work_dir
|
ISOFIT working directory; default
DEFAULT:
|
engine, workers, **ac_kwargs
|
passed to :func:
|
stages
|
DEFAULT:
|
brdf
|
options for the BRDF stage, passed to
:func:
TYPE:
|
format
|
TYPE:
|
quality
|
write
TYPE:
|
window
|
sensor-grid subset
TYPE:
|
overviews
|
internal pyramids on every GeoTIFF written (default True).
DEFAULT:
|
layers
|
2-D retrieval layers to write as separate GeoTIFFs.
DEFAULT:
|
uncertainty
|
also write the posterior uncertainty cube (
TYPE:
|
like
|
for swath sensors, a projected dataset whose grid the product
should reproduce (see :func:
TYPE:
|
overwrite
|
redo the ISOFIT retrieval even if the work dir holds one.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
dict
|
dict with |
dict
|
|
dict
|
(the projected, lazy dataset that was written). |
Source code in hyperproc/atmos/process.py
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 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 | |