Preprocessing Methods¶
Bases: ABC
Base class for research paper logic. Focuses on declaring data dependencies and applying scientific transformations.
name
property
¶
Returns the class name as a identifier for the transformation.
required_products_and_bands
abstractmethod
property
¶
Declare dependencies (e.g., {'VNP46A2': {'DNB_BRDF_Corrected_NTL'}})
__init__(**params)
¶
Stores configuration parameters for metadata tracking.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**params
|
Any
|
Configuration parameters specific to the implementation. |
{}
|
transform(ds, **kwargs)
¶
Apply the science transformation. If the step expects a raw NTL name and the pipeline provides 'ntl', it maps it temporarily. After the transformation, it standardizes the output back to 'ntl'.
Filters¶
BlackMarbleHighQualityFilter
¶
Bases: PaperImplementation
A specialized filter for VNP46A2 NTL data focusing on primary quality indicator.
Unlike broader screening implementations, this class relies strictly on the instrument's internal quality assessments. It isolates pixels that are labeled as 'High Quality' by the mandatory sensor checks.
name
property
¶
Returns the class name as a identifier for the transformation.
required_products_and_bands
property
¶
Required bands from VNP46A2 (radiance/quality).
__init__()
¶
Initializes the High Quality filter with default NASA VNP46A2 flag requirements.
transform(ds, **kwargs)
¶
Apply the science transformation. If the step expects a raw NTL name and the pipeline provides 'ntl', it maps it temporarily. After the transformation, it standardizes the output back to 'ntl'.
CloudSnowFilter
¶
Bases: PaperImplementation
Applies a spatial buffer for removing cloud and snow edge pixels.
Implements the cloud and snow masking process for daily NASA's Black Marble NTL data as described in:
Li, T., Zhu, Z., Wang, Z., Román, M. O., Kalb, V., & Zhao, Y. (2022). Continuous monitoring of nighttime light changes based on daily NASA's Black Marble product suite. Remote Sensing of Environment, 282, 113269. https://doi.org/10.1016/j.rse.2022.113269
This class filters out observations affected by clouds, cirrus, and snow/ice surfaces, and dilates the resulting mask to ensure edge pixels are removed.
name
property
¶
Returns the class name as a identifier for the transformation.
required_products_and_bands
property
¶
transform(ds, **kwargs)
¶
Apply the science transformation. If the step expects a raw NTL name and the pipeline provides 'ntl', it maps it temporarily. After the transformation, it standardizes the output back to 'ntl'.
FilterLowNTL
¶
Bases: PaperImplementation
Filters out low nighttime light radiance values.
Implements a low radiance background filter as described in:
Li, T., Zhu, Z., Wang, Z., Román, M. O., Kalb, V. L., & Zhao, Y. (2022). Continuous monitoring of nighttime light changes based on daily NASA's Black Marble product suite. Remote Sensing of Environment, 282, 113269. https://doi.org/10.1016/j.rse.2022.113269
name
property
¶
Returns the class name as a identifier for the transformation.
required_products_and_bands
property
¶
__init__(**params)
¶
Stores configuration parameters for metadata tracking.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**params
|
Any
|
Configuration parameters specific to the implementation. |
{}
|
transform(ds, **kwargs)
¶
Apply the science transformation. If the step expects a raw NTL name and the pipeline provides 'ntl', it maps it temporarily. After the transformation, it standardizes the output back to 'ntl'.
Jia2023HighQualityFilter
¶
Bases: PaperImplementation
Implements the four-step high-quality data retrieval process to filter daily Black Marble NTL radiance as described in:
Jia, M., Li, X., Gong, Y., Belabbes, S., & Dell'Oro, L. (2023). Estimating natural disaster loss using improved daily night-time light data. International Journal of Applied Earth Observation and Geoinformation, 120, 103359. https://doi.org/10.1016/j.jag.2023.103359
This class filters out observations affected by solar stray light, clouds, abnormal sensor values, and high lunar illumination.
name
property
¶
Returns the class name as a identifier for the transformation.
required_products_and_bands
property
¶
Required bands spanning VNP46A1 (geometry) and VNP46A2 (radiance/quality).
__init__(sza_threshold=108.0, moon_fraction_threshold=60)
¶
Initializes the Jia et al. (2023) filter with paper-defined thresholds.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
sza_threshold
|
float
|
Solar Zenith Angle threshold to ensure deep night. Paper uses 108°. |
108.0
|
moon_fraction_threshold
|
float
|
Max moon illumination fraction allowed. Paper uses 0.6 (60%). |
60
|
transform(ds, **kwargs)
¶
Apply the science transformation. If the step expects a raw NTL name and the pipeline provides 'ntl', it maps it temporarily. After the transformation, it standardizes the output back to 'ntl'.
ModifiedZScoreOutlierRemoval
¶
Bases: PaperImplementation
Implements a rolling modified z-score outlier removal as described in:
Zheng, Q., Jiang, W., Wang, W., Lei, X., & Li, Z. (2021). Daily consistent NOAA-20 VIIRS nighttime light data in China. International Journal of Remote Sensing, 42(22), 8538-8561. https://doi.org/10.1080/01431161.2021.1969057
This method utilizes a rolling window to calculate the median and the Median Absolute Deviation to identify temporal spikes (outliers).
By using a 30-day backward-looking window, the filter remains compatible with walk-forward processing while remaining robust to outliers that typically bias a standard mean-based z-score.
name
property
¶
Returns the class name as a identifier for the transformation.
required_products_and_bands
property
¶
Declare dependencies.
__init__(threshold=3.5, window=30, **params)
¶
Stores configuration parameters for metadata tracking.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
threshold
|
float
|
Modified z-score threshold above which pixels are identified as outliers. |
3.5
|
window
|
int
|
Number of backward-looking days to evaluate in the rolling window. |
30
|
**params
|
Any
|
Additional configuration parameters. |
{}
|
transform(ds, **kwargs)
¶
Apply the science transformation. If the step expects a raw NTL name and the pipeline provides 'ntl', it maps it temporarily. After the transformation, it standardizes the output back to 'ntl'.
Geometric Correction¶
AveragePooling2D
¶
Bases: PaperImplementation
Implements a 2D spatial moving average (mean pooling) to reduce noise and enhance the signal-to-noise ratio in daily Nighttime Light (NTL) radiance.
This spatial filtering technique is detailed in the Black Marble product documentation:
Román, M. O., Wang, Z., Sun, Q., Kalb, V., Miller, S. D., Molthan, A., ... & Enenkel, S. (2018). NASA's Black Marble nighttime lights product suite. Remote Sensing of Environment, 210, 113-143. https://doi.org/10.1016/j.rse.2018.03.017
This class applies a rolling mean across the spatial dimensions (x, y) of the dataset. This is often used to mitigate high-frequency noise, such as atmospheric artifacts or sub-pixel flickering, while preserving the underlying socioeconomic light signals.
CAUTION: While spatial pooling improves stability, it acts as a low-pass filter that reduces spatial resolution. Larger filter sizes will result in 'blurring' of fine-scale urban structures.
name
property
¶
Returns the class name as a identifier for the transformation.
required_products_and_bands
property
¶
Required data layers from NASA's Black Marble suite.
__init__(filter_size=(3, 3))
¶
Initializes the pooling operation.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filter_size
|
tuple
|
A tuple representing the window size (x, y) for the rolling mean. Default is (3, 3). |
(3, 3)
|
transform(ds, **kwargs)
¶
Apply the science transformation. If the step expects a raw NTL name and the pipeline provides 'ntl', it maps it temporarily. After the transformation, it standardizes the output back to 'ntl'.
Hu2024AAveraging
¶
Bases: PaperImplementation
Implements the A-Averaging filter to reduce high temporal variation and blooming effects in daily NTL data as described in:
Hu, Y., Zhou, X., Yamazaki, D., & Chen, J. (2024). A self-adjusting method to generate daily consistent nighttime light data for the detection of short-term rapid human activities. Remote Sensing of Environment, 304, 114077. https://doi.org/10.1016/j.rse.2024.114077
The A-Averaging method decomposes NTL radiance into 'fixed' (stable) and 'mismatch' (variable) components. By applying spatial averaging only to the mismatch component, it reduces blooming and temporal noise while preserving the sharp gradients of urban light structures.
CAUTION: The identification of 'Fixed Light' requires a sufficient temporal baseline (ideally one year) to calculate meaningful quantiles.
name
property
¶
Returns the class name as a identifier for the transformation.
required_products_and_bands
property
¶
Required data layers from NASA's Black Marble suite[cite: 933].
__init__(filter_size=(3, 3))
¶
Initializes the A-Averaging filter.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
filter_size
|
tuple
|
The spatial window for smoothing the mismatch component. Standard paper implementation uses (3, 3). |
(3, 3)
|
transform(ds, **kwargs)
¶
Apply the science transformation. If the step expects a raw NTL name and the pipeline provides 'ntl', it maps it temporarily. After the transformation, it standardizes the output back to 'ntl'.
Angular Correction¶
Hu2024AngularCorrection
¶
Bases: PaperImplementation
Implementation of the angular correction method for daily NTL data:
Hu, Y., Zhou, X., Yamazaki, D., & Chen, J. (2024). A self-adjusting method to generate daily consistent nighttime light data for the detection of short-term rapid human activities. Remote Sensing of Environment, 304, 114077. https://doi.org/10.1016/j.rse.2024.114077
name
property
¶
Returns the class name as a identifier for the transformation.
required_products_and_bands
property
¶
Declare dependencies.
__init__(**params)
¶
Stores configuration parameters for metadata tracking.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**params
|
Any
|
Configuration parameters specific to the implementation. |
{}
|
transform(ds, **kwargs)
¶
Apply the science transformation. If the step expects a raw NTL name and the pipeline provides 'ntl', it maps it temporarily. After the transformation, it standardizes the output back to 'ntl'.
QuadraticVZACorrection
¶
Bases: PaperImplementation
Implements a View Zenith Angle (VZA) correction for Nighttime Light radiance following the quadratic regression normalization approach detailed in:
Zheng, Q., Zeng, Y., Zhou, Y., Wang, Z., Mu, T., & Weng, Q. (2025). Nighttime lights reveal substantial spatial heterogeneity and inequality in post-hurricane recovery. Remote Sensing of Environment, 319, 114645. https://doi.org/10.1016/j.rse.2025.114645
This class normalizes pixel-wise radiance to a nadir observation (VZA = 0°) by calculating a multiplicative correction factor 'f' derived from the ratio between predicted nadir radiance and the predicted radiance at the observed angle.
name
property
¶
Returns the class name as a identifier for the transformation.
required_products_and_bands
property
¶
Required data layers from NASA's Black Marble suite.
transform(ds, **kwargs)
¶
Apply the science transformation. If the step expects a raw NTL name and the pipeline provides 'ntl', it maps it temporarily. After the transformation, it standardizes the output back to 'ntl'.
Imputation¶
LinearInterpolationGapFilling
¶
Bases: PaperImplementation
Simple linear interpolation imputation baseline.
This class uses linear interpolation along the time dimension to fill missing values in the data.
name
property
¶
Returns the class name as a identifier for the transformation.
required_products_and_bands
property
¶
__init__(**params)
¶
Stores configuration parameters for metadata tracking.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
**params
|
Any
|
Configuration parameters specific to the implementation. |
{}
|
transform(ds, **kwargs)
¶
Apply the science transformation. If the step expects a raw NTL name and the pipeline provides 'ntl', it maps it temporarily. After the transformation, it standardizes the output back to 'ntl'.
Other¶
Yue2026DisturbanceFactorCorrection
¶
Bases: PaperImplementation
Implements the Disturbance Factor Correction (DFC) model as described in:
Yue, H., et al. (2026). Improved Daily Nighttime Light Data as High-Frequency Economic Indicator. Applied Sciences, 16(2), 947. https://doi.org/10.3390/app16020947
It uses a Local Ordinary Least Squares (OLS) regression to decompose daily NTL radiance into three components: physical disturbances, socioeconomic signals (trends/seasonality), and random noise.
The model accounts for: - Lunar Illumination (LI) - Sensor Geometry: Viewing Zenith Angle (VZA) and Viewing Azimuth Angle (VAA) - Anisotropic Interaction: VZA x VAA - Cloud-contamination artifacts - Long-term Day Trend and Seasonal Dummies (Spring, Summer, Autumn, Winter)
LOGIC: The regression acts as a 'control' framework. While all factors are regressed simultaneously to prevent omitted variable bias, only the physical disturbances (Moon, Geometry, Clouds) are subtracted from the raw signal if they are statistically significant (p < 0.05). The socioeconomic signals (trend and seasonality) are preserved in the corrected output.