- Home
- Documentation
- API reference
- Corrections
- hyperproc.correct.coefficients
hyperproc.correct.coefficients¶
Source-derived reference
Generated from the current hyperproc 0.1.2 checkout.
Implementation: hyperproc/correct/coefficients.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.
Coefficient files.
A correction is only as trustworthy as its coefficients, so hyperproc writes them to JSON where they can be read, reused and audited. Design choices:
- Keyed by wavelength (nanometres, 4 decimals), never by band index. Band indices change with band subsets and mean nothing across sensors; a wavelength key can be aligned to any cube of the same instrument.
- Diagnostics next to the numbers. Every topographic C carries the fit's slope, intercept, r, effect size, t statistic, sample count and status; a BRDF fit carries its bins, samples per bin, r2 per band and bin, and the angular-diversity check that says whether the fit was identifiable.
- Provenance. Which inputs (by stem), which masks, which settings, which software version, when. The pairing of a coefficient file with its image is written inside the file - the failure mode where files get matched by directory listing order is not reproducible here.
Two containers: :class:TopoCoefficients (one image) and
:class:BRDFCoefficients (one group of images).
FORMAT = 'hyperproc.correction'
module-attribute
¶
VERSION = 1
module-attribute
¶
TopoCoefficients
dataclass
¶
Per-image topographic correction coefficients with their fit diagnostics.
Source code in hyperproc/correct/coefficients.py
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 | |
method: str
instance-attribute
¶
fit_method: str
instance-attribute
¶
wavelength: np.ndarray
instance-attribute
¶
c: np.ndarray
instance-attribute
¶
status: list
instance-attribute
¶
slope: np.ndarray
instance-attribute
¶
intercept: np.ndarray
instance-attribute
¶
r: np.ndarray
instance-attribute
¶
effect: np.ndarray
instance-attribute
¶
t: np.ndarray
instance-attribute
¶
n_samples: int
instance-attribute
¶
calc_mask: dict = field(default_factory=dict)
class-attribute
instance-attribute
¶
apply_mask: dict = field(default_factory=dict)
class-attribute
instance-attribute
¶
diagnostic: dict = field(default_factory=dict)
class-attribute
instance-attribute
¶
source: dict = field(default_factory=dict)
class-attribute
instance-attribute
¶
meta: dict = field(default_factory=dict)
class-attribute
instance-attribute
¶
n_ok: int
property
¶
verdict: str
property
¶
__init__(method: str, fit_method: str, wavelength: np.ndarray, c: np.ndarray, status: list, slope: np.ndarray, intercept: np.ndarray, r: np.ndarray, effect: np.ndarray, t: np.ndarray, n_samples: int, calc_mask: dict = dict(), apply_mask: dict = dict(), diagnostic: dict = dict(), source: dict = dict(), meta: dict = dict()) -> None
¶
c_for(wavelength, tol: float = 0.5) -> np.ndarray
¶
C aligned to another wavelength axis (NaN where absent or no C).
Source code in hyperproc/correct/coefficients.py
summary() -> str
¶
Source code in hyperproc/correct/coefficients.py
to_dict() -> dict
¶
Source code in hyperproc/correct/coefficients.py
to_json(path) -> Path
¶
Source code in hyperproc/correct/coefficients.py
from_dict(d: dict) -> 'TopoCoefficients'
classmethod
¶
Source code in hyperproc/correct/coefficients.py
BRDFCoefficients
dataclass
¶
One group's FlexBRDF coefficients with provenance.
Source code in hyperproc/correct/coefficients.py
fit: FlexFit
instance-attribute
¶
mode: str
instance-attribute
¶
group: list = field(default_factory=list)
class-attribute
instance-attribute
¶
calc_mask: dict = field(default_factory=dict)
class-attribute
instance-attribute
¶
apply_mask: dict = field(default_factory=dict)
class-attribute
instance-attribute
¶
diversity: dict = field(default_factory=dict)
class-attribute
instance-attribute
¶
source: dict = field(default_factory=dict)
class-attribute
instance-attribute
¶
meta: dict = field(default_factory=dict)
class-attribute
instance-attribute
¶
wavelength: np.ndarray
property
¶
feasible: bool
property
¶
__init__(fit: FlexFit, mode: str, group: list = list(), calc_mask: dict = dict(), apply_mask: dict = dict(), diversity: dict = dict(), source: dict = dict(), meta: dict = dict()) -> None
¶
summary() -> str
¶
Source code in hyperproc/correct/coefficients.py
to_dict() -> dict
¶
Source code in hyperproc/correct/coefficients.py
to_json(path) -> Path
¶
Source code in hyperproc/correct/coefficients.py
from_dict(d: dict) -> 'BRDFCoefficients'
classmethod
¶
Source code in hyperproc/correct/coefficients.py
_now() -> str
¶
provenance(**extra) -> dict
¶
The standard provenance block: software, time, host, plus anything passed.
Source code in hyperproc/correct/coefficients.py
_jsonable(o)
¶
Recursively convert numpy scalars/arrays so json.dump accepts them.
Source code in hyperproc/correct/coefficients.py
_wl_key(w: float) -> str
¶
align_wavelengths(have: np.ndarray, want: np.ndarray, tol: float = 0.5) -> np.ndarray
¶
Index into have for each wavelength in want (nearest within
tol nm), -1 where none is close enough.
Source code in hyperproc/correct/coefficients.py
load(path)
¶
Open either kind of coefficient file by its kind field.