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]]