- Home
- Documentation
- API reference
- Spectral
- hyperproc.spectral.derivatives
hyperproc.spectral.derivatives¶
Source-derived reference
Generated from the current hyperproc 0.1.2 checkout.
Implementation: hyperproc/spectral/derivatives.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.derivatives.derivative |
hyperproc.spectral.derivatives.derivative |
Spectral derivatives, by Savitzky-Golay.
Differentiating raw reflectance amplifies noise, so the derivative comes from a local polynomial fit rather than finite differences, and only inside runs of usable bands: a difference taken across a water-vapour gap measures the gap.
_derivative_block(a: np.ndarray, wl: np.ndarray, runs, order: int, window: int, poly: int) -> np.ndarray
¶
Source code in hyperproc/spectral/derivatives.py
derivative(ds: xr.Dataset, var: str | None = None, order: int = 1, window: int = 7, poly: int = 2, good_only: bool = True) -> xr.Dataset
¶
The spectral derivative, by Savitzky-Golay.
Differentiating raw reflectance amplifies noise, so the derivative is taken from a local polynomial fit instead of finite differences, and only inside runs of usable bands: a difference taken across a water-vapour gap is an artefact of the gap.
| PARAMETER | DESCRIPTION |
|---|---|
ds
|
dataset with a
TYPE:
|
var
|
variable name; the main cube by default.
TYPE:
|
order
|
1 for the first derivative, 2 for the second.
TYPE:
|
window
|
filter length in bands, odd and greater than
TYPE:
|
poly
|
polynomial order of the local fit.
TYPE:
|
good_only
|
differentiate only within runs of usable bands.
TYPE:
|
| RETURNS | DESCRIPTION |
|---|---|
Dataset
|
A copy of |
Dataset
|
per nm to that power. |
| RAISES | DESCRIPTION |
|---|---|
ValueError
|
the window is even, too short, or no run is long enough. |