Spectral Preprocessing
Sensor-aware optical preprocessing with six radiometric choices, six atmospheric choices, product-level detection, and a safety lock that prevents double atmospheric correction of existing Surface Reflectance products.
1. Scope & Processing Contract
Spectral Preprocessing converts sensor-encoded optical imagery into a physically meaningful radiometric domain and, when appropriate, Surface Reflectance. The current implementation is sensor/product aware: the raster is inspected before a calibration path is selected.
2. Sensor & Product Detection
The application offers Auto plus a manual Sensor / Product Type selection. Auto detection combines project/layer context, raster metadata/tags, band metadata and source/product naming. Explicit semantic metadata such as “surface reflectance”, “TOA reflectance” or “radiance” takes priority over filename heuristics.
| Profile | Typical product state recognized | Auto behavior |
|---|---|---|
| Landsat 1–5 MSS / TM / ETM+ / OLI | L1 = calibrated DN; L2SP/L2SR = Surface Reflectance | L1 uses metadata calibration; L2 is locked and decoded/preserved. |
| Sentinel-2 MSI | L1C = TOA Reflectance; L2A = BOA/Surface Reflectance | L1C can proceed to atmospheric correction; L2A is locked. |
| MODIS Terra/Aqua | MOD02/MYD02 L1B = radiance; MOD09/MYD09 = Surface Reflectance | MOD09/MYD09 are preserved; L1B requires radiance-aware processing. |
| ASTER | L1T = encoded sensor values; AST_07-type products = Surface Reflectance | Metadata/UCC paths are used when available; SR is preserved. |
| NASA EMIT | L1B = calibrated radiance; L2A RFL = Surface Reflectance | L2A is preserved; L1B stays radiance unless a compatible correction path is explicitly selected. |
| Sentinel-3 OLCI | L1 radiometric values / radiance; L2 product dependent | Detection is conservative; inspect product semantics before forcing SR assumptions. |
| PlanetScope / SkySat / Pléiades / Pléiades Neo / SPOT 6/7 / WorldView-GeoEye / Beijing-3A | Depends on ordered/delivered product | Auto relies on embedded metadata and product naming; manual profile is available. |
| CBERS / Amazonia-1 / PRISMA / DESIS / EnMAP | Level and domain vary by product | Known reflectance/radiance terms are used; otherwise the engine fails safely or requires manual selection. |
| Generic / Unknown | Unknown | No calibration constants are invented. Metadata scale/offset can be used only when present. |
3. Radiometric Calibration — 6 Choices
| Method | Purpose | Required information | Typical input → output |
|---|---|---|---|
| Auto | Follow detected radiometric state and sensor metadata. | Recognizable product metadata/state. | DN → TOA reflectance/radiance, or preserve existing physical values. |
| Preserve / Already Calibrated | Keep current numeric domain. | User must know the input domain. | Radiance → radiance, reflectance → reflectance. |
| Metadata Scale & Offset | Decode scaled integer/encoded physical values. | Raster scale/offset or equivalent tags. | Encoded DN → physical value. |
| DN → TOA Radiance | Convert calibrated DN to at-sensor spectral radiance. | Multiplicative/additive radiance coefficients, or compatible LMIN/LMAX metadata; ASTER UCC is supported when present. | DN → W m⁻² sr⁻¹ µm⁻¹. |
| DN → TOA Reflectance | Convert reflective DN to top-of-atmosphere reflectance. | Sensor/product reflectance coefficients and solar geometry as required. | DN → dimensionless TOA reflectance. |
| Radiance → TOA Reflectance | Normalize at-sensor radiance by solar irradiance and acquisition geometry. | ESUN/solar irradiance, Earth–Sun distance, sun elevation/zenith. | Radiance → TOA reflectance. |
3.1 Generic scale and offset
3.2 DN to TOA radiance
3.3 DN to TOA reflectance
ρλ = ρ′λ / sin(θSE)
3.4 Radiance to TOA reflectance
4. Atmospheric Correction — 6 Choices
| Method | What it does | Best use | Important limitation |
|---|---|---|---|
| Auto | Preserves existing SR; otherwise routes TOA/physical reflectance to DOS. If input is radiance, the engine attempts a metadata-supported radiance→TOA conversion before DOS. | Normal product-aware workflow. | Will stop when physical domain is ambiguous. |
| Preserve Existing Surface Reflectance | No second atmospheric correction. | Landsat L2SP/L2SR, Sentinel-2 L2A, MOD09/MYD09, EMIT L2A and equivalent SR products. | Rejected for a source that is not already SR. |
| Dark Object Subtraction (DOS) | Scene-based subtraction of a low-percentile reflectance per band. | Simple correction when detailed atmosphere inputs are unavailable. | Not a full radiative-transfer inversion. |
| 6S Radiative Transfer | Physics-based conversion using atmosphere/aerosol profiles, AOT, geometry, altitude and wavelength. | Advanced Level-1/radiance workflows with sufficient metadata. | Requires Py6S + a working 6S executable and valid geometry/date/wavelength metadata. |
| Empirical Line Method | Fits a per-band linear mapping from image values to known field/target reflectance using dark and bright ROIs. | UAV/commercial/field-calibrated imagery with reference targets. | Requires two valid ROIs and known reflectance values. |
| None | Leaves the radiometric result without atmospheric correction. | When the next algorithm explicitly expects TOA/radiance or correction is handled elsewhere. | Output may not be Surface Reflectance. |
4.1 Dark Object Subtraction
4.2 6S implementation
For each selected band, the implementation resolves a center wavelength, runs 6S, retrieves coefficients xa, xb, xc, and applies:
ρsurface = y / (1 + xcy)
Conditional parameters include atmosphere profile, aerosol profile, AOT550, target altitude, solar/view zenith and azimuth overrides, and acquisition month/day.
4.3 Empirical Line
offset = ρdark − gain·xdark
The current implementation uses mean observed values inside the two ROIs and requires at least three valid pixels in each ROI for every selected band.
5. Level-2 / Surface Reflectance Safety Lock
Already Surface Reflectance
Sentinel-2 L2A
Landsat L2SP / L2SR
MOD09 / MYD09
EMIT L2A RFL
ASTER SR-type product
↓
Decode scale/offset if needed
↓
Atmospheric = Preserve 🔒The server does not allow DOS or 6S to be applied a second time simply because the user selects it.
Level-1 / uncorrected
Landsat L1
Sentinel-2 L1C
MODIS L1B
ASTER L1T
EMIT L1B Radiance
↓
Radiometric path
↓
TOA / Radiance
↓
Atmospheric method when compatibleAvailable methods depend on which coefficients, wavelengths and acquisition geometry survive in the product metadata.
6. Application Parameters
| Field | When shown | Meaning |
|---|---|---|
| Input Raster | Always | Project raster used as the metadata source and processing input. |
| Sensor / Product Type | Always | Auto or manual sensor profile. |
| Radiometric Calibration Method | Always | One of the six methods above; L2/SR is safety-locked in backend. |
| Atmospheric Correction Method | Always | One of the six methods above. |
| Dark Object Percentile | Auto / DOS | Low percentile used by DOS. |
| 6S atmosphere, aerosol, AOT, altitude, geometry/date | 6S | Radiative-transfer configuration and optional metadata overrides. |
| Dark / Bright Reference ROI + known reflectance | Empirical Line | Two calibration targets and their reference reflectance. |
| Select Input Bands | Always | Optional 1-based band subset; default is reflectance-compatible bands where semantic roles are known. |
| Output Nodata | Always | Default −9999. |
7. Output & Provenance
The output is a Float32 Cloud Optimized GeoTIFF using the source geospatial structure. The analysis metadata records both requested and effective methods so that automatic routing and safety locks remain auditable.
{
"product": {
"sensor_profile": "landsat_oli",
"processing_level": "L2SP/L2SR",
"reflectance_state": "surface_reflectance",
"detection_confidence": "high",
"preprocessing_locked": true
},
"stages": [
{"stage":"radiometric_calibration","effective_method":"metadata_scale_offset"},
{"stage":"atmospheric_correction","effective_method":"preserve_existing_surface_reflectance"}
],
"final_radiometric_state": "surface_reflectance"
}8. Recommended Workflows
Landsat / Sentinel L2
Input L2 SR ↓ Auto detection ↓ Scale/decode ↓ Preserve SR ↓ Analysis
Landsat L1
Input L1 DN ↓ DN → TOA Reflectance ↓ DOS or 6S ↓ Surface Reflectance
Field-calibrated imagery
Input physical image + Dark/Bright ROIs ↓ Empirical Line ↓ Surface Reflectance
For aquatic workflows, atmospheric/radiometric preprocessing comes before Hydro Preprocessing. For cross-sensor time series, Surface Reflectance comes before Spectral Harmonization.
9. Quality Control
- Confirm the detected product level and radiometric state before processing.
- Never force atmospheric correction on an already corrected Level-2 SR product.
- Do not use Metadata Scale & Offset unless a non-trivial scale/offset exists.
- Radiance→TOA Reflectance requires valid solar irradiance and solar geometry.
- 6S requires wavelength, solar/view geometry, date and an operational Py6S/6S installation.
- For Empirical Line, use homogeneous reference targets with independently known reflectance and adequate valid pixels.
- Inspect negative or >1 reflectance values scientifically; do not automatically clip them unless the downstream method requires it.
- Keep provenance when using the output for hyperspectral matching, harmonization, water analysis or ML.
10. Scientific & Technical References
- U.S. Geological Survey. Using the USGS Landsat Level-1 Data Product — TOA radiance and reflectance equations. USGS.
- U.S. Geological Survey. Landsat Collection 2 Surface Reflectance — Level-2 SR and scaling. USGS.
- NASA MODIS Land Team. MODIS Surface Reflectance (MOD09/MYD09). NASA.
- NASA Earthdata. EMIT L2A Estimated Surface Reflectance and Uncertainty and Masks. NASA Earthdata.
- Vermote, E. F. et al. 6S/6SV radiative-transfer heritage for atmospheric correction; MODIS Land validation resources summarize use of 6SV. NASA MODIS Land.
- Smith, G. M. & Milton, E. J. (1999). The use of the empirical line method to calibrate remotely sensed data to reflectance. International Journal of Remote Sensing 20(13), 2653–2662. DOI: 10.1080/014311699211994.