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.

Auto DetectL2 Safety LockRadiometric 6Atmospheric 6Surface Reflectance

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.

Input Raster ↓ Sensor / Product Detection ↓ Radiometric Calibration Method ↓ Radiance or TOA Reflectance ↓ Atmospheric Correction Method ↓ Surface Reflectance (when correction is applied) ↓ Float32 COG + provenance
Safety contract: when a product is confidently detected as existing Surface Reflectance, atmospheric correction is locked to Preserve Existing Surface Reflectance. A manual DOS/6S request is ignored rather than applying a second atmospheric correction.
6radiometric choices
6atmospheric choices
20sensor/product profiles
L2 lockdouble-correction guard

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.

ProfileTypical product state recognizedAuto behavior
Landsat 1–5 MSS / TM / ETM+ / OLIL1 = calibrated DN; L2SP/L2SR = Surface ReflectanceL1 uses metadata calibration; L2 is locked and decoded/preserved.
Sentinel-2 MSIL1C = TOA Reflectance; L2A = BOA/Surface ReflectanceL1C can proceed to atmospheric correction; L2A is locked.
MODIS Terra/AquaMOD02/MYD02 L1B = radiance; MOD09/MYD09 = Surface ReflectanceMOD09/MYD09 are preserved; L1B requires radiance-aware processing.
ASTERL1T = encoded sensor values; AST_07-type products = Surface ReflectanceMetadata/UCC paths are used when available; SR is preserved.
NASA EMITL1B = calibrated radiance; L2A RFL = Surface ReflectanceL2A is preserved; L1B stays radiance unless a compatible correction path is explicitly selected.
Sentinel-3 OLCIL1 radiometric values / radiance; L2 product dependentDetection is conservative; inspect product semantics before forcing SR assumptions.
PlanetScope / SkySat / Pléiades / Pléiades Neo / SPOT 6/7 / WorldView-GeoEye / Beijing-3ADepends on ordered/delivered productAuto relies on embedded metadata and product naming; manual profile is available.
CBERS / Amazonia-1 / PRISMA / DESIS / EnMAPLevel and domain vary by productKnown reflectance/radiance terms are used; otherwise the engine fails safely or requires manual selection.
Generic / UnknownUnknownNo calibration constants are invented. Metadata scale/offset can be used only when present.
Detection confidence is not a substitute for metadata. If a generic TIFF has lost its original calibration metadata, choose a method only when the required coefficients are known. “Auto” intentionally stops when a safe physical path cannot be established.

3. Radiometric Calibration — 6 Choices

MethodPurposeRequired informationTypical input → output
AutoFollow detected radiometric state and sensor metadata.Recognizable product metadata/state.DN → TOA reflectance/radiance, or preserve existing physical values.
Preserve / Already CalibratedKeep current numeric domain.User must know the input domain.Radiance → radiance, reflectance → reflectance.
Metadata Scale & OffsetDecode scaled integer/encoded physical values.Raster scale/offset or equivalent tags.Encoded DN → physical value.
DN → TOA RadianceConvert 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 ReflectanceConvert reflective DN to top-of-atmosphere reflectance.Sensor/product reflectance coefficients and solar geometry as required.DN → dimensionless TOA reflectance.
Radiance → TOA ReflectanceNormalize 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

xphysical = scale × xencoded + offsetUsed only when the raster/band metadata contains a non-trivial scale or offset.

3.2 DN to TOA radiance

Lλ = ML Qcal + ALML and AL are band-specific radiance rescaling coefficients. The implementation can also derive an equivalent linear relation from LMIN/LMAX and QCALMIN/QCALMAX metadata.

3.3 DN to TOA reflectance

ρ′λ = Mρ Qcal + Aρ
ρλ = ρ′λ / sin(θSE)

3.4 Radiance to TOA reflectance

ρλ = π Lλ d² / [ESUN,λ cos(θSZ)]The code uses sin(sun elevation), equivalent to cos(solar zenith), with Earth–Sun distance d and band-specific solar irradiance.
Example — Landsat Collection 2 Level-2 SR: encoded values are decoded using the product scaling convention. For Landsat C2 SR, the official relation is SR = DN × 0.0000275 − 0.2. This is decoding of an already atmospherically corrected Level-2 product, not a new atmospheric correction.

4. Atmospheric Correction — 6 Choices

MethodWhat it doesBest useImportant limitation
AutoPreserves 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 ReflectanceNo 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 TransferPhysics-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 MethodFits 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.
NoneLeaves 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

ρcorr,b(p) = ρb(p) − Pq{ρb}Pq is the selected low percentile (default 1%) of valid values in band b. The implementation records the subtracted dark value for every band.

4.2 6S implementation

For each selected band, the implementation resolves a center wavelength, runs 6S, retrieves coefficients xa, xb, xc, and applies:

y = xaL − xb
ρ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

ρknown = gain × xobserved + offset
gain = (ρbright − ρdark) / (xbright − xdark)
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 compatible

Available methods depend on which coefficients, wavelengths and acquisition geometry survive in the product metadata.

EMIT note: the generic 6S option is not claimed to reproduce NASA's official EMIT L2A retrieval. Official Level-2 reflectance should be preserved when available.

6. Application Parameters

FieldWhen shownMeaning
Input RasterAlwaysProject raster used as the metadata source and processing input.
Sensor / Product TypeAlwaysAuto or manual sensor profile.
Radiometric Calibration MethodAlwaysOne of the six methods above; L2/SR is safety-locked in backend.
Atmospheric Correction MethodAlwaysOne of the six methods above.
Dark Object PercentileAuto / DOSLow percentile used by DOS.
6S atmosphere, aerosol, AOT, altitude, geometry/date6SRadiative-transfer configuration and optional metadata overrides.
Dark / Bright Reference ROI + known reflectanceEmpirical LineTwo calibration targets and their reference reflectance.
Select Input BandsAlwaysOptional 1-based band subset; default is reflectance-compatible bands where semantic roles are known.
Output NodataAlwaysDefault −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"
}
Interpret output by its final radiometric state. Selecting None for atmospheric correction can intentionally leave TOA reflectance/radiance-like outputs; do not label those as 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

  1. U.S. Geological Survey. Using the USGS Landsat Level-1 Data Product — TOA radiance and reflectance equations. USGS.
  2. U.S. Geological Survey. Landsat Collection 2 Surface Reflectance — Level-2 SR and scaling. USGS.
  3. NASA MODIS Land Team. MODIS Surface Reflectance (MOD09/MYD09). NASA.
  4. NASA Earthdata. EMIT L2A Estimated Surface Reflectance and Uncertainty and Masks. NASA Earthdata.
  5. Vermote, E. F. et al. 6S/6SV radiative-transfer heritage for atmospheric correction; MODIS Land validation resources summarize use of 6SV. NASA MODIS Land.
  6. 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.
Implementation-first documentation: equations and parameter behavior above match the current iTSensing patch. External references establish the scientific context; sensor-specific official processors may contain additional corrections beyond this generic tool.