LandsatCollection

class RadGEEToolbox.LandsatCollection.LandsatCollection(start_date=None, end_date=None, tile_row=None, tile_path=None, cloud_percentage_threshold=None, boundary=None, collection=None, scale_bands=False)

Bases: object

Represents a user-defined collection of NASA/USGS Landsat 5, 8, and 9 TM & OLI surface reflectance satellite images at 30 m/px from Google Earth Engine (GEE).

This class enables simplified definition, filtering, masking, and processing of multispectral Landsat imagery. It supports multiple spatial and temporal filters, caching for efficient computation, and direct computation of key spectral indices like NDWI, NDVI, halite index, and more. It also includes utilities for cloud masking, mosaicking, zonal statistics, and transect analysis.

Initialization can be done by providing filtering parameters or directly passing in a pre-filtered GEE collection.

Inspect the documentation or source code for details on the methods and properties available.

Parameters:
  • start_date (str) – Start date in ‘YYYY-MM-DD’ format. Required unless collection is provided.

  • end_date (str) – End date in ‘YYYY-MM-DD’ format. Required unless collection is provided.

  • tile_row (int or list of int) – WRS-2 tile row(s) to filter by. Ignored if boundary or collection is provided. See https://www.usgs.gov/landsat-missions/landsat-shapefiles-and-kml-files

  • tile_path (int or list of int) – WRS-2 tile row(s) to filter by. Ignored if boundary or collection is provided. See https://www.usgs.gov/landsat-missions/landsat-shapefiles-and-kml-files

  • cloud_percentage_threshold (int, optional) – Max allowed cloud cover percentage. Defaults to 100.

  • boundary (ee.Geometry, optional) – A geometry for filtering to images that intersect with the boundary shape. Overrides tile_path and tile_row if provided.

  • collection (ee.ImageCollection, optional) – A pre-filtered Landsat ee.ImageCollection object to be converted to a LandsatCollection object. Overrides all other filters.

  • scale_bands (bool, optional) – If True, all SR bands will be scaled from DN values to reflectance values. Defaults to False.

collection

The filtered or user-supplied image collection converted to an ee.ImageCollection object.

Type:

ee.ImageCollection

Raises:

ValueError – Raised if required filter parameters are missing, or if both collection and other filters are provided.

Note

See full usage examples in the documentation or notebooks: https://github.com/radwinskis/RadGEEToolbox/tree/main/Example%20Notebooks

Examples

>>> from RadGEEToolbox import LandsatCollection
>>> import ee
>>> ee.Initialize()
>>> image_collection = LandsatCollection(
...     start_date='2023-06-01',
...     end_date='2023-06-30',
...     tile_row=32,
...     tile_path=38,
...     cloud_percentage_threshold=20
... )
>>> cloud_masked = image_collection.masked_clouds_collection
>>> latest_image = cloud_masked.image_grab(-1)
>>> ndwi_collection = image_collection.ndwi
property C_to_F

Function to convert an LST collection from Celcius to Fahrenheit, adding a new band ‘LST_F’ to each image in the collection.

Returns:

A LandsatCollection image collection with LST in Fahrenheit as band titled ‘LST_F’.

Return type:

LandsatCollection

static C_to_F_fn(LST_image)

Converts Land Surface Temperature from Celsius to Fahrenheit.

This function takes an ee.Image with a band for Land Surface Temperature (LST) in degrees Celsius and converts it to degrees Fahrenheit using the formula: F = C * 9/5 + 32.

Parameters:

LST_image – An ee.Image where each band represents LST in degrees Celsius.

Returns:

An ee.Image where each band represents LST in degrees Fahrenheit. The output image retains the same band names as the input image alongside an additional band named ‘LST_F’.

Return type:

ee.Image

property LST

Property attribute to calculate and access the LST (Land Surface Temperature - in Celcius) imagery of the LandsatCollection. This property initiates the calculation of LST and caches the result. The calculation is performed only once when the property is first accessed, and the cached result is returned on subsequent accesses.

Returns:

A LandsatCollection image collection object containing LST imagery (temperature in Celcius).

Return type:

LandsatCollection

property add_month_property

Adds a numeric ‘month’ property to each image in the collection.

Returns:

A LandsatCollection image collection with the ‘month’ property added to each image.

Return type:

LandsatCollection

static add_month_property_fn(image)

Adds a numeric ‘month’ property to the image based on its date.

Parameters:

image (ee.Image) – Input image.

Returns:

Image with the ‘month’ property added.

Return type:

ee.Image

property albedo

Property attribute to calculate albedo imagery, based on Liang, 2001 (https://doi.org/10.1016/S0034-4257(00)00205-4) and Wang et al., 2016 (https://doi.org/10.1016/j.rse.2016.02.059). This property initiates the calculation of albedo and caches the result. The calculation is performed only once when the property is first accessed, and the cached result is returned on subsequent accesses.

Returns:

A LandsatCollection image collection

Return type:

LandsatCollection

albedo_collection()

Calculates albedo and returns collection as class object, allows specifying threshold(s) for masking. Thresholds can be specified for Landsat 5 vs 8&9 images, where the threshold argument applies to Landsat 5 and the ng_threshold argument applies to Landsat 8&9. This function can be called as a method but is called by default when using the ndwi property attribute. Albedo calculation based on Liang, 2001 (https://doi.org/10.1016/S0034-4257(00)00205-4) and Wang et al., 2016 (https://doi.org/10.1016/j.rse.2016.02.059).

Returns:

A LandsatCollection image collection

Return type:

LandsatCollection

anomaly(geometry, band_name=None, anomaly_band_name=None, replace=True, scale=30)

Calculates the anomaly of each image in a collection compared to the mean of each image.

This function computes the anomaly for each band in the input image by subtracting the mean value of that band from a provided ImageCollection. The anomaly is a measure of how much the pixel values deviate from the average conditions represented by the collection.

Parameters:
  • geometry (ee.Geometry) – The geometry for image reduction to define the mean value to be used for anomaly calculation.

  • band_name (str, optional) – A string representing the band name to be used for the output anomaly image. If not provided, the band name of the first band of the input image will be used.

  • anomaly_band_name (str, optional) – A string representing the band name to be used for the output anomaly image. If not provided, the band name of the first band of the input image will be used.

  • replace (bool, optional) – A boolean indicating whether to replace the original band with the anomaly band. If True, the output image will only contain the anomaly band. If False, the output image will retain all original bands and add the anomaly band. Default is True.

  • scale (int, optional) – The scale (in meters) to be used for image reduction. Default is 30 meters.

Returns:

A LandsatCollection where each image represents the anomaly (deviation from

the mean) for the chosen band. The output images retain the same band name.

Return type:

LandsatCollection

static anomaly_fn(image, geometry, band_name=None, anomaly_band_name=None, replace=True, scale=30)

Calculates the anomaly of a singleband image compared to the mean of the singleband image.

This function computes the anomaly for each band in the input image by subtracting the mean value of that band from a provided image. The anomaly is a measure of how much the pixel values deviate from the average conditions represented by the mean of the image.

Parameters:
  • image (ee.Image) – An ee.Image for which the anomaly is to be calculated. It is assumed that this image is a singleband image.

  • geometry (ee.Geometry) – The geometry for image reduction to define the mean value to be used for anomaly calculation.

  • band_name (str, optional) – A string representing the band name to be used for the output anomaly image. If not provided, the band name of the first band of the input image will be used.

  • anomaly_band_name (str, optional) – A string representing the band name to be used for the output anomaly image. If not provided, the band name of the first band of the input image will be used.

  • replace (bool, optional) – A boolean indicating whether to replace the original band with the anomaly band in the output image. If True, the output image will contain only the anomaly band. If False, the output image will contain both the original band and the anomaly band. Default is True.

  • scale (int, optional) – The scale in meters to use for the reduction operation. Default is 30 meters.

Returns:

An ee.Image where each band represents the anomaly (deviation from

the mean) for that band. The output image retains the same band name.

Return type:

ee.Image

band_rename(current_band_name, new_band_name)

Renames a band in all images of the LandsatCollection in-place.

Replaces the band named current_band_name with new_band_name without retaining the original band name. If the band does not exist in an image, that image is returned unchanged.

Parameters:
  • current_band_name (str) – The existing band name to rename.

  • new_band_name (str) – The desired new band name.

Returns:

The LandsatCollection with the band renamed in all images.

Return type:

LandsatCollection

static band_rename_fn(image, current_band_name, new_band_name)

Renames a band in an ee.Image (single- or multi-band) in-place.

Replaces the band named current_band_name with new_band_name without retaining the original band name. If the band does not exist, returns the image unchanged.

Parameters:
  • image (ee.Image) – The input image (can be multiband).

  • current_band_name (str) – The existing band name to rename.

  • new_band_name (str) – The desired new band name.

Returns:

The image with the band renamed (or unchanged if not found).

Return type:

ee.Image

binary_mask(threshold=None, band_name=None, classify_above_threshold=True, mask_zeros=False)

Function to create a binary mask (value of 1 for pixels above set threshold and value of 0 for all other pixels) of the LandsatCollection image collection based on a specified band. If a singleband image is provided, the band name is automatically determined. If multiple bands are available, the user must specify the band name to use for masking.

Parameters:
  • threshold (float, optional) – The threshold value for creating the binary mask. Defaults to None.

  • band_name (str, optional) – The name of the band to use for masking. Defaults to None.

  • classifiy_above_threshold (bool, optional) – If True, pixels above the threshold are classified as 1. If False, pixels below the threshold are classified as 1. Defaults to True.

  • mask_zeros (bool, optional) – If True, pixels with a value of 0 after the binary mask are masked out in the output binary mask. Useful for classifications. Defaults to False.

Returns:

LandsatCollection singleband image collection with binary masks applied.

Return type:

LandsatCollection

property chlorophyll

Property attribute to calculate and access the chlorophyll (NDTI) imagery of the LandsatCollection. This property initiates the calculation of chlorophyll using a default threshold of -1 (or a previously set threshold of self.chlorophyll_threshold) and caches the result. The calculation is performed only once when the property is first accessed, and the cached result is returned on subsequent accesses.

Returns:

A LandsatCollection image collection

Return type:

LandsatCollection

chlorophyll_collection(threshold, ng_threshold=None)

Calculates the KIVU chlorophyll index and return collection as class object, allows specifying threshold(s) for masking. Thresholds can be specified for Landsat 5 vs 8&9 images, where the threshold argument applies to Landsat 5 and the ng_threshold argument applies to Landsat 8&9. This function can be called as a method but is called by default when using the ndwi property attribute.

Parameters:
  • threshold (float) – specify threshold for the turbidity function (values less than threshold are masked)

  • ng_threshold (float, optional) – specify threshold for Landsat 8&9 turbidity function (values less than threshold are masked)

Returns:

A LandsatCollection image collection

Return type:

LandsatCollection

collectionStitch(img_col2)

Function to mosaic two LandsatCollection objects which share image dates. Mosaics are only formed for dates where both image collections have images. Image properties are copied from the primary collection. Server-side friendly.

Parameters:

img_col2 – secondary LandsatCollection image collection to be mosaiced with the primary image collection

Returns:

LandsatCollection image collection

Return type:

LandsatCollection

combine(other)

Combines the current LandsatCollection with another LandsatCollection, using the combine method.

Parameters:

other (LandsatCollection) – Another LandsatCollection to combine with current collection.

Returns:

A new LandsatCollection containing images from both collections.

Return type:

LandsatCollection

custom_image_grab(img_col, img_selector)

Function to select (“grab”) image of a specific index from an ee.ImageCollection object.

Parameters:
  • img_col – ee.ImageCollection with same dates as another LandsatCollection image collection object.

  • img_selector – index of image in list of dates for which user seeks to “select”.

Returns:

ee.Image of selected image

Return type:

ee.Image

static dNDWIPixelAreaSum(image, geometry, band_name='ndwi', scale=30, maxPixels=1000000000000.0)

Dynamically calulates the summation of area for water pixels of interest and store the value as image property named ‘ndwi’ Uses Otsu thresholding to dynamically choose the best threshold rather than needing to specify threshold. Note: An offset of 0.15 is added to the Otsu threshold.

Parameters:
  • image (ee.Image) – input ee.Image

  • geometry (ee.Geometry) – ee.Geometry object denoting area to clip to for area calculation

  • band_name (string) – name of ndwi band (string) for calculating area (defaults to ‘ndwi’)

  • scale (int) – integer scale of image resolution (meters) (defaults to 30)

  • maxPixels (int) – integer denoting maximum number of pixels for calculations

Returns:

ee.Image with area calculation stored as property matching name of band

Return type:

ee.Image

property dates

Property attribute to retrieve list of dates as readable and indexable client-side list object.

Returns:

list of date strings.

Return type:

list

property dates_list

Property attribute to retrieve list of dates as server-side (GEE) object.

Returns:

Server-side ee.List of dates.

Return type:

ee.List

static ee_to_df(ee_object, columns=None, remove_geom=True, sort_columns=False, **kwargs)

Converts an ee.FeatureCollection to pandas dataframe. Adapted from the geemap package (https://geemap.org/common/#geemap.common.ee_to_df)

Parameters:
  • ee_object (ee.FeatureCollection) – ee.FeatureCollection.

  • columns (list) – List of column names. Defaults to None.

  • remove_geom (bool) – Whether to remove the geometry column. Defaults to True.

  • sort_columns (bool) – Whether to sort the column names. Defaults to False.

  • kwargs – Additional arguments passed to ee.data.computeFeature.

Raises:

TypeError – ee_object must be an ee.FeatureCollection

Returns:

pandas DataFrame

Return type:

pd.DataFrame

property evi

Property attribute to calculate and access the EVI (Enhanced Vegetation Index) imagery of the LandsatCollection. This property initiates the calculation of EVI and caches the result. The calculation is performed only once when the property is first accessed, and the cached result is returned on subsequent accesses.

Returns:

A LandsatCollection image collection

Return type:

LandsatCollection

evi_collection(threshold, ng_threshold=None)

Function to calculate the EVI (Enhanced Vegetation Index) and return collection as class object, allows specifying threshold(s) for masking. Thresholds can be specified for Landsat 5 vs 8&9 images, where the threshold argument applies to Landsat 5 and the ng_threshold argument applies to Landsat 8&9. This function can be called as a method but is called by default when using the evi property attribute.

Parameters:

threshold (float) – specify threshold for EVI function (values less than threshold are masked)

Returns:

A LandsatCollection image collection

Return type:

LandsatCollection

exportProperties(property_names, file_path=None)

Fetches and returns specified properties from each image in the collection as a list, and returns a pandas DataFrame and optionally saves the results to a csv file.

Parameters:
  • property_names (list or str) – A property name or list of property names to retrieve. The ‘Date_Filter’ property is always included to provide temporal context.

  • file_path (str, optional) – If provided, the function will save the resulting DataFrame to a CSV file at this path. Defaults to None.

Returns:

A pandas DataFrame containing the requested properties for each image, sorted chronologically by ‘Date_Filter’.

Return type:

pd.DataFrame

export_to_asset_collection(asset_collection_path, region, scale, dates=None, filename_prefix='', crs=None, max_pixels=10000000000000, description_prefix='export', overwrite=False)

Exports an image collection to a Google Earth Engine asset collection. The asset collection will be created if it does not already exist, and each image exported will be named according to the provided filename prefix and date.

Parameters:
  • asset_collection_path (str) – The path to the asset collection.

  • region (ee.Geometry) – The region to export.

  • scale (int) – The scale of the export.

  • dates (list, optional) – The dates to export. Defaults to None.

  • filename_prefix (str, optional) – The filename prefix. Defaults to “”, i.e. blank.

  • crs (str, optional) – The coordinate reference system. Defaults to None, which will use the image’s CRS.

  • max_pixels (int, optional) – The maximum number of pixels. Defaults to int(1e13).

  • description_prefix (str, optional) – The description prefix. Defaults to “export”.

  • overwrite (bool, optional) – Whether to overwrite existing assets. Defaults to False.

Returns:

(queues export tasks)

Return type:

None

static extract_transect(image, line, reducer='mean', n_segments=100, dist_interval=None, scale=None, crs=None, crsTransform=None, tileScale=1.0, to_pandas=False, **kwargs)

Extracts transect from an image. Adapted from the geemap package (https://geemap.org/common/#geemap.common.extract_transect).

Parameters:
  • image (ee.Image) – The image to extract transect from.

  • line (ee.Geometry.LineString) – The LineString used to extract transect from an image.

  • reducer (str, optional) – The ee.Reducer to use, e.g., ‘mean’, ‘median’, ‘min’, ‘max’, ‘stdDev’. Defaults to “mean”.

  • n_segments (int, optional) – The number of segments that the LineString will be split into. Defaults to 100.

  • dist_interval (float, optional) – The distance interval used for splitting the LineString. If specified, the n_segments parameter will be ignored. Defaults to None.

  • scale (float, optional) – A nominal scale in meters of the projection to work in. Defaults to None.

  • crs (ee.Projection, optional) – The projection to work in. If unspecified, the projection of the image’s first band is used. If specified in addition to scale, rescaled to the specified scale. Defaults to None.

  • crsTransform (list, optional) – The list of CRS transform values. This is a row-major ordering of the 3x2 transform matrix. This option is mutually exclusive with ‘scale’, and will replace any transform already set on the projection. Defaults to None.

  • tileScale (float, optional) – A scaling factor used to reduce aggregation tile size; using a larger tileScale (e.g. 2 or 4) may enable computations that run out of memory with the default. Defaults to 1.

  • to_pandas (bool, optional) – Whether to convert the result to a pandas dataframe. Default to False.

Raises:
  • TypeError – If the geometry type is not LineString.

  • Exception – If the program fails to compute.

Returns:

The FeatureCollection containing the transect with distance and reducer values.

Return type:

ee.FeatureCollection

static extract_zonal_stats_from_buffer(image, coordinates, buffer_size=1, reducer_type='mean', scale=30, tileScale=1, coordinate_names=None)

Function to extract spatial statistics from an image for a list or single set of (long, lat) coordinates, providing individual statistics for each location. A radial buffer is applied around each coordinate to extract the statistics, which defaults to 1 meter. The function returns a pandas DataFrame with the statistics for each coordinate.

NOTE: Be sure the coordinates are provided as longitude, latitude (x, y) tuples!

Parameters:
  • image (ee.Image) – The image from which to extract statistics. Should be single-band.

  • coordinates (list or tuple) – A single (lon, lat) tuple or a list of (lon, lat) tuples.

  • buffer_size (int, optional) – The radial buffer size in meters. Defaults to 1.

  • reducer_type (str, optional) – The ee.Reducer to use (‘mean’, ‘median’, ‘min’, etc.). Defaults to ‘mean’.

  • scale (int, optional) – The scale in meters for the reduction. Defaults to 30.

  • tileScale (int, optional) – The tile scale factor. Defaults to 1.

  • coordinate_names (list, optional) – A list of names for the coordinates.

Returns:

A pandas DataFrame with the image’s ‘Date_Filter’ as the index and a

column for each coordinate location.

Return type:

pd.DataFrame

get_boundary_filtered_collection()

Filters and masks image collection based on LandsatCollection class arguments. Automatically calculated when using collection method, depending on provided class arguments (when boundary info is provided).

Returns:

Filtered image collection - used for subsequent analyses or to acquire ee.ImageCollection from LandsatCollection object

Return type:

ee.ImageCollection

get_filtered_collection()

Filters image collection based on LandsatCollection class arguments. Automatically calculated when using collection method, depending on provided class arguments (when tile info is provided).

Returns:

Filtered image collection - used for subsequent analyses or to acquire ee.ImageCollection from LandsatCollection object

Return type:

ee.ImageCollection

property gypsum

Property attribute to calculate and access the gypsum/sulfate index (see Radwin & Bowen, 2021) imagery of the LandsatCollection. This property initiates the calculation of gypsum using a default threshold of -1 (or a previously set threshold of self.gypsum_threshold) and caches the result. The calculation is performed only once when the property is first accessed, and the cached result is returned on subsequent accesses.

Returns:

A LandsatCollection image collection

Return type:

LandsatCollection

static gypsum_and_halite_mask(image, halite_threshold, gypsum_threshold, halite_ng_threshold=None, gypsum_ng_threshold=None)

Masks both gypsum and halite pixels. Must specify threshold for isolating halite and gypsum pixels.

Can specify separate thresholds for Landsat 5 vs 8&9 images where the threshold argument applies to Landsat 5 and the ng_threshold argument applies to Landsat 8&9.

Parameters:
  • image (ee.Image) – input ee.Image

  • halite_threshold (float) – integer threshold for halite where pixels less than threshold are masked, applies to landsat 5 when ng_threshold is also set.

  • gypsum_threshold (float) – integer threshold for gypsum where pixels less than threshold are masked, applies to landsat 5 when ng_threshold is also set.

  • halite_ng_threshold (float, optional) – integer threshold for halite to be applied to landsat 8 or 9 where pixels less than threshold are masked

  • gypsum_ng_threshold (float, optional) – integer threshold for gypsum to be applied to landsat 8 or 9 where pixels less than threshold are masked

Returns:

masked ee.Image

Return type:

image (ee.Image)

gypsum_collection(threshold, ng_threshold=None)

Function to calculate the gypsum index (see Radwin & Bowen, 2021) and return collection as class object, allows specifying threshold(s) for masking. Thresholds can be specified for Landsat 5 vs 8&9 images, where the threshold argument applies to Landsat 5 and the ng_threshold argument applies to Landsat 8&9. This function can be called as a method but is called by default when using the ndwi property attribute.

Parameters:
  • threshold (float) – specify threshold for gypsum function (values less than threshold are masked)

  • ng_threshold (float, optional) – specify threshold for Landsat 8&9 gypsum function (values less than threshold are masked)

Returns:

A LandsatCollection image collection

Return type:

LandsatCollection

property halite

Property attribute to calculate and access the halite index (see Radwin & Bowen, 2021) imagery of the LandsatCollection. This property initiates the calculation of halite using a default threshold of -1 (or a previously set threshold of self.halite_threshold) and caches the result. The calculation is performed only once when the property is first accessed, and the cached result is returned on subsequent accesses.

Returns:

A LandsatCollection image collection

Return type:

LandsatCollection

halite_collection(threshold, ng_threshold=None)

Function to calculate the halite index (see Radwin & Bowen, 2021) and return collection as class object, allows specifying threshold(s) for masking. Thresholds can be specified for Landsat 5 vs 8&9 images, where the threshold argument applies to Landsat 5 and the ng_threshold argument applies to Landsat 8&9. This function can be called as a method but is called by default when using the ndwi property attribute.

Parameters:
  • threshold (float) – specify threshold for halite function (values less than threshold are masked)

  • ng_threshold (float, optional) – specify threshold for Landsat 8&9 halite function (values less than threshold are masked)

Returns:

A LandsatCollection image collection

Return type:

LandsatCollection

static halite_mask(image, threshold, ng_threshold=None)

Masks halite pixels after specifying index to isolate/mask-to halite pixels.

Can specify separate thresholds for Landsat 5 vs 8&9 images where the threshold argument applies to Landsat 5 and the ng_threshold argument applies to Landsat 8&9.

Parameters:
  • image (ee.Image) – input ee.Image

  • threshold (float) – value between -1 and 1 where pixels less than threshold will be masked, applies to landsat 5 when ng_threshold is also set.

  • ng_threshold (float, optional) – integer threshold to be applied to landsat 8 or 9 where pixels less than threshold are masked

Returns:

masked ee.Image

Return type:

image (ee.Image)

static image_dater(image)

Adds date to image properties as ‘Date_Filter’.

Parameters:

image (ee.Image) – Input image

Returns:

Image with date in properties.

Return type:

ee.Image

image_grab(img_selector)

Selects (“grabs”) an image by index from the collection. Easy way to get latest image or browse imagery one-by-one.

Parameters:

img_selector – index of image in the collection for which user seeks to select/”grab”.

Returns:

ee.Image of selected image

Return type:

ee.Image

image_pick(img_date)

Selects (“grabs”) image of a specific date in format of ‘YYYY-MM-DD’ - will not work correctly if collection is composed of multiple images of the same date.

Parameters:

img_date – date (str) of image to select in format of ‘YYYY-MM-DD’

Returns:

ee.Image of selected image

Return type:

ee.Image

iterate_zonal_stats(geometries, band=None, reducer_type='mean', scale=30, geometry_names=None, buffer_size=1, tileScale=1, dates=None, file_path=None, unweighted=False)

Iterates over a collection of images and extracts spatial statistics (defaults to mean) for a given list of geometries or coordinates. Individual statistics are calculated for each geometry or coordinate provided. When coordinates are provided, a radial buffer is applied around each coordinate to extract the statistics, where the size of the buffer is determined by the buffer_size argument (defaults to 1 meter). The function returns a pandas DataFrame with the statistics for each coordinate and date, or optionally exports the data to a table in .csv format.

NOTE: The expected input is a singleband image. If a multiband image is provided, the first band will be used for zonal statistic extraction, unless band is specified.

Parameters:
  • geometries (ee.Geometry, ee.Feature, ee.FeatureCollection, list, or tuple) – Input geometries for which to extract statistics. Can be a single ee.Geometry, an ee.Feature, an ee.FeatureCollection, a list of (lon, lat) tuples, or a list of ee.Geometry objects. Be careful to NOT provide coordinates as (lat, lon)!

  • band (str, optional) – The name of the band to use for statistics. If None, the first band is used. Defaults to None.

  • reducer_type (str, optional) – The ee.Reducer to use, e.g., ‘mean’, ‘median’, ‘max’, ‘sum’. Defaults to ‘mean’. Any ee.Reducer method can be used.

  • scale (int, optional) – Pixel scale in meters for the reduction. Defaults to 30.

  • geometry_names (list, optional) – A list of string names for the geometries. If provided, must match the number of geometries. Defaults to None.

  • buffer_size (int, optional) – Radial buffer in meters around coordinates. Defaults to 1.

  • tileScale (int, optional) – A scaling factor to reduce aggregation tile size. Defaults to 1.

  • dates (list, optional) – A list of date strings (‘YYYY-MM-DD’) for filtering the collection, such that only images from these dates are included for zonal statistic retrieval. Defaults to None, which uses all dates in the collection.

  • file_path (str, optional) – File path to save the output CSV.

  • unweighted (bool, optional) – Whether to use unweighted reducer. Defaults to False.

Returns:

A pandas DataFrame with dates as the index and coordinate names

as columns. Returns None if using ‘iterative’ mode with file_path.

Return type:

pd.DataFrame or None

Raises:
  • ValueError – If input parameters are invalid.

  • TypeError – If geometries input type is unsupported.

static landsat5bandrename(img)

Renames Landsat 5 bands to match Landsat 8 & 9.

Parameters:

image (ee.Image) – input image

Returns:

image with renamed bands

Return type:

ee.Image

static landsat_LST(image)

Calculates land surface temperature (LST) from landsat TIR bands. Based on Sekertekin, A., & Bonafoni, S. (2020) https://doi.org/10.3390/rs12020294

Parameters:

image (ee.Image) – input ee.Image

Returns:

LST ee.Image

Return type:

ee.Image

static landsat_broadband_albedo_fn(image)

Calculates broadband albedo for Landsat TM and OLI images, based on Liang, 2001 (https://doi.org/10.1016/S0034-4257(00)00205-4) and Wang et al., 2016 (https://doi.org/10.1016/j.rse.2016.02.059).

Parameters:

image (ee.Image) – input ee.Image

Returns:

broadband albedo ee.Image

Return type:

ee.Image

static landsat_evi_fn(image, threshold, ng_threshold=None, gain_factor=2.5, l=1, c1=6, c2=7.5)

Calculates the Enhanced Vegetation Index (EVI) for Landsat images. Masks image based on threshold. Can specify separate thresholds for Landsat 5 vs 8&9 images, where the threshold argument applies to Landsat 5 and the ng_threshold argument applies to Landsat 8&9. See https://www.usgs.gov/landsat-missions/landsat-enhanced-vegetation-index

Parameters:
  • image (ee.Image) – input ee.Image

  • threshold (float) – value between -1 and 1 where EVI pixels less than threshold will be masked, applies to landsat 5 when ng_threshold is also set.

  • ng_threshold (float, optional) – integer threshold to be applied to landsat 8 or 9 where EVI pixels less than threshold are masked.

  • gain_factor (float, optional) – Gain factor, typically set to 2.5. Defaults to 2.5.

  • l (float, optional) – Canopy background adjustment factor, typically set to 1. Defaults to 1.

  • c1 (float, optional) – Coefficient for the aerosol resistance term, typically set to 6. Defaults to 6.

  • c2 (float, optional) – Coefficient for the aerosol resistance term, typically set to 7.5. Defaults to 7.5.

Returns:

EVI ee.Image

Return type:

ee.Image

static landsat_gypsum_fn(image, threshold, ng_threshold=None)

Calculates multispectral gypsum index from SWIR1 and SWIR2 bands(Radwin & Bowen, 2024 - https://onlinelibrary.wiley.com/doi/10.1002/esp.5089) for Landsat imagery and mask image based on threshold.

Can specify separate thresholds for Landsat 5 vs 8&9 images, where the threshold argument applies to Landsat 5 and the ng_threshold argument applies to Landsat 8&9.

Parameters:
  • image (ee.Image) – input ee.Image

  • threshold (float) – value between -1 and 1 where pixels less than threshold will be masked, applies to landsat 5 when ng_threshold is also set.

  • ng_threshold (float, optional) – integer threshold to be applied to landsat 8 or 9 where pixels less than threshold are masked

Returns:

gypsum ee.Image

Return type:

ee.Image

static landsat_halite_fn(image, threshold, ng_threshold=None)

Calculates multispectral halite index from RED and SWIR1 bands (Radwin & Bowen, 2021 - https://onlinelibrary.wiley.com/doi/10.1002/esp.5089) for Landsat imagery and mask image based on threshold.

Can specify separate thresholds for Landsat 5 vs 8 & 9 images, where the threshold argument applies to Landsat 5 and the ng_threshold argument applies to Landsat 8 & 9.

Parameters:
  • image (ee.Image) – input ee.Image

  • threshold (float) – value between -1 and 1 where pixels less than threshold will be masked, applies to landsat 5 when ng_threshold is also set.

  • ng_threshold (float, optional) – integer threshold to be applied to landsat 8 or 9 where pixels less than threshold are masked

Returns:

halite ee.Image

Return type:

ee.Image

static landsat_kivu_chla_fn(image, threshold, ng_threshold=None)

Calculates relative chlorophyll-a concentrations of water pixels using 3BDA/KIVU index (see Boucher et al., 2018 for review - https://esajournals.onlinelibrary.wiley.com/doi/10.1002/eap.1708) and mask image based on threshold. Can specify separate thresholds for Landsat 5 vs 8&9 images, where the threshold argument applies to Landsat 5 and the ng_threshold argument applies to Landsat 8&9.

Parameters:
  • image (ee.Image) – input ee.Image

  • threshold (float) – value between -1 and 1 where pixels less than threshold will be masked, applies to landsat 5 when ng_threshold is also set.

  • ng_threshold (float, optional) – integer threshold to be applied to landsat 8 or 9 where pixels less than threshold are masked

Returns:

chlorophyll-a ee.Image

Return type:

ee.Image

static landsat_mndwi_fn(image, threshold, ng_threshold=None)

Calculates Modified Normalized Difference Water Index (MNDWI) from GREEN and SWIR bands for Landsat imagery and mask image based on threshold.

Can specify separate thresholds for Landsat 5 vs 8 & 9 images, where the threshold argument applies to Landsat 5 and the ng_threshold argument applies to Landsat 8 & 9.

Parameters:
  • image (ee.Image) – input image

  • threshold (float) – value between -1 and 1 where pixels less than threshold will be masked, applies to landsat 5 when ng_threshold is also set.

  • ng_threshold (float, optional) – integer threshold to be applied to landsat 8 or 9 where pixels less than threshold are masked

Returns:

ndwi image

Return type:

ee.Image

static landsat_msavi_fn(image, threshold, ng_threshold=None)

Calculates the Modified Soil-Adjusted Vegetation Index (MSAVI) for Landsat images. Masks image based on threshold. Can specify separate thresholds for Landsat 5 vs 8&9 images, where the threshold argument applies to Landsat 5 and the ng_threshold argument applies to Landsat 8&9. See Qi et al., 1994 - https://doi.org/10.1016/0034-4257(94)90134-1 and https://www.usgs.gov/landsat-missions/landsat-modified-soil-adjusted-vegetation-index

Parameters:
  • image (ee.Image) – input ee.Image

  • threshold (float) – value between -1 and 1 where MSAVI pixels less than threshold will be masked, applies to landsat 5 when ng_threshold is also set.

  • ng_threshold (float, optional) – integer threshold to be applied to landsat 8 or 9 where MSAVI pixels less than threshold are masked.

Returns:

MSAVI ee.Image

Return type:

ee.Image

static landsat_nbr_fn(image, threshold, ng_threshold=None)

Calculates the Normalized Burn Ratio (NBR) for Landsat images. Masks image based on threshold. Can specify separate thresholds for Landsat 5 vs 8&9 images, where the threshold argument applies to Landsat 5 and the ng_threshold argument applies to Landsat 8&9.

Parameters:
  • image (ee.Image) – input ee.Image

  • threshold (float) – value between -1 and 1 where NBR pixels less than threshold will be masked, applies to landsat 5 when ng_threshold is also set.

  • ng_threshold (float, optional) – integer threshold to be applied to landsat 8 or 9 where NBR pixels less than threshold are masked.

Returns:

NBR ee.Image

Return type:

ee.Image

static landsat_ndmi_fn(image, threshold, ng_threshold=None)

Calculates the Normalized Difference Moisture Index (NDMI) for Landsat images. Masks image based on threshold. Can specify separate thresholds for Landsat 5 vs 8&9 images, where the threshold argument applies to Landsat 5 and the ng_threshold argument applies to Landsat 8&9. See Wilson & Sader, 2002 - https://doi.org/10.1016/S0034-4257(02)00074-7

Parameters:
  • image (ee.Image) – input ee.Image

  • threshold (float) – value between -1 and 1 where NDMI pixels less than threshold will be masked, applies to landsat 5 when ng_threshold is also set.

  • ng_threshold (float, optional) – integer threshold to be applied to landsat 8 or 9 where NDMI pixels less than threshold are masked.

Returns:

NDMI ee.Image

Return type:

ee.Image

static landsat_ndsi_fn(image, threshold, ng_threshold=None)

Calculates the Normalized Difference Snow Index (NDSI) for Landsat images. Masks image based on threshold. Can specify separate thresholds for Landsat 5 vs 8&9 images, where the threshold argument applies to Landsat 5 and the ng_threshold argument applies to Landsat 8&9

Parameters:
  • image (ee.Image) – input ee.Image

  • threshold (float) – value between -1 and 1 where NDSI pixels greater than threshold will be masked, applies to landsat 5 when ng_threshold is also set.

  • ng_threshold (float, optional) – integer threshold to be applied to landsat 8 or 9 where NDSI pixels greater than threshold are masked.

Returns:

NDSI ee.Image

Return type:

ee.Image

static landsat_ndti_fn(image, threshold, ng_threshold=None)

Calculates turbidity of water pixels using Normalized Difference Turbidity Index (NDTI; Lacaux et al., 2007 - https://doi.org/10.1016/j.rse.2006.07.012) and mask image based on threshold. Can specify separate thresholds for Landsat 5 vs 8&9 images, where the threshold argument applies to Landsat 5 and the ng_threshold argument applies to Landsat 8&9.

Parameters:
  • image (ee.Image) – input ee.Image

  • threshold (float) – value between -1 and 1 where pixels less than threshold will be masked, applies to landsat 5 when ng_threshold is also set.

  • ng_threshold (float, optional) – integer threshold to be applied to landsat 8 or 9 where pixels less than threshold are masked

Returns:

turbidity ee.Image

Return type:

ee.Image

static landsat_ndvi_fn(image, threshold, ng_threshold=None)

Calculates ndvi from NIR and RED bands (Huang et al., 2020 - https://link.springer.com/10.1007/s11676-020-01155-1) for Landsat imagery and mask image based on threshold.

Can specify separate thresholds for Landsat 5 vs 8 & 9 images, where the threshold argument applies to Landsat 5 and the ng_threshold argument applies to Landsat 8&9.

Parameters:
  • image (ee.Image) – input ee.Image

  • threshold (float) – value between -1 and 1 where pixels less than threshold will be masked, applies to landsat 5 when ng_threshold is also set.

  • ng_threshold (float, optional) – integer threshold to be applied to landsat 8 or 9 where pixels less than threshold are masked

Returns:

ndvi ee.Image

Return type:

ee.Image

static landsat_ndwi_fn(image, threshold, ng_threshold=None)

Calculates ndwi from GREEN and NIR bands (McFeeters, 1996 - https://doi.org/10.1080/01431169608948714) for Landsat imagery and mask image based on threshold.

Can specify separate thresholds for Landsat 5 vs 8 & 9 images, where the threshold argument applies to Landsat 5 and the ng_threshold argument applies to Landsat 8 & 9.

Parameters:
  • image (ee.Image) – input image

  • threshold (float) – value between -1 and 1 where pixels less than threshold will be masked, applies to landsat 5 when ng_threshold is also set.

  • ng_threshold (float, optional) – integer threshold to be applied to landsat 8 or 9 where pixels less than threshold are masked

Returns:

ndwi image

Return type:

ee.Image

static landsat_savi_fn(image, threshold, ng_threshold=None, l=0.5)

Calculates the Soil-Adjusted Vegetation Index (SAVI) for Landsat images. Masks image based on threshold. Can specify separate thresholds for Landsat 5 vs 8&9 images, where the threshold argument applies to Landsat 5 and the ng_threshold argument applies to Landsat 8&9. See Huete, 1988 - https://doi.org/10.1016/0034-4257(88)90106-X

Parameters:
  • image (ee.Image) – input ee.Image

  • threshold (float) – value between -1 and 1 where SAVI pixels less than threshold will be masked, applies to landsat 5 when ng_threshold is also set.

  • ng_threshold (float, optional) – integer threshold to be applied to landsat 8 or 9 where SAVI pixels less than threshold are masked.

  • l (float, optional) – Soil brightness correction factor, typically set to 0.5. Defaults to 0.5.

Returns:

SAVI ee.Image

Return type:

ee.Image

mann_kendall_trend(target_band=None, join_method='system:time_start', geometry=None)

Calculates the Mann-Kendall S-value, Variance, Z-Score, and Confidence Level for each pixel in the image collection, in addition to calculating the Sen’s slope for each pixel in the image collection. The output is an image with the following bands: ‘s_statistic’, ‘variance’, ‘z_score’, ‘confidence’, and ‘slope’.

This function can be used to identify trends in the image collection over time, such as increasing or decreasing values in the target band, and can be used to assess the significance of these trends. Note that this function is computationally intensive and may take a long time to run for large image collections or high-resolution images.

The ‘s_statistic’ band represents the Mann-Kendall S-value, which is a measure of the strength and direction of the trend. The ‘variance’ band represents the variance of the S-value, which is a measure of the variability of the S-value. The ‘z_score’ band represents the Z-Score, which is a measure of the significance of the trend. The ‘confidence’ band represents the confidence level of the trend based on the z_score, which is a probabilistic measure of the confidence in the trend (percentage). The ‘slope’ band represents the Sen’s slope, which is a measure of the rate of change in the target band over time. This value can be small as multispectral indices commonly range from -1 to 1, so a slope may have values of <0.2 for most cases.

Be sure to select the correct band for the target_band parameter, as this will be used to calculate the trend statistics. You may optionally provide an ee.Geometry object for the geometry parameter to limit the area over which the trend statistics are calculated. The geometry parameter is optional and defaults to None, which means that the trend statistics will be calculated over the entire footprint of the image collection.

Parameters:
  • image_collection (LandsatCollection or ee.ImageCollection) – The input image collection for which the Mann-Kendall and Sen’s slope trend statistics will be calculated.

  • target_band (str) – The band name to be used for the output anomaly image. e.g. ‘ndvi’

  • join_method (str, optional) – The method used to join images in the collection. Options are ‘system:time_start’ or ‘Date_Filter’. Default is ‘system:time_start’.

  • geometry (ee.Geometry, optional) – An ee.Geometry object to limit the area over which the trend statistics are calculated and mask the output image. Default is None.

Returns:

An image with the following bands: ‘s_statistic’, ‘variance’, ‘z_score’, ‘confidence’, and ‘slope’.

Return type:

ee.Image

static maskClouds(image)

Masks clouds baseed on Landsat 8 QA band.

Parameters:

image (ee.Image) – input ee.Image

Returns:

ee.Image

Return type:

ee.Image

static maskShadows(image)

Masks cloud shadows based on Landsat 8 QA band.

Parameters:

image (ee.Image) – input ee.Image

Returns:

ee.Image

Return type:

ee.Image

static maskToWater(image)

Masks image to water pixels by masking land and cloud pixels based on Landsat image QA band.

Parameters:

image (ee.Image) – input ee.Image

Returns:

ee.Image with water pixels masked.

Return type:

ee.Image

static maskToWaterByNDWI(image, threshold, ng_threshold=None)

Masks water pixels using NDWI based on threshold. Can specify separate thresholds for Landsat 5 vs 8&9 images, where the threshold argument applies to Landsat 5 and the ng_threshold argument applies to Landsat 8&9

Parameters:
  • image (ee.Image) – input image

  • threshold (float) – value between -1 and 1 where NDWI pixels less than threshold will be masked, applies to landsat 5 when ng_threshold is also set.

  • ng_threshold (float, optional) – integer threshold to be applied to landsat 8 or 9 where NDWI pixels less than threshold are masked

Returns:

ee.Image with water pixels masked.

Return type:

ee.Image

static maskWater(image)

Masks water pixels based on Landsat image QA band.

Parameters:

image (ee.Image) – input ee.Image

Returns:

ee.Image with water pixels masked.

Return type:

ee.Image

static maskWaterByNDWI(image, threshold, ng_threshold=None)

Masks water pixels (mask land and cloud pixels) for all bands based on NDWI and a set threshold where all pixels less than NDWI threshold are masked out. Can specify separate thresholds for Landsat 5 vs 8&9 images, where the threshold argument applies to Landsat 5 and the ng_threshold argument applies to Landsat 8&9

Parameters:
  • image (ee.Image) – input image

  • threshold (float) – value between -1 and 1 where NDWI pixels greater than threshold will be masked, applies to landsat 5 when ng_threshold is also set.

  • ng_threshold (float, optional) – integer threshold to be applied to landsat 8 or 9 where NDWI pixels greater than threshold are masked

Returns:

ee.Image with water pixels masked

Return type:

ee.Image

mask_halite(threshold, ng_threshold=None)

Masks halite and returns collection as class object. Can specify separate thresholds for Landsat 5 vs 8&9 images where the threshold argument applies to Landsat 5 and the ng_threshold argument applies to Landsat 8&9.

Parameters:
  • threshold (float) – specify threshold for gypsum function (values less than threshold are masked)

  • ng_threshold (float, optional) – specify threshold for Landsat 8&9 gypsum function (values less than threshold are masked).

Returns:

LandsatCollection image collection

Return type:

LandsatCollection

mask_halite_and_gypsum(halite_threshold, gypsum_threshold, halite_ng_threshold=None, gypsum_ng_threshold=None)

Masks halite and gypsum and returns collection as class object. Can specify separate thresholds for Landsat 5 vs 8&9 images where the threshold argument applies to Landsat 5 and the ng_threshold argument applies to Landsat 8&9.

Parameters:
  • halite_threshold (float) – specify threshold for halite function (values less than threshold are masked)

  • halite_ng_threshold (float, optional) – specify threshold for Landsat 8&9 halite function (values less than threshold are masked)

  • gypsum_threshold (float) – specify threshold for gypsum function (values less than threshold are masked)

  • gypsum_ng_threshold (float, optional) – specify threshold for Landsat 8&9 gypsum function (values less than threshold are masked)

Returns:

LandsatCollection image collection

Return type:

LandsatCollection

mask_out_polygon(polygon)

Function to mask LandsatCollection image collection by a polygon (ee.Geometry), where pixels inside the polygon are masked out.

Parameters:

polygon (ee.Geometry) – ee.Geometry polygon or shape used to mask image collection.

Returns:

masked LandsatCollection image collection

Return type:

LandsatCollection

mask_to_polygon(polygon)

Function to mask LandsatCollection image collection by a polygon (ee.Geometry), where pixels outside the polygon are masked out.

Parameters:

polygon (ee.Geometry) – ee.Geometry polygon or shape used to mask image collection.

Returns:

masked LandsatCollection image collection

Return type:

LandsatCollection

mask_via_band(band_to_mask, band_for_mask, threshold=-1, mask_above=True, add_band_to_original_image=False)

Masks select pixels of a selected band from an image based on another specified band and threshold (optional). Example use case is masking vegetation from image when targeting land pixels. Can specify whether to mask pixels above or below the threshold.

Parameters:
  • band_to_mask (str) – name of the band which will be masked (target image)

  • band_for_mask (str) – name of the band to use for the mask (band you want to remove/mask from target image)

  • threshold (float) – value between -1 and 1 where pixels less than threshold will be masked; defaults to -1 assuming input band is already classified (masked to pixels of interest).

  • mask_above (bool) – if True, masks pixels above the threshold; if False, masks pixels below the threshold

Returns:

A new LandsatCollection with the specified band masked to pixels excluding from band_for_mask.

Return type:

LandsatCollection

static mask_via_band_fn(image, band_to_mask, band_for_mask, threshold, mask_above=False, add_band_to_original_image=False)

Masks pixels of interest from a specified band of a target image, based on a specified reference band and threshold. Designed for single image input which contains both the target and reference band. Example use case is masking vegetation from image when targeting land pixels. Can specify whether to mask pixels above or below the threshold.

Parameters:
  • image (ee.Image) – input ee.Image

  • band_to_mask (str) – name of the band which will be masked (target image)

  • band_for_mask (str) – name of the band to use for the mask (band you want to remove/mask from target image)

  • threshold (float) – value where pixels less or more than threshold (depending on mask_above argument) will be masked

  • mask_above (bool) – if True, masks pixels above the threshold; if False, masks pixels below the threshold

Returns:

masked ee.Image

Return type:

ee.Image

mask_via_singleband_image(image_collection_for_mask, band_name_to_mask, band_name_for_mask, threshold=-1, mask_above=False, add_band_to_original_image=False)

Masks select pixels of a selected band from an image collection based on another specified singleband image collection and threshold (optional). Example use case is masking vegetation from image when targeting land pixels. Can specify whether to mask pixels above or below the threshold. This function pairs images from the two collections based on an exact match of the ‘Date_Filter’ property.

Parameters:
  • image_collection_for_mask (LandsatCollection) – LandsatCollection image collection to use for masking (source of pixels that will be used to mask the parent image collection)

  • band_name_to_mask (str) – name of the band which will be masked (target image)

  • band_name_for_mask (str) – name of the band to use for the mask (band which contains pixels the user wants to remove/mask from target image)

  • threshold (float) – threshold value where pixels less (or more, depending on mask_above) than threshold will be masked; defaults to -1.

  • mask_above (bool) – if True, masks pixels above the threshold; if False, masks pixels below the threshold

  • add_band_to_original_image (bool) – if True, adds the band used for masking to the original image as an additional band; if False, only the masked band is retained in the output image.

Returns:

A new LandsatCollection with the specified band masked to pixels excluding from band_for_mask.

Return type:

LandsatCollection

static mask_via_singleband_image_fn(image_to_mask, image_for_mask, threshold, band_name_to_mask=None, band_name_for_mask=None, mask_above=True)

Masks pixels of interest from a specified band of a target image, based on a specified reference band and threshold. Designed for the case where the target and reference bands are in separate images. Example use case is masking vegetation from image when targeting land pixels. Can specify whether to mask pixels above or below the threshold.

Parameters:
  • image_to_mask (ee.Image) – image which will be masked (target image). If multiband, only the first band will be masked.

  • image_for_mask (ee.Image) – image to use for the mask (image you want to remove/mask from target image). If multiband, only the first band will be used for the masked.

  • threshold (float) – value where pixels less or more than threshold (depending on mask_above argument) will be masked

  • band_name_to_mask (str, optional) – name of the band in image_to_mask to be masked. If None, the first band will be used.

  • band_name_for_mask (str, optional) – name of the band in image_for_mask to be used for masking. If None, the first band will be used.

  • mask_above (bool) – if True, masks pixels above the threshold; if False, masks pixels below the threshold.

Returns:

masked ee.Image

Return type:

ee.Image

property masked_clouds_collection

Property attribute to mask clouds and return collection as class object.

Returns:

LandsatCollection image collection

Return type:

LandsatCollection

property masked_shadows_collection

Property attribute to mask shadows and return collection as class object.

Returns:

LandsatCollection image collection

Return type:

LandsatCollection

property masked_to_water_collection

Property attribute to mask image to water, removing land and cloud pixels, and return collection as class object.

Returns:

LandsatCollection image collection

Return type:

LandsatCollection

masked_to_water_collection_NDWI(threshold)

Function to mask all but water pixels based on NDWI and user set threshold.

Parameters:

threshold (float) – specify threshold for NDWI function (values less than threshold are masked)

Returns:

LandsatCollection image collection

Return type:

LandsatCollection

property masked_water_collection

Property attribute to mask water and return collection as class object.

Returns:

LandsatCollection image collection

Return type:

LandsatCollection

masked_water_collection_NDWI(threshold)

Masks water pixels based on NDWI and user set threshold.

Parameters:

threshold (float) – specify threshold for NDWI function (values greater than threshold are masked)

Returns:

LandsatCollection image collection

Return type:

LandsatCollection

property max

Property attribute function to calculate max image from image collection. Results are calculated once per class object then cached for future use.

Returns:

max image from entire collection.

Return type:

ee.Image

property mean

Property attribute function to calculate mean image from image collection. Results are calculated once per class object then cached for future use.

Returns:

mean image from entire collection.

Return type:

ee.Image

property median

Property attribute function to calculate median image from image collection. Results are calculated once per class object then cached for future use.

Returns:

median image from entire collection.

Return type:

ee.Image

merge(collections=None, multiband_collection=None, date_key='Date_Filter')

Merge many singleband LandsatCollection products into the parent collection, or merge a single multiband collection with parent collection, pairing images by exact Date_Filter and returning one multiband image per date.

NOTE: if you want to merge two multiband collections, use the combine method instead.

Parameters:
  • collections (list) – List of singleband collections to merge with parent collection, effectively adds one band per collection to each image in parent

  • multiband_collection (LandsatCollection, optional) – A multiband collection to merge with parent. Specifying a collection here will override collections.

  • date_key (str) – image property key for exact pairing (default ‘Date_Filter’)

Returns:

parent with extra single bands attached (one image per date)

Return type:

LandsatCollection

property min

Property attribute function to calculate min image from image collection. Results are calculated once per class object then cached for future use.

Returns:

min image from entire collection.

Return type:

ee.Image

property mndwi

Property attribute to calculate and access the MNDWI (Modified Normalized Difference Water Index) imagery of the LandsatCollection. This property initiates the calculation of MNDWI using a default threshold of -1 (or a previously set threshold of self.mndwi_threshold) and caches the result. The calculation is performed only once when the property is first accessed, and the cached result is returned on subsequent accesses.

Returns:

A LandsatCollection image collection

Return type:

LandsatCollection

mndwi_collection(threshold, ng_threshold=None)

Calculates mndwi and returns collection as class object, allows specifying threshold(s) for masking. Thresholds can be specified for Landsat 5 vs 8&9 images, where the threshold argument applies to Landsat 5 and the ng_threshold argument applies to Landsat 8&9. This function can be called as a method but is called by default when using the mndwi property attribute.

Parameters:

threshold (float) – specify threshold for MNDWI function (values less than threshold are masked)

Returns:

A LandsatCollection image collection

Return type:

LandsatCollection

property monthly_max_collection

Creates a monthly max composite from a LandsatCollection image collection.

This function computes the max for each month within the collection’s date range, for each band in the collection. It automatically handles the full temporal extent of the input collection.

The resulting images have a ‘system:time_start’ property set to the first day of each month and an ‘image_count’ property indicating how many images were used in the composite. Months with no images are automatically excluded from the final collection.

NOTE: the day of month for the ‘system:time_start’ property is set to the earliest date of the first month observed and may not be the first day of the month.

Returns:

A new LandsatCollection object with monthly max composites.

Return type:

LandsatCollection

property monthly_mean_collection

Creates a monthly mean composite from a LandsatCollection image collection.

This function computes the mean for each month within the collection’s date range, for each band in the collection. It automatically handles the full temporal extent of the input collection.

The resulting images have a ‘system:time_start’ property set to the first day of each month and an ‘image_count’ property indicating how many images were used in the composite. Months with no images are automatically excluded from the final collection.

NOTE: the day of month for the ‘system:time_start’ property is set to the earliest date of the first month observed and may not be the first day of the month.

Returns:

A new LandsatCollection object with monthly mean composites.

Return type:

LandsatCollection

property monthly_median_collection

Creates a monthly median composite from a LandsatCollection image collection.

This function computes the median for each month within the collection’s date range, for each band in the collection. It automatically handles the full temporal extent of the input collection.

The resulting images have a ‘system:time_start’ property set to the first day of each month and an ‘image_count’ property indicating how many images were used in the composite. Months with no images are automatically excluded from the final collection.

NOTE: the day of month for the ‘system:time_start’ property is set to the earliest date of the first month observed and may not be the first day of the month.

Returns:

A new LandsatCollection object with monthly median composites.

Return type:

LandsatCollection

property monthly_min_collection

Creates a monthly min composite from a LandsatCollection image collection.

This function computes the min for each month within the collection’s date range, for each band in the collection. It automatically handles the full temporal extent of the input collection.

The resulting images have a ‘system:time_start’ property set to the first day of each month and an ‘image_count’ property indicating how many images were used in the composite. Months with no images are automatically excluded from the final collection.

NOTE: the day of month for the ‘system:time_start’ property is set to the earliest date of the first month observed and may not be the first day of the month.

Returns:

A new LandsatCollection object with monthly min composites.

Return type:

LandsatCollection

property monthly_sum_collection

Creates a monthly sum composite from a LandsatCollection image collection.

This function computes the sum for each month within the collection’s date range, for each band in the collection. It automatically handles the full temporal extent of the input collection.

The resulting images have a ‘system:time_start’ property set to the first day of each month and an ‘image_count’ property indicating how many images were used in the composite. Months with no images are automatically excluded from the final collection.

NOTE: the day of month for the ‘system:time_start’ property is set to the earliest date of the first month observed and may not be the first day of the month.

Returns:

A new LandsatCollection object with monthly sum composites.

Return type:

LandsatCollection

property mosaicByDate

Property attribute function to mosaic collection images that share the same date.

The property CLOUD_COVER for each image is used to calculate an overall mean, which replaces the CLOUD_COVER property for each mosaiced image. Server-side friendly.

NOTE: if images are removed from the collection from cloud filtering, you may have mosaics composed of only one image.

Returns:

LandsatCollection image collection with mosaiced imagery and mean CLOUD_COVER as a property

Return type:

LandsatCollection

property msavi

Property attribute to calculate and access the MSAVI (Modified Soil Adjusted Vegetation Index) imagery of the LandsatCollection. This property initiates the calculation of MSAVI and caches the result. The calculation is performed only once when the property is first accessed, and the cached result is returned on subsequent accesses.

Returns:

A LandsatCollection image collection

Return type:

LandsatCollection

msavi_collection(threshold, ng_threshold=None)

Function to calculate the MSAVI (Modified Soil Adjusted Vegetation Index) and return collection as class object, allows specifying threshold(s) for masking. Thresholds can be specified for Landsat 5 vs 8&9 images, where the threshold argument applies to Landsat 5 and the ng_threshold argument applies to Landsat 8&9. This function can be called as a method but is called by default when using the msavi property attribute.

Parameters:
  • threshold (float) – specify threshold for MSAVI function (values less than threshold are masked)

  • ng_threshold (float, optional) – specify threshold for Landsat 8&9 MSAVI function (values less than threshold are masked)

Returns:

A LandsatCollection image collection

Return type:

LandsatCollection

multiband_sample(location, scale=30, file_path=None)

Extracts ALL band values for a SINGLE location across the entire collection.

Parameters:
  • location (tuple or ee.Geometry) – A single (lon, lat) tuple OR ee.Geometry.

  • scale (int, optional) – Scale in meters. Defaults to 30.

  • file_path (str, optional) – Path to save CSV.

Returns:

DataFrame indexed by Date, with columns for each Band.

Return type:

pd.DataFrame

multiband_zonal_stats(geometry, bands, reducer_types, scale=30, geometry_name='geom', dates=None, include_area=False, file_path=None, unweighted=False)

Calculates zonal statistics for multiple bands over a single geometry for each image in the collection. Allows for specifying different reducers for different bands. Optionally includes the geometry area.

Parameters:
  • geometry (ee.Geometry or ee.Feature) – The single geometry to calculate statistics for.

  • bands (list of str) – A list of band names to include in the analysis.

  • reducer_types (str or list of str) – A single reducer name (e.g., ‘mean’) to apply to all bands, or a list of reducer names matching the length of the ‘bands’ list to apply specific reducers to specific bands.

  • scale (int, optional) – The scale in meters for the reduction. Defaults to 30.

  • geometry_name (str, optional) – A name for the geometry, used in column naming. Defaults to ‘geom’.

  • dates (list of str, optional) – A list of date strings (‘YYYY-MM-DD’) to filter the collection. Defaults to None (processes all images).

  • include_area (bool, optional) – If True, adds a column with the area of the geometry in square meters. Defaults to False.

  • file_path (str, optional) – If provided, saves the resulting DataFrame to a CSV file at this path.

  • unweighted (bool, optional) – Whether to use unweighted reducers. Defaults to False.

Returns:

A pandas DataFrame indexed by Date, with columns named as ‘{band}_{geometry_name}_{reducer}’.

Return type:

pd.DataFrame

property nbr

Property attribute to calculate and access the NBR (Normalized Burn Ratio) imagery of the LandsatCollection. This property initiates the calculation of NBR using a default threshold of -1 (or a previously set threshold of self.nbr_threshold) and caches the result. The calculation is performed only once when the property is first accessed, and the cached result is returned on subsequent accesses.

Returns:

A LandsatCollection image collection

Return type:

LandsatCollection

nbr_collection(threshold, ng_threshold=None)

Function to calculate the NBR (Normalized Burn Ratio) and return collection as class object, allows specifying threshold(s) for masking. Thresholds can be specified for Landsat 5 vs 8&9 images, where the threshold argument applies to Landsat 5 and the ng_threshold argument applies to Landsat 8&9. This function can be called as a method but is called by default when using the nbr property attribute.

Parameters:
  • threshold (float) – specify threshold for NBR function (values less than threshold are masked)

  • ng_threshold (float, optional) – specify threshold for Landsat 8&9 NBR function (values less than threshold are masked)

Returns:

A LandsatCollection image collection

Return type:

LandsatCollection

property ndmi

Property attribute to calculate and access the NDMI (Normalized Difference Moisture Index) imagery of the LandsatCollection. This property initiates the calculation of NDMI and caches the result. The calculation is performed only once when the property is first accessed, and the cached result is returned on subsequent accesses.

Returns:

A LandsatCollection image collection

Return type:

LandsatCollection

ndmi_collection(threshold, ng_threshold=None)

Function to calculate the NDMI (Normalized Difference Moisture Index) and return collection as class object, allows specifying threshold(s) for masking. Thresholds can be specified for Landsat 5 vs 8&9 images, where the threshold argument applies to Landsat 5 and the ng_threshold argument applies to Landsat 8&9 (when ng_threshold is specified, otherwise threshold applies to all imagery). This function can be called as a method but is called by default when using the ndmi property attribute.

Parameters:
  • threshold (float) – specify threshold for NDMI function (values less than threshold are masked)

  • ng_threshold (float, optional) – specify threshold for Landsat 8&9 NDMI function (values less than threshold are masked)

Returns:

A LandsatCollection image collection

Return type:

LandsatCollection

property ndsi

Property attribute to calculate and access the NDSI (Normalized Difference Snow Index) imagery of the LandsatCollection. This property initiates the calculation of NDSI and caches the result. The calculation is performed only once when the property is first accessed, and the cached result is returned on subsequent accesses.

Returns:

A LandsatCollection image collection

Return type:

LandsatCollection

ndsi_collection(threshold, ng_threshold=None)

Function to calculate the NDSI (Normalized Difference Snow Index) and return collection as class object, allows specifying threshold(s) for masking. Thresholds can be specified for Landsat 5 vs 8&9 images, where the threshold argument applies to Landsat 5 and the ng_threshold argument applies to Landsat 8&9. This function can be called as a method but is called by default when using the ndsi property attribute.

Parameters:
  • threshold (float) – specify threshold for NDSI function (values less than threshold are masked)

  • ng_threshold (float, optional) – specify threshold for Landsat 8&9 NDSI function (values less than threshold are masked)

Returns:

A LandsatCollection image collection

Return type:

LandsatCollection

property ndvi

Property attribute to calculate and access the NDVI (Normalized Difference Vegetation Index) imagery of the LandsatCollection. This property initiates the calculation of NDVI using a default threshold of -1 (or a previously set threshold of self.ndvi_threshold) and caches the result. The calculation is performed only once when the property is first accessed, and the cached result is returned on subsequent accesses.

Returns:

A LandsatCollection image collection

Return type:

LandsatCollection

ndvi_collection(threshold, ng_threshold=None)

Function to calculate the NDVI (Normalized Difference Vegetation Index) and return collection as class object, allows specifying threshold(s) for masking. Thresholds can be specified for Landsat 5 vs 8&9 images, where the threshold argument applies to Landsat 5 and the ng_threshold argument applies to Landsat 8&9. This function can be called as a method but is called by default when using the ndwi property attribute.

Parameters:

threshold (float) – specify threshold for NDVI function (values less than threshold are masked)

Returns:

A LandsatCollection image collection

Return type:

LandsatCollection

property ndwi

Property attribute to calculate and access the NDWI (Normalized Difference Water Index) imagery of the LandsatCollection. This property initiates the calculation of NDWI using a default threshold of -1 (or a previously set threshold of self.ndwi_threshold) and caches the result. The calculation is performed only once when the property is first accessed, and the cached result is returned on subsequent accesses.

Returns:

A LandsatCollection image collection

Return type:

LandsatCollection

ndwi_collection(threshold, ng_threshold=None)

Calculates ndwi and returns collection as class object, allows specifying threshold(s) for masking. Thresholds can be specified for Landsat 5 vs 8&9 images, where the threshold argument applies to Landsat 5 and the ng_threshold argument applies to Landsat 8&9. This function can be called as a method but is called by default when using the ndwi property attribute.

Parameters:

threshold (float) – specify threshold for NDWI function (values less than threshold are masked)

Returns:

A LandsatCollection image collection

Return type:

LandsatCollection

static pixelAreaSum(image, band_name, geometry, threshold=-1, scale=30, maxPixels=1000000000000.0)

Calculates the summation of area for pixels of interest (above a specific threshold) in a geometry and store the value as image property (matching name of chosen band). If multiple band names are provided in a list, the function will calculate area for each band in the list and store each as a separate property.

NOTE: The resulting value has units of square meters.

Parameters:
  • image (ee.Image) – input ee.Image

  • band_name (string or list of strings) – name of band(s) (string) for calculating area. If providing multiple band names, pass as a list of strings.

  • geometry (ee.Geometry) – ee.Geometry object denoting area to clip to for area calculation

  • threshold (float) – integer threshold to specify masking of pixels below threshold (defaults to -1). If providing multiple band names, the same threshold will be applied to all bands. Best practice in this case is to mask the bands prior to passing to this function and leave threshold at default of -1.

  • scale (int) – integer scale of image resolution (meters) (defaults to 30)

  • maxPixels (int) – integer denoting maximum number of pixels for calculations

Returns:

ee.Image with area calculation in square meters stored as property matching name of band

Return type:

ee.Image

pixelAreaSumCollection(band_name, geometry, threshold=-1, scale=30, maxPixels=1000000000000.0, output_type='ImageCollection', area_data_export_path=None)

Calculates the geodesic summation of area for pixels of interest (above a specific threshold) within a geometry and stores the value as an image property (matching name of chosen band) for an entire image collection. Optionally exports the area data to a CSV file.

NOTE: The resulting value has units of square meters.

Parameters:
  • band_name (string or list of strings) – name of band(s) (string) for calculating area. If providing multiple band names, pass as a list of strings.

  • geometry (ee.Geometry) – ee.Geometry object denoting area to clip to for area calculation.

  • threshold (float) – integer threshold to specify masking of pixels below threshold (defaults to -1). If providing multiple band names, the same threshold will be applied to all bands. Best practice in this case is to mask the bands prior to passing to this function and leave threshold at default of -1.

  • scale (int) – integer scale of image resolution (meters) (defaults to 30).

  • maxPixels (int) – integer denoting maximum number of pixels for calculations.

  • output_type (str) – ‘ImageCollection’ or ‘ee.ImageCollection’ to return an ee.ImageCollection, ‘LandsatCollection’ to return a LandsatCollection object, or ‘DataFrame’, ‘Pandas’, ‘pd’, ‘dataframe’, ‘df’ to return a pandas DataFrame (defaults to ‘ImageCollection’).

  • area_data_export_path (str, optional) – If provided, the function will save the resulting area data to a CSV file at the specified path.

Returns:

Image collection of images with area calculation (square meters) stored as property matching name of band. Type of output depends on output_type argument.

Return type:

ee.ImageCollection or LandsatCollection

remove_duplicate_dates(sort_by='system:time_start', ascending=True)

Removes duplicate images that share the same date, keeping only the first one encountered. Useful for handling duplicate acquisitions or overlapping path/rows.

Parameters:
  • sort_by (str) – Property to sort by before filtering distinct dates. Options: ‘system:time_start’ or ‘CLOUD_COVER’. Defaults to ‘system:time_start’. Recommended to use ‘CLOUD_COVER’ (ascending=True) to keep the clearest image.

  • ascending (bool) – Sort order. Defaults to True.

Returns:

A new LandsatCollection object with distinct dates.

Return type:

LandsatCollection

sample(locations, band=None, scale=None, location_names=None, dates=None, file_path=None, tileScale=1)

Extracts time-series pixel values for a list of locations.

Parameters:
  • locations (list, tuple, ee.Geometry, or ee.FeatureCollection) – Input points.

  • band (str, optional) – The name of the band to sample. Defaults to the first band.

  • scale (int, optional) – Scale in meters. Defaults to 30 if None.

  • location_names (list of str, optional) – Custom names for locations.

  • dates (list, optional) – Date filter [‘YYYY-MM-DD’].

  • file_path (str, optional) – CSV export path.

  • tileScale (int, optional) – Aggregation tile scale. Defaults to 1.

Returns:

DataFrame indexed by Date, columns by Location.

Return type:

pd.DataFrame (or CSV if file_path is provided)

property savi

Property attribute to calculate and access the SAVI (Soil Adjusted Vegetation Index) imagery of the LandsatCollection. This property initiates the calculation of SAVI and caches the result. The calculation is performed only once when the property is first accessed, and the cached result is returned on subsequent accesses.

Returns:

A LandsatCollection image collection

Return type:

LandsatCollection

savi_collection(threshold, ng_threshold=None, l=0.5)

Function to calculate the SAVI (Soil Adjusted Vegetation Index) and return collection as class object, allows specifying threshold(s) for masking. Thresholds can be specified for Landsat 5 vs 8&9 images, where the threshold argument applies to Landsat 5 and the ng_threshold argument applies to Landsat 8&9. This function can be called as a method but is called by default when using the savi property attribute.

Parameters:
  • threshold (float) – specify threshold for SAVI function (values less than threshold are masked)

  • ng_threshold (float, optional) – specify threshold for Landsat 8&9 SAVI function (values less than threshold are masked)

  • l (float, optional) – Soil brightness correction factor, typically set to 0.5 for intermediate vegetation cover. Defaults to 0.5.

Returns:

A LandsatCollection image collection

Return type:

LandsatCollection

property scale_to_reflectance

Scales each band in the Landsat collection from DN values to surface reflectance values.

Returns:

A new LandsatCollection object with bands scaled to reflectance.

Return type:

LandsatCollection

sens_slope_trend(target_band=None, join_method='system:time_start', geometry=None)

Calculates Sen’s Slope (trend magnitude) for the collection. This is a lighter-weight alternative to the full mann_kendall_trend function if only the direction and magnitude of the trend are needed.

Be sure to select the correct band for the target_band parameter, as this will be used to calculate the trend statistics. You may optionally provide an ee.Geometry object for the geometry parameter to limit the area over which the trend statistics are calculated. The geometry parameter is optional and defaults to None, which means that the trend statistics will be calculated over the entire footprint of the image collection.

Parameters:
  • target_band (str) – The name of the band to analyze. Defaults to ‘ndvi’.

  • join_method (str) – Property to use for time sorting (‘system:time_start’ or ‘Date_Filter’).

  • geometry (ee.Geometry, optional) – Geometry to mask the final output.

Returns:

An image containing the ‘slope’ band.

Return type:

ee.Image

surface_temperature_collection()

Function to calculate LST (Land Surface Temperature - in Celcius) and return collection as class object.

Returns:

A LandsatCollection image collection

Return type:

LandsatCollection

static temperature_bands(img)

Renames bands for temperature calculations.

Parameters:

img – input ee.Image

Returns:

ee.Image

Return type:

ee.Image

static transect(image, lines, line_names, reducer='mean', n_segments=None, dist_interval=30, to_pandas=True)

Computes and stores the values along a transect for each line in a list of lines. Builds off of the extract_transect function from the geemap package where checks are ran to ensure that the reducer column is present in the transect data. If the reducer column is not present, a column of NaNs is created. An ee reducer is used to aggregate the values along the transect, depending on the number of segments or distance interval specified. Defaults to ‘mean’ reducer.

Parameters:
  • image (ee.Image) – ee.Image object to use for calculating transect values.

  • lines (list) – List of ee.Geometry.LineString objects.

  • line_names (list of strings) – List of line string names.

  • reducer (str) – The ee reducer to use. Defaults to ‘mean’.

  • n_segments (int) – The number of segments that the LineString will be split into. Defaults to None.

  • dist_interval (float) – The distance interval in meters used for splitting the LineString. If specified, the n_segments parameter will be ignored. Defaults to 30.

  • to_pandas (bool) – Whether to convert the result to a pandas dataframe. Defaults to True.

Returns:

organized list of values along the transect(s)

Return type:

pd.DataFrame or ee.FeatureCollection

transect_iterator(lines, line_names, reducer='mean', dist_interval=90, n_segments=None, scale=30, processing_mode='aggregated', save_folder_path=None, sampling_method='line', point_buffer_radius=15, batch_size=10)

Computes and returns pixel values along transects. Provide a list of ee.Geometry.LineString objects and corresponding names, and the function will compute the specified reducer value at regular intervals along each line for all images in the collection. Use dist_interval or n_segments to control sampling resolution. The user can choose between ‘aggregated’ mode (returns a dictionary of DataFrames) or ‘iterative’ mode (saves individual CSVs for each transect). Alter sampling_method to sample directly along the line or via buffered points along the line. Buffered points can help capture more representative pixel values in heterogeneous landscapes, and the buffer radius can be adjusted via point_buffer_radius.

Parameters:
  • lines (list) – List of ee.Geometry.LineString objects.

  • line_names (list) – List of string names for each transect.

  • reducer (str, optional) – Reducer name. Defaults to ‘mean’.

  • dist_interval (float, optional) – Distance interval in meters. Defaults to 90.

  • n_segments (int, optional) – Number of segments (overrides dist_interval).

  • scale (int, optional) – Scale in meters. Defaults to 30.

  • processing_mode (str, optional) – ‘aggregated’ or ‘iterative’.

  • save_folder_path (str, optional) – Path to save CSVs.

  • sampling_method (str, optional) – ‘line’ or ‘buffered_point’.

  • point_buffer_radius (int, optional) – Buffer radius if using ‘buffered_point’.

  • batch_size (int, optional) – Images per request in ‘aggregated’ mode. Defaults to 10. Lower the value if you encounter a ‘Too many aggregations’ error.

Returns:

Dictionary of DataFrames (aggregated) or None (iterative).

Return type:

dict or None

property turbidity

Property attribute to calculate and access the turbidity (NDTI) imagery of the LandsatCollection. This property initiates the calculation of turbidity using a default threshold of -1 (or a previously set threshold of self.turbidity_threshold) and caches the result. The calculation is performed only once when the property is first accessed, and the cached result is returned on subsequent accesses.

Returns:

A LandsatCollection image collection

Return type:

LandsatCollection

turbidity_collection(threshold, ng_threshold=None)

Calculates the turbidity (NDTI) index and return collection as class object, allows specifying threshold(s) for masking. Thresholds can be specified for Landsat 5 vs 8&9 images, where the threshold argument applies to Landsat 5 and the ng_threshold argument applies to Landsat 8&9. This function can be called as a method but is called by default when using the ndwi property attribute.

Parameters:
  • threshold (float) – specify threshold for the turbidity function (values less than threshold are masked)

  • ng_threshold (float, optional) – specify threshold for Landsat 8&9 turbidity function (values less than threshold are masked)

Returns:

A LandsatCollection image collection

Return type:

LandsatCollection

yearly_max_collection(start_month=1, end_month=12)

Creates a yearly max composite from the collection, with optional monthly filtering.

This function computes the max for each year within the collection’s date range. You can specify a range of months (e.g., start_month=6, end_month=10 for June-October) to calculate the max only using imagery from that specific season for each year. The resulting images have ‘system:time_start’, ‘year’, ‘image_count’, ‘season_start’, ‘season_end’, and ‘Date_Filter’ properties. Years with no images (after filtering) are excluded.

Parameters:
  • start_month (int) – The starting month (1-12) for the filter. Defaults to 1 (January).

  • end_month (int) – The ending month (1-12) for the filter. Defaults to 12 (December).

Returns:

A new instance of the same class (e.g., LandsatCollection) containing the yearly max composites.

Return type:

Object

yearly_mean_collection(start_month=1, end_month=12)

Creates a yearly mean composite from the collection, with optional monthly filtering.

This function computes the mean for each year within the collection’s date range. You can specify a range of months (e.g., start_month=6, end_month=10 for June-October) to calculate the mean only using imagery from that specific season for each year.

The resulting images have ‘system:time_start’, ‘year’, ‘image_count’, ‘season_start’, ‘season_end’, and ‘Date_Filter’ properties. Years with no images (after filtering) are excluded.

Parameters:
  • start_month (int) – The starting month (1-12) for the filter. Defaults to 1 (January).

  • end_month (int) – The ending month (1-12) for the filter. Defaults to 12 (December).

Returns:

A new instance of the same class (e.g., LandsatCollection) containing the yearly mean composites.

Return type:

Object

yearly_median_collection(start_month=1, end_month=12)

Creates a yearly median composite from the collection, with optional monthly filtering.

This function computes the median for each year within the collection’s date range. You can specify a range of months (e.g., start_month=6, end_month=10 for June-October) to calculate the median only using imagery from that specific season for each year. The resulting images have ‘system:time_start’, ‘year’, ‘image_count’, ‘season_start’, ‘season_end’, and ‘Date_Filter’ properties. Years with no images (after filtering) are excluded.

Parameters:
  • start_month (int) – The starting month (1-12) for the filter. Defaults to 1 (January).

  • end_month (int) – The ending month (1-12) for the filter. Defaults to 12 (December).

Returns:

A new instance of the same class (e.g., LandsatCollection) containing the yearly median composites.

Return type:

Object

yearly_min_collection(start_month=1, end_month=12)

Creates a yearly min composite from the collection, with optional monthly filtering.

This function computes the min for each year within the collection’s date range. You can specify a range of months (e.g., start_month=6, end_month=10 for June-October) to calculate the min only using imagery from that specific season for each year. The resulting images have ‘system:time_start’, ‘year’, ‘image_count’, ‘season_start’, ‘season_end’, and ‘Date_Filter’ properties. Years with no images (after filtering) are excluded.

Parameters:
  • start_month (int) – The starting month (1-12) for the filter. Defaults to 1 (January).

  • end_month (int) – The ending month (1-12) for the filter. Defaults to 12 (December).

Returns:

A new instance of the same class (e.g., LandsatCollection) containing the yearly min composites.

Return type:

Object

yearly_sum_collection(start_month=1, end_month=12)

Creates a yearly sum composite from the collection, with optional monthly filtering.

This function computes the sum for each year within the collection’s date range. You can specify a range of months (e.g., start_month=6, end_month=10 for June-October) to calculate the sum only using imagery from that specific season for each year. The resulting images have ‘system:time_start’, ‘year’, ‘image_count’, ‘season_start’, ‘season_end’, and ‘Date_Filter’ properties. Years with no images (after filtering) are excluded.

Parameters:
  • start_month (int) – The starting month (1-12) for the filter. Defaults to 1 (January).

  • end_month (int) – The ending month (1-12) for the filter. Defaults to 12 (December).

Returns:

A new instance of the same class (e.g., LandsatCollection) containing the yearly sum composites.

Return type:

Object