Get Datasets

Landsat

pb_gee_tools.datasets.get_landsat_sr_collection(aoi: Geometry, start_date: datetime, end_date: datetime, cloud_thres: int = 50, ignore_ls7: bool = False, out_lstm_bands: bool = True) ImageCollection

A function which returns an GEE Image Collection of Surface Reflectance Landsat imagery merging the data from different Landsat sensors (e.g., Landsat 5 and Landsat 7) where the cloud masks have been applied.

Parameters:
  • aoi – an ee.Geometry object representing the area of interest

  • start_date – the start date for the collection

  • end_date – the end date for the collection

  • cloud_thres – a cloud threshold for the scenes to be included

  • ignore_ls7 – A boolean specifying whether to ignore landsat 7 should be ignored which might be preferable to the SLC-off error. Default: False

  • out_lstm_bands – A boolean specifying whether to output the LS8 and LS9 outputs should be subset to remove the coastal band so the bands are compatible with LS7 and LS5/4.

Returns:

A GEE Image Collection of the landsat images.

pb_gee_tools.datasets.get_landsat_thermal_collection(aoi: Geometry, start_date: datetime, end_date: datetime, cloud_thres: int = 50, ignore_ls7: bool = False) ImageCollection

A function which returns an GEE Image Collection of surface temperature Landsat imagery merging the data from different Landsat sensors (e.g., Landsat 5 and Landsat 7) where the cloud masks have been applied.

Parameters:
  • aoi – an ee.Geometry object representing the area of interest

  • start_date – the start date for the collection

  • end_date – the end date for the collection

  • cloud_thres – a cloud threshold for the scenes to be included

  • ignore_ls7 – A boolean specifying whether to ignore landsat 7 should be ignored which might be preferable to the SLC-off error. Default: False

Returns:

A GEE Image Collection of the landsat images.

Sentinel-2

pb_gee_tools.datasets.get_sen2_sr_collection(aoi: Geometry, start_date: datetime, end_date: datetime, cloud_thres: int = 50, cld_prb_thres: float = 50, nir_drk_thres: float = 0.15, cld_prj_dist: float = 1, clds_buffer: float = 50, cloud_clear_thres: float = 0.6) ImageCollection

A function to retrieve an ImageCollection of Sentinel-2 images where both the s2cloudless and Google Cloud Plus cloud masking datasets have been applied to the imagery to remove as much cloud and cloud shadow as possible.

Parameters:
  • aoi – ee.Geometry object representing the area of interest

  • start_date – datetime.datetime object representing the start date of data collection

  • end_date – datetime.datetime object representing the end date of data collection

  • cloud_thres – Integer representing the cloud cover threshold percentage

  • cld_prb_thres – Float representing the cloud probability threshold

  • nir_drk_thres – Float representing the threshold for dark NIR pixels

  • cld_prj_dist – Float representing the distance for cloud shadow projection

  • clds_buffer – Float representing the buffer length for cloud shadow removal

  • cloud_clear_thres – Float representing the cloud clear threshold percentage

Returns:

ee.ImageCollection containing Sentinel-2 surface reflectance imagery

pb_gee_tools.datasets.get_sen2_sr_s2cloudless_collection(aoi: Geometry, start_date: datetime, end_date: datetime, cloud_thres: int = 50, cld_prb_thres: float = 50, nir_drk_thres: float = 0.15, cld_prj_dist: float = 1, clds_buffer: float = 50) ImageCollection

A function to retrieve an ImageCollection of Sentinel-2 images where the s2cloudless cloud masking dataset has been applied to the imagery. Unless you have a good reason not to it is recommended that you use the get_sen2_sr_collection function which applies both s2cloudless and the Google Cloud Plus masks.

Parameters:
  • aoi – An Earth Engine Geometry representing the Area of Interest.

  • start_date – A datetime object indicating the start date for the image collection.

  • end_date – A datetime object indicating the end date for the image collection.

  • cloud_thres – An integer representing the maximum allowable cloud cover percentage.

  • cld_prb_thres – A float specifying the threshold probability above which pixels are classified as clouds.

  • nir_drk_thres – A float representing the threshold for dark NIR pixels, excluding water, for potential cloud shadows.

  • cld_prj_dist – A float indicating the distance to project cloud shadows in meters.

  • clds_buffer – A float representing the buffer distance in meters to remove small cloud-shadow patches.

Returns:

An ee.ImageCollection filtered and processed according to cloud and shadow masking criteria.

pb_gee_tools.datasets.get_sen2_sr_cloud_plus_collection(aoi: Geometry, start_date: datetime, end_date: datetime, cloud_thres: int = 50, cloud_clear_thres: float = 0.6) ImageCollection

A function to retrieve an ImageCollection of Sentinel-2 images where the Google Cloud Plus cloud masking dataset has been applied to the imagery. Unless you have a good reason not to it is recommended that you use the get_sen2_sr_collection function which applies both s2cloudless and the Google Cloud Plus masks.

Parameters:
  • aoi – An Earth Engine Geometry representing the area of interest for image acquisition.

  • start_date – A Python datetime.datetime object representing the start date for image collection.

  • end_date – A Python datetime.datetime object representing the end date for image collection.

  • cloud_thres – An integer representing the maximum cloud coverage percentage threshold for images to be included.

  • cloud_clear_thres – A float representing the minimum cloud confidence score for cloud mask application.

Returns:

An Earth Engine Image Collection containing Sentinel-2 Surface Reflectance imagery after cloud masking.

Sentinel-1

pb_gee_tools.datasets.get_sen1_collection(aoi: Geometry, start_date: datetime, end_date: datetime, orbit_pass: int = 1, add_ndpi: bool = False)

A function to retrieve an image collection of Sentinel-1 imagery in dB.

Parameters:
  • aoi – Area of interest defined as a geometry where Sentinel-1 imagery will be collected.

  • start_date – Start date for the time range of Sentinel-1 imagery collection.

  • end_date – End date for the time range of Sentinel-1 imagery collection.

  • orbit_pass – Orbit pass direction for the Sentinel-1 imagery collection. Defaults to pb_gee_tools.PB_GEE_SEN1_ASCENDING.

  • add_ndpi – Boolean flag to indicate whether to add Normalized Difference Polarization Index (NDPI) band to the image collection.

Returns:

An ImageCollection filtered by the specified parameters for Sentinel-1 imagery data.

MODIS

pb_gee_tools.datasets.get_modis_albedo_collection(aoi: Geometry, start_date: datetime, end_date: datetime)

A function to retrieve an image collection with the MODIS Albedo data masked to the valid pixels.

Parameters:
  • aoi – An Earth Engine Geometry representing the area of interest.

  • start_date – A datetime object indicating the start date for filtering image collection.

  • end_date – A datetime object indicating the end date for filtering image collection.

Returns:

A processed image collection containing MODIS albedo bands with quality masking applied.

pb_gee_tools.datasets.get_modis_daily_obs_temp_collection(aoi: Geometry, start_date: datetime, end_date: datetime)

A function which retrieves MODIS/061/MOD21A1D and MODIS/061/MOD21A1N image collections and masks them to all the valid pixels (QC bit 0 == 0). The function returns two image collections, one for the daytime temperature and other for the nighttime tempture.

Parameters:
  • aoi – An Earth Engine Geometry representing the Area of Interest (AOI).

  • start_date – A Python datetime object indicating the start date for filtering MODIS images.

  • end_date – A Python datetime object indicating the end date for filtering MODIS images.

Returns:

A tuple containing two Earth Engine ImageCollections representing the filtered MODIS daily and nightly temperature images respectively.

Constants

  • PB_GEE_SEN1_ASCENDING = 1

  • PB_GEE_SEN1_DESCENDING = 2