geowatch.demo.sentinel2_demodata module¶
Grab specific sentinel2 images for testing
- geowatch.demo.sentinel2_demodata.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
- geowatch.demo.sentinel2_demodata.grab_sentinel2_product(index=0, overwrite=False)[source]¶
Download and cache all items for a Sentinel-2 product.
TODO when RGD supports API keys, give one to this repo and use that instead of fels.
- Parameters:
index – 0, 1, or 2. Currently this function just picks 3 scenes over KR in Nov 2018.
overwrite (bool, default=False) – if True, always downloads the files
- Returns:
- rgd_client.rgdc.RasterDownload(
path: pathlib.Path, images: List[pathlib.Path], ancillary: List[pathlib.Path]
)
Example
>>> # xdoctest: +SKIP("too many https errors") >>> # xdoctest: +REQUIRES(--network) >>> from geowatch.demo.sentinel2_demodata import * # NOQA >>> product = grab_sentinel2_product() >>> assert len(bands_sentinel2(product)) == 13