geowatch.utils.util_rgdc module

geowatch.utils.util_rgdc.group_tiles(query, timediff_sec=300)[source]

Given a RGDC search query result, nest results so that scenes that can be merged are grouped together

TODO when RGDC STAC endpoint is available, calculate overlap with AOI here

Parameters:
  • query – output of rgdc.search

  • timediff_sec – max allowed time between adjacent scenes. Should nominally be 23 seconds for Landsat 7 and 8. Some buffer is included. TODO what is it for Sentinel?

Example

>>> # xdoctest: +SKIP
>>> from rgd_client import Rgdc
>>> client = Rgdc('username', 'password')
>>> query = (client.search(**kwargs, instrumentation='ETM') +
>>>          client.search(**kwargs, instrumentation='OLI_TIRS'))
>>> # query == [scene1, scene2, scene3, scene4]
>>> query = group_tiles(query)
>>> # query == [[scene1], [scene2, scene3], [scene4]]
geowatch.utils.util_rgdc.bands_landsat(entry)[source]

Get only the band files from a Landsat RasterMetaEntry downloaded from RGD.

Parameters:

entry – RasterMetaEntry, the output type of rgdc.download_raster

Returns:

list of pathlib paths to band files

geowatch.utils.util_rgdc.bands_sentinel2(entry)[source]

Get only the band files from a Sentinel-2 RasterMetaEntry downloaded from RGD.

Parameters:

entry – RasterMetaEntry, the output type of rgdc.download_raster

Returns:

list of pathlib paths to band files