- Home
- Documentation
- API reference
- Spectral
- hyperproc.spectral.continuum
hyperproc.spectral.continuum¶
Source-derived reference
Generated from the current hyperproc 0.1.2 checkout.
Implementation: hyperproc/spectral/continuum.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.
Exported entry points¶
| Importable name | Definition |
|---|---|
hyperproc.spectral.continuum.continuum_removal |
hyperproc.spectral.continuum.continuum_removal |
Continuum removal by the upper convex hull.
Dividing a spectrum by its own hull separates the shape of an absorption from the brightness of the surface under it, which is what makes a feature depth comparable between scenes and between sensors.
The hull is fitted inside each run of usable bands, never across one, so it cannot invent a continuum over a region the instrument does not see.
_upper_hull(a: np.ndarray, wl: np.ndarray) -> np.ndarray
¶
Upper convex hull of each spectrum, evaluated at every wavelength.
A monotone chain, run for every pixel at once: the stack is an index array and the "pop" step is a masked update, so the cost is a few hundred vector operations rather than a Python loop over millions of spectra.
Source code in hyperproc/spectral/continuum.py
_continuum_block(a: np.ndarray, wl: np.ndarray, runs) -> np.ndarray
¶
Source code in hyperproc/spectral/continuum.py
continuum_removal(ds: xr.Dataset, var: str | None = None, window: tuple | None = None, good_only: bool = True) -> xr.Dataset
¶
Divide each spectrum by its upper convex hull.
The hull is fitted within each run of usable bands, so it never spans a water-vapour gap and invent a continuum across a region the instrument cannot see. Outside the fitted runs the result is NaN.
| PARAMETER | DESCRIPTION |
|---|---|
ds
|
dataset with a
TYPE:
|
var
|
variable name; the main cube by default.
TYPE:
|
window
|
restrict to
TYPE:
|
good_only
|
fit only within runs of bands flagged usable.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Dataset
|
A copy of |
Dataset
|
the hull and below 1 inside an absorption. |