EarthScienceToolkit
calculate_ndvi
- input_nir_path (str): Path to Near-Infrared (NIR) band raster.
- input_red_path (str): Path to Red band raster file.
- output_path (str): Relative output path, e.g. “question17/ndvi_2022-01-16.tif”
calculate_batch_ndvi
- input_nir_paths (list[str]): Paths to NIR band rasters.
- input_red_paths (list[str]): Paths to Red band rasters.
- output_paths (list[str]): Relative output paths.
calculate_ndwi
- input_nir_path (str): Path to Near-Infrared (NIR) band raster.
- input_swir_path (str): Path to Short-Wave Infrared (SWIR) raster.
- output_path (str): Relative output path, e.g. “question17/ndwi_2022-01-16.tif”
calculate_batch_ndwi
- input_nir_paths (list[str]): Paths to NIR band rasters.
- input_swir_paths (list[str]): Paths to SWIR band rasters.
- output_paths (list[str]): Relative output paths.
calculate_ndbi
- input_swir_path (str): Path to Short-Wave Infrared (SWIR) raster.
- input_nir_path (str): Path to Near-Infrared (NIR) band raster.
- output_path (str): Relative output path, e.g. “question17/ndbi_2022-01-16.tif”
calculate_batch_ndbi
- input_swir_paths (list[str]): Paths to SWIR band rasters.
- input_nir_paths (list[str]): Paths to NIR band rasters.
- output_paths (list[str]): Relative output paths.
calculate_evi
- input_nir_path (str): Path to Near-Infrared (NIR) band raster.
- input_red_path (str): Path to Red band raster file.
- input_blue_path (str): Path to Blue band raster file.
- output_path (str): Relative output path, e.g. “question17/evi_2022-01-16.tif”
- G (float, optional): Gain factor. Defaults to 2.5. (default: 2)
- C1 (float, optional): Coefficient 1. Defaults to 6. (default: 6)
- C2 (float, optional): Coefficient 2. Defaults to 7.5. (default: 7)
- L (float, optional): Adjustment factor. Defaults to 1. (default: 1)
calculate_batch_evi
- input_nir_paths (list[str]): Paths to NIR band rasters.
- input_red_paths (list[str]): Paths to Red band rasters.
- input_blue_paths (list[str]): Paths to Blue band rasters.
- output_paths (list[str]): Relative output paths. G, C1, C2, L (float, optional): EVI coefficients.
calculate_evi call.
calculate_nbr
- input_nir_path (str): Path to Near-Infrared (NIR) band raster.
- input_swir_path (str): Path to Short-Wave Infrared (SWIR) raster.
- output_path (str): Relative output path, e.g. “question17/nbr_2022-01-16.tif”
calculate_batch_nbr
- input_nir_paths (list[str]): Paths to NIR band rasters.
- input_swir_paths (list[str]): Paths to SWIR band rasters.
- output_paths (list[str]): Relative output paths.
calculate_fvc
- input_nir_path (str): Path to Near-Infrared (NIR) band raster.
- input_red_path (str): Path to Red band raster file.
- output_path (str): Relative output path.
- ndvi_min (float): Min NDVI for non-vegetated areas (default: 0.1). (default: 0.1)
- ndvi_max (float): Max NDVI for fully vegetated areas (default: 0. 9).
calculate_batch_fvc
- input_nir_paths (list[str]): Paths to NIR band rasters.
- input_red_paths (list[str]): Paths to Red band rasters.
- output_paths (list[str]): Relative output paths.
- ndvi_min (float, optional): Min NDVI for non-vegetated areas.
- ndvi_max (float, optional): Max NDVI for fully vegetated areas.
calculate_wri
- input_green_path (str): Path to Green band raster file.
- input_red_path (str): Path to Red band raster file.
- input_nir_path (str): Path to Near-Infrared (NIR) band raster.
- input_swir_path (str): Path to Short-Wave Infrared (SWIR) raster.
- output_path (str): Relative output path.
calculate_batch_wri
- input_green_paths (list[str]): Paths to Green band rasters.
- input_red_paths (list[str]): Paths to Red band rasters.
- input_nir_paths (list[str]): Paths to NIR band rasters.
- input_swir_paths (list[str]): Paths to SWIR band rasters.
- output_paths (list[str]): Relative output paths.
calculate_ndti
- input_red_path (str): Path to Red band raster file.
- input_green_path (str): Path to Green band raster file.
- output_path (str): Relative output path.
calculate_batch_ndti
- input_red_paths (list[str]): Paths to Red band rasters.
- input_green_paths (list[str]): Paths to Green band rasters.
- output_paths (list[str]): Relative output paths (e.g., “question17/ndti_2022-01-16.tif”).
calculate_frp
- input_frp_path (str): Path to the FRP raster file.
- output_path (str): relative path for the output raster file, e.g. “question17/frp_2022-01-16.tif”
- fire_threshold (float): Minimum FRP value to be considered as fire (default: 0).
calculate_batch_frp
- input_frp_paths (list[str]): Paths to FRP raster files.
- output_paths (list[str]): Relative output paths (e.g., “question17/frp_2022-01-16.tif”).
- fire_threshold (float, optional): Minimum FRP value to be considered as fire. Defaults to 0.
calculate_ndsi
- input_green_path (str): Path to the Green band raster file.
- input_swir_path (str): Path to the SWIR band raster file.
- output_path (str): relative path for the output raster file, e.g. “question17/ndsi_2022-01-16.tif”
calculate_batch_ndsi
- green_file_list (list[str]): List of paths to Green band raster files.
- swir_file_list (list[str]): List of paths to SWIR band raster files.
- output_path_list (list[str]): relative path for the output raster file, e.g. [“question17/ndsi_2022-01-16.tif”, “question17/ ndsi_2022-01-16.tif”]
calc_extreme_snow_loss_percentage_from_binary_map
- binary_map_path (str): Path to the binary raster image where pixels with value 1.0 represent extreme snow/ice loss areas.
compute_tvdi
- ndvi_path (str): Path to the NDVI GeoTIFF file (e.g., MODIS NDVI scaled by 0.0001).
- lst_path (str): Path to the LST GeoTIFF file (e.g., MODIS LST scaled by 0.02).
- output_path (str): Relative path to save the computed TVDI raster (e.g., “question17/tvdi_2022-01-16.tif”).
band_ratio
- PWV
- T17 (transmittance at 0.905 µm)
- T18 (transmittance at 0.936 µm)
- T19 (transmittance at 0.940 µm)
- sur_refl_b02_path (str): Path to MODIS surface reflectance band sur_refl_b02 (0.865 µm) GeoTIFF.
- sur_refl_b05_path (str): Path to MODIS surface reflectance band sur_refl_b05 (1.240 µm) GeoTIFF.
- sur_refl_b17_path (str): Path to MODIS surface reflectance band sur_refl_b17 (0.905 µm) GeoTIFF.
- sur_refl_b18_path (str): Path to MODIS surface reflectance band sur_refl_b18 (0.936 µm) GeoTIFF.
- sur_refl_b19_path (str): Path to MODIS surface reflectance band sur_refl_b19 (0.940 µm) GeoTIFF.
- output_path (str): Relative output path for the PWV GeoTIFF, e.g. “question17/pwv_2022-01-16.tif”.
lst_single_channel
- bt_path (str): Path to the Brightness Temperature GeoTIFF (Kelvin).
- red_path (str): Path to the RED band GeoTIFF (e.g., Landsat 8 Band 4).
- nir_path (str): Path to the NIR band GeoTIFF (e.g., Landsat 8 Band 5).
- output_path (str): Relative path for the output LST GeoTIFF, e.g. “question17/lst_2022-01-16.tif”.
lst_multi_channel
- band31_path (str): Path to local GeoTIFF file for thermal band 31 (~11 μm).
- band32_path (str): Path to local GeoTIFF file for thermal band 32 (~12 μm).
- output_path (str): Relative path for the output LST GeoTIFF, e.g. “question17/lst_2022-01-16.tif”.
split_window
parameter.
Parameters:
- band31_path (str): Path to thermal band 31 GeoTIFF (~11 μm).
- band32_path (str): Path to thermal band 32 GeoTIFF (~12 μm).
- emissivity31_path (str): Path to emissivity band 31 GeoTIFF.
- emissivity32_path (str): Path to emissivity band 32 GeoTIFF.
- parameter (str): Specify either
"LST"for Land Surface Temperature or"PWV"for Precipitable Water Vapor. - output_path (str): Relative path for the output raster file, e.g.
"question17/lst_2022-01-16.tif".
temperature_emissivity_separation
- tir_band_paths (list[str]): List of paths to Thermal Infrared (TIR) GeoTIFFs (e.g., ASTER Bands 10-14).
- representative_band_index (int): Index of the TIR band used as the reference brightness temperature (e.g., 3 for Band 13).
- output_path (str): Relative path for saving the output raster file (e.g., “question17/lst_2022-01-16.tif”).
- Band 1: LST (K)
- Band 2: Emissivity (ε)
- Band 3: Emissivity variation (Δε)
modis_day_night_lst
- BT_day_path (str): Path to local MODIS Brightness Temperature Day GeoTIFF.
- BT_night_path (str): Path to local MODIS Brightness Temperature Night GeoTIFF.
- Emis_day_path (str): Path to MODIS Emissivity Day GeoTIFF (scaled by 0.002, offset by 0.49).
- Emis_night_path (str): Path to MODIS Emissivity Night GeoTIFF (scaled by 0.002, offset by 0.49).
- output_path (str): Relative path for saving the output raster file (e.g., “question17/lst_2022-01-16.tif”).
- Band 1: LST (Day)
- Band 2: LST (Night)
- Band 3: BT (Day)
- Band 4: BT (Night)
- Band 5: Emissivity (Day)
- Band 6: Emissivity (Night)
ttm_lst
- tir_band_paths (list[str]): Paths to three TIR band GeoTIFFs (e.g., ASTER B10, B11, B12).
- output_path (str): Relative path to save the output raster.
- wavelengths (list[float], optional): Central wavelengths (μm) for each band. Defaults to [8.3, 8.65, 9.1].
calculate_mean_lst_by_ndvi
- red_paths (str or list): Path(s) to red band image(s).
- nir_paths (str or list): Path(s) to near-infrared (NIR) image(s).
- lst_paths (str or list): Path(s) to land surface temperature (LST) image(s).
- ndvi_threshold (float): Threshold value for NDVI.
- mode (str): ‘above’ for NDVI >= threshold, ‘below’ for NDVI < threshold.
calculate_max_lst_by_ndvi
- red_path (str): Path to the red band image.
- nir_path (str): Path to the near-infrared (NIR) band image.
- lst_path (str): Path to the land surface temperature (LST) image.
- ndvi_threshold (float): Threshold value for NDVI.
- mode (str): ‘above’ to select NDVI >= threshold, ‘below’ for NDVI < threshold. Default is ‘above’.
calculate_ATI
- day_temp_path (str): Path to the daytime brightness temperature (BT) GeoTIFF.
- night_temp_path (str): Path to the nighttime brightness temperature (BT) GeoTIFF.
- albedo_path (str): Path to the surface albedo GeoTIFF.
- output_path (str): Relative path to save the ATI raster, e.g. “question17/thermal_inertia_2022-01-16.tif”.
dual_polarization_differential
- pol1_path (str): File path for the first polarization band GeoTIFF (e.g., VV).
- pol2_path (str): File path for the second polarization band GeoTIFF (e.g., VH).
- parameter (str): Parameter to invert, options: “soil_moisture” or “vegetation_index”.
- output_path (str): relative path for the output raster file, e.g. “question17/thermal_inertia_2022-01-16.tif”
- a (float, optional): Linear coefficient for soil moisture model. Default is 0.3.
- b (float, optional): Intercept for soil moisture model. Default is 0.1.
- input_unit (str, optional): Unit of input data, either “dB” or “linear”. Default is “dB”.
dual_frequency_diff
- Soil Moisture (SM): param = alpha*(band1 - band2) + beta
- Vegetation Index (VI): param = alpha*(band1 - band2) + beta
- Leaf Area Index (LAI): param = alpha*(band1 - band2) + beta
- band1_path (str): File path for frequency 1 polarization band GeoTIFF.
- band2_path (str): File path for frequency 2 polarization band GeoTIFF.
- parameter (str): Parameter to invert. Options: ‘SM’, ‘VI’, ‘LAI’. Default is ‘SM’.
- alpha (float, optional): Slope coefficient to override default.
- beta (float, optional): Intercept coefficient to override default.
- output_path (str): Relative path for the output raster file, e.g. “question17/thermal_inertia_2022-01-16.tif”
multi_freq_bt
- bt_paths (list[str]): List of local file paths for brightness temperature GeoTIFF bands (e.g., [“BT_10GHz.tif”, “BT_19GHz.tif”, “BT_37GHz.tif”]).
- diff_pairs (list[list[int]]): List of index pairs from bt_paths for difference calculation (e.g., [[0,1],[1,2]]).
- parameter (str): Parameter to invert. Options: ‘SM’, ‘VWC’, ‘LAI’.
- output_path (str): Relative path for the output raster file, e.g. “question17/thermal_inertia_2022-01-16.tif”
chang_single_param_inversion
- bt_paths (list[str]): List of local GeoTIFF file paths for brightness temperature bands (e.g., [“BT_10V.tif”, “BT_10H.tif”, “BT_19V.tif”, “BT_19H.tif”]).
- diff_pairs (list[list[int]]): List of index pairs for brightness temperature differences.
- parameter (str): Parameter to invert (e.g., “SM”, “VWC”).
- output_path (str): Relative path for the output raster file, e.g. “question17/thermal_inertia_2022-01-16.tif”
nasa_team_sea_ice_concentration
- bt_paths (dict): Dictionary of local GeoTIFF file paths for required brightness temperature bands, e.g.,
{"19V": "BT_19V.tif", "19H": "BT_19H.tif", "37V": "BT_37V.tif", "37H": "BT_37H.tif"} - nd_ice (float): ND value for ice reference. Default 50.0.
- nd_water (float): ND value for water reference. Default 0.0.
- s1_ice (float): S1 value for ice reference. Default 20.0.
- s1_water (float): S1 value for water reference. Default 0.0.
- output_path (str): Relative path for the output raster file, e.g. “question17/thermal_inertia_2022-01-16.tif”
dual_polarization_ratio
- VWC = a_vwc * PR + b_vwc
- SM = a_sm * PR + b_sm
- bt_paths (dict): Dictionary of local GeoTIFF file paths for vertical and horizontal polarization bands, e.g.
{"V": "BT_V.tif", "H": "BT_H.tif"} - parameter (str): Parameter to invert, either “VWC” or “SM”.
- output_path (str): Relative path for the output raster file, e.g. “question17/thermal_inertia_2022-01-16.tif”
- coeffs (dict, optional): Empirical coefficients
{"VWC": {"a":float, "b":float}, "SM": {...}}.
calculate_water_turbidity_ntu
- input_red_path (str): Path to the Red band raster file.
- output_path (str): Relative path for the output raster file, e.g. “benchmark/data/question17/turbidity_2022-01-16.tif”
- method (str): Calculation method - “linear” (aRed+b), “power” (aRed^n+b), or “log” (a*log(Red)+b).
- a (float): Coefficient parameter, default 1.0.
- b (float): Offset parameter, default 0.0.
- n (float): Power parameter for power method, default 1.0.
threshold_segmentation
- input_image_path (str): Path to the input raster image file (e.g., TIFF, PNG, JPG).
- threshold (float or int): Pixel intensity threshold used to generate the binary mask.
- output_path (str): Relative output path (under TEMP_DIR) where the result will be saved, e.g., “question17/threshold_segmentation_2022-01-16.tif”.
bbox_expansion
- bboxes (list[list[float]]): List of bounding boxes, each represented as [x1, y1, x2, y2].
- radius (float): Expansion radius in the same unit as the GSD.
- gsd (float): Ground Sampling Distance in the same unit as radius.
count_above_threshold
- file_path (str): Path to the input image (GeoTIFF or raster format).
- threshold (float): Threshold value for hotspot detection.
count_skeleton_contours
- image_path (str): Path to the input binary (black and white) image.
bboxes2centroids
- bboxes (list[list[float]]): A list of bounding boxes, each defined as [x_min, y_min, x_max, y_max].
centroid_distance_extremes
- centroids (list[tuple[float, float]] or np.ndarray): A list or NumPy array of centroid coordinates in (x, y) format.
- ‘min’: (index1, index2, distance) Indices of the closest centroid pair and their distance.
- ‘max’: (index1, index2, distance) Indices of the farthest centroid pair and their distance.
calculate_bbox_area
- bboxes (list[list[float]]): A list of bounding boxes, each defined as [x, y, w, h] where x,y is top-left corner and w,h are width and height.
- gsd (float, optional): Ground sample distance (meters per pixel). If provided, result is in m². If None, result is in pixel². Default = None.
compute_linear_trend
- y (list): The dependent variable (time series data).
- x (list): The independent variable (time indices). If not provided, uses np.arange(len(y)) as default.
- slope (float): The coefficient a representing the trend.
0: upward, < 0: downward, ~0: no trend.
- intercept (float): The y-intercept b of the fitted line.
mann_kendall_test
- x (list[float]): The input time series data as a list of floats or ints. Any missing values (NaN) should be removed beforehand.
- “increasing” if a significant upward trend is found
- “decreasing” if a significant downward trend is found
- “no trend” if no significant trend is detected p_value (float): Two-tailed p-value of the test. z (float): Standard normal test statistic. tau (float): Kendall’s Tau statistic (measure of rank correlation, range -1 to 1).
sens_slope
- x (list[float]): The input time series data as a list of floats or ints. Must have at least two data points.
stl_decompose
- x (list[float]): Input time series values.
- period (int): Number of observations in one seasonal cycle.
detect_change_points
- signal (list[float]): Input time series data.
- model (
str, default="l2"): Segmentation cost model to use. - “l1”: robust to outliers (absolute loss) - “l2”: mean shift model (squared loss, default) - “rbf”: kernel-based model for nonlinear changes - others supported by ruptures - penalty (float, default=10): Penalty value controlling sensitivity. Higher values detect fewer change points (more conservative).
autocorrelation_function
- x (list[float]): Input time series data.
- nlags (int, default=20): Number of lags to compute.
detect_seasonality_acf
- values (list[float]): Input time series data.
- min_acf (float, default=0.3): ACF threshold to consider significant.
getis_ord_gi_star
- image_path (str): Path to input single-band raster (GeoTIFF).
- weight_matrix (list[list[float]]): 2D spatial weight kernel (e.g., 3x3 or 5x5). Sum of weights must not be zero.
- output_path (str): Relative path to save the Gi* result GeoTIFF.
analyze_hotspot_direction
- hotspot_map_path (str): Path to binary hotspot map GeoTIFF. Hotspot pixels should be value=1; others are ignored.
count_spikes_from_values
- values (list of float): Input sequence of values (can include None or NaN).
- spike_threshold (float): Minimum positive change required to count as a spike.
- verbose (bool): If True, logger.infos details for each detected spike.
coefficient_of_variation
- x (list[float]): Input dataset values (numeric).
- ddof (int, default=1): Delta Degrees of Freedom for standard deviation calculation: - ddof=0 → population standard deviation - ddof=1 → sample standard deviation (default)
skewness
- x (list[float]): Input dataset values (numeric).
- bias (bool, default=True): If False, applies bias correction (Fisher-Pearson method) for unbiased estimator.
kurtosis
- x (list[float]): Input dataset values (numeric).
- bias (bool, default=True): If False, applies bias correction.
- fisher (bool, default=True): If True, returns “excess kurtosis” (normal=0). If False, returns regular kurtosis (normal=3).
calc_single_image_mean
- file_path (str): Path to input image.
calc_batch_image_mean
calc_single_image_std
- file_path (str): Path to input image.
calc_batch_image_std
- file_list (list[str]): List of input image file paths.
- uint8 (bool, optional): Whether to convert to uint8 first. Default = False.
calc_single_image_median
- file_path (str): Path to input image.
calc_batch_image_median
- file_list (list[str]): List of input image file paths.
- uint8 (bool, optional): Whether to convert to uint8 first. Default = False.
calc_single_image_min
- file_path (str): Path to input image.
calc_batch_image_min
- file_list (list[str]): List of input image file paths.
- uint8 (bool, optional): Whether to convert to uint8 first. Default = False.
calc_single_image_max
- file_path (str): Path to input image.
calc_batch_image_max
- file_list (list[str]): List of input image file paths.
- uint8 (bool, optional): Whether to convert to uint8 first. Default = False.
calc_single_image_skewness
- file_path (str): Path to input image.
calc_batch_image_skewness
- file_list (list[str]): List of input image file paths.
- uint8 (bool, optional): Whether to convert to uint8 first. Default = False.
calc_single_image_kurtosis
- file_path (str): Path to input image.
calc_batch_image_kurtosis
- file_list (list[str]): List of input image file paths.
- uint8 (bool, optional): Whether to convert to uint8 first. Default = False.
calc_single_image_sum
- file_path (str): Path to input image.
- uint8 (bool): Whether to use uint8 format.
calc_batch_image_sum
- sum (list[float]): List of pixel sum values, one for each image.
calc_single_image_hotspot_percentage
- file_path (str): Path to input image.
- threshold (float): Threshold value for hotspot detection.
- uint8 (bool): Whether to use uint8 format.
calc_batch_image_hotspot_percentage
- percentage (list[float]): List of hotspot area percentages (0.0-1.0), one for each input image.
calc_single_image_hotspot_tif
- file_path (str): Path to input image.
- threshold (float): Threshold value for detection.
- uint8 (bool): Whether to use uint8 format.
- output_path (str, optional): relative path for the output raster file, e.g. “question17/hotspot_2022-01-16.tif”
calc_batch_image_hotspot_tif
- list[str]: Paths to the saved GeoTIFF images containing the binary hotspot maps.
difference
- diff (float): The absolute difference |a - b|.
division
- result (float): The result of b ÷ a. Returns +inf if a = 0.
percentage_change
- percent (float): The percentage change, computed as ((b - a) / a) * 100. Positive values indicate increase, negative values indicate decrease.
kelvin_to_celsius
- celsius (float): Temperature in Celsius, computed as (Kelvin - 273.15).
celsius_to_kelvin
- celsius (float): Temperature in Celsius.
max_value_and_index
- result (tuple[float, int]): A tuple containing:
- max_value (float): The maximum value in the list.
- max_index (int): The index of the maximum value.
min_value_and_index
- result (tuple[float, int]): A tuple containing:
- min_value (float): The minimum value in the list.
- min_index (int): The index of the minimum value.
multiply
- a (float or int): First number.
- b (float or int): Second number.
ceil_number
- n (float): A numeric value.
get_list_object_via_indexes
- input_list (list): The source list from which elements will be extracted.
- indexes (list[int] or tuple[int]): A sequence of indices specifying the positions of elements to retrieve.
mean
- x (list[float]): Input data array.
calculate_threshold_ratio
- image_paths (str or list[str]): Path or list of image file paths.
- threshold (float, optional): Threshold value. Default = 0.75.
- band_index (int, optional): Band index to use (0-based). Default = 0 (first band).
calc_single_image_fire_pixels
- file_path (str): Path to input image.
- fire_threshold (float): Minimum FRP value to be considered as fire (default: 0).
calc_batch_fire_pixels
- file_list (list[str]): Paths to input images.
- fire_threshold (float, optional): Minimum FRP value to be considered as fire. Default = 0.
create_fire_increase_map
- change_image_path (str): Path to the fire change image.
- output_path (str): Relative path for the output raster file (e.g., “question17/hotspot_2022-01-16.tif”).
- threshold (float, optional): Threshold value in MW. Default = 20.0.
identify_fire_prone_areas
- file_path (str): Path to the input hotspot map file.
- output_path (str): Relative path for the output raster file (e.g., “question17/hotspot_2022-01-16.tif”).
- threshold_percentile (float, optional): Percentile threshold for identifying fire-prone areas. Default = 75.
- uint8 (bool, optional): Whether to use uint8 format when reading the input. Default = False.
- Path to the saved GeoTIFF file with fire-prone areas.
- Threshold value used for classification.
get_percentile_value_from_image
- image_path (str): Path to the input raster (.tif) file.
- percentile (int or float): Percentile to calculate (range 1-100).
image_division_mean
- image_path1 (str): Path to the first image (or the only image if comparing two bands).
- image_path2 (str, optional): Path to the second image. If None, band1 and band2 of image_path1 will be used.
- band1 (int, optional): Band index for numerator when using a multi-band image. Default = 1.
- band2 (int, optional): Band index for denominator when using a multi-band image. Default = 2.
calculate_intersection_percentage
- path1 (str): Path to the first raster image (e.g., NDVI).
- threshold1 (float): Threshold value for the first image (e.g., NDVI > 0.3).
- path2 (str): Path to the second raster image (e.g., TVDI).
- threshold2 (float): Threshold value for the second image (e.g., TVDI > 0.7).
calc_batch_image_mean_mean
- file_list (list[str]): List of image file paths.
- uint8 (bool, optional): Whether to convert images to uint8 format (0-255). Default = False.
calc_batch_image_mean_max
- file_list (list[str]): Paths to input images.
- uint8 (bool, optional): Whether to treat image as uint8 (0-255 normalization). Default = False.
calc_batch_image_mean_max_min
- Mean of mean values
- Maximum of maximum values
- Minimum of minimum values
- file_list (list[str]): List of image file paths.
- uint8 (bool, optional): Whether to convert the data to uint8 range (0-255). Default = False.
calc_batch_image_mean_threshold
- file_list (list[str]): List of image file paths.
- threshold (float): Threshold value for comparison.
- above (bool, optional): If True, count images with mean > threshold; if False, mean < threshold. Default = True.
- uint8 (bool, optional): If True, rescale image data to 0-255 range. Default = False.
- band_index (int, optional): Index of the band to read (0-based). Default = 0.
- return_type (str, optional): - “ratio”: return percentage (float, 0-100). - “count”: return number of images (int). Default = “ratio”.
calculate_multi_band_threshold_ratio
- image_path (str): Path to the multi-band image file.
- band_conditions (list[tuple[int, float, str]]): A list of conditions in the form (band_index, threshold_value, compare_type): - band_index (int): Zero-based band index. - threshold_value (float): Threshold to apply. - compare_type (str): “above” or “below”.
count_pixels_satisfying_conditions
- image_path (str): Path to the multi-band image file.
- band_conditions (list[tuple[int, float, str]]): A list of conditions in the form (band_index, threshold_value, compare_type): - band_index (int): Zero-based band index. - threshold_value (float): Threshold to apply. - compare_type (str): “above” or “below”.
count_images_exceeding_threshold_ratio
- image_paths (str or list): Path(s) to image file(s).
- value_threshold (float): Pixel value threshold (e.g., NDVI > 0.7).
- ratio_threshold (float): Percentage threshold for comparison (e.g., 20.0 means 20%).
- mode (str): - ‘above’: pixels > value_threshold - ‘below’: pixels < value_threshold Default is ‘above’.
- verbose (bool): If True, logger.infos detailed ratio results per image.
average_ratio_exceeding_threshold
- image_paths (str or list): Path(s) to image file(s).
- value_threshold (float): Pixel value threshold (e.g., NDVI > 0.7).
- ratio_threshold (float): Minimum percentage threshold for inclusion (e.g., 20.0 means 20%).
- mode (str): - ‘above’: pixels > value_threshold - ‘below’: pixels < value_threshold Default is ‘above’.
- verbose (bool): If True, logger.infos detailed ratio results per image.
count_images_exceeding_mean_multiplier
- image_paths (str or list): Path(s) to image file(s).
- mean_multiplier (float): Multiplier applied to the overall mean (e.g., 1.1 means 110%).
- mode (str): - ‘above’: count images with mean > mean_multiplier * overall_mean - ‘below’: count images with mean < mean_multiplier * overall_mean Default is ‘above’.
- verbose (bool): If True, logger.infos detailed mean and threshold comparisons per image.
calculate_band_mean_by_condition
- image_path (str): Path to the multi-band raster image.
- condition_band_index (int): Zero-based index of the band used for thresholding.
- condition_threshold (float): Threshold value to apply on the condition band.
- condition_mode (
str, default='above'): - ‘above’: select pixels where condition_band >= threshold - ‘below’: select pixels where condition_band < threshold - target_band_index (int, default=0): Zero-based index of the band for which the mean is calculated.
calc_threshold_value_mean
- path1 (Path or List[Path]): Path(s) to the first set of raster files (e.g., LST).
- path2 (Path or List[Path]): Path(s) to the second set of raster files (e.g., TVDI).
- threshold (float): Threshold for values in path1 (e.g., LST in Kelvin).
calculate_tif_average
- file_list (list[str]): List of tif file paths.
- output_path (str): relative path for the output raster file, e.g. “benchmark/data/question17/avg_result.tif”
- uint8 (bool): Convert to uint8 format, default False.
calculate_tif_difference
- image_a_path (str): Path to first image (will be subtracted from).
- image_b_path (str): Path to second image (will subtract from).
- output_path (str): relative path for the output raster file, e.g. “question17/difference_result.tif”
- uint8 (bool): Convert to uint8 format, default False.
subtract
- img1_path (str): Path to first image.
- img2_path (str): Path to second image.
- output_path (str): relative path for the output raster file, e.g. “question17/difference_result.tif”
calculate_area
- input_image_path (str): Path to the input image file (TIFF, PNG, JPG, etc.).
- gsd (float): Ground sample distance in meters per pixel, if None, the function will return the number of non-zero pixels.
grayscale_to_colormap
- image_path (str): Path to input grayscale image (e.g. .tif).
- save_name (str): Filename for save color image (.png, .jpg, or .tif).
- cmap_name (str): Name of a matplotlib colormap, e.g. ‘viridis’, ‘RdBu’, etc.
- preserve_geo (bool): If True, preserves georeferencing.
get_filelist
- dir_path (str): Path to the directory.
radiometric_correction_sr
- input_band_path (str): Path to the input reflectance band file.
- output_path (str): relative path for the output raster file, e.g. “question17/radiometric_correction_2022-01-16.tif”
apply_cloud_mask
- sr_band_path (str): Path to surface reflectance band (e.g., SR_B3 or SR_B5).
- qa_pixel_path (str): Path to QA_PIXEL band.
- output_path (str): relative path for the output raster file, e.g. “question17/cloud_mask_2022-01-16.tif”