Closed jhkennedy closed 2 years ago
For testing, every single landsat scene is included in this csv:
aws s3 ls --profile hyp3 --request-payer requester s3://usgs-landsat/collection02/inventory/inventory_product_list.zip
and both get_lc2_metadata
and get_lc2_stac_json_key
should work for all of them.
Here is a set of scenes from the Malaspina datacube test that failed due to being unable to look up a scenes metadata in the STAC catalog:
['LE07_L1TP_063017_20011208_20200917_02_T2', 'LT05_L1TP_060018_19860116_20200918_02_T2', 'LE07_L1TP_064018_20130404_20200907_02_T1', 'LE07_L1TP_063017_20140907_20200905_02_T2', 'LE07_L1TP_064017_20130404_20200907_02_T1', 'LT05_L1TP_063017_19960929_20200911_02_T2', 'LE07_L1TP_062018_20001214_20200917_02_T2', 'LT05_L1TP_063018_19920326_20200915_02_T2', 'LE07_L1GT_063018_20170915_20200830_02_T2']
These look like they'd give complete test coverage:
LC09_L1GT_122028_20211107_20220119_02_T2
LO09_L1TP_060002_20220316_20220316_02_T1
LT09_L1GT_137206_20220107_20220123_02_T2
LC08_L2SP_028042_20220831_20220910_02_T1
LO08_L1GT_157021_20191221_20200924_02_T2
LT08_L1GT_141212_20140902_20200925_02_T2
LE07_L1TP_024035_20061119_20200913_02_T1
LT05_L2SP_224075_19871031_20201014_02_T1
LM05_L1GS_098068_19950831_20200823_02_T2
LT04_L1TP_183062_19880706_20200917_02_T1
LM04_L1GS_117071_19830609_20200903_02_T2
stac.json files exist in s3://usgs-landsat/
for all 11 test cases:
aws s3 ls --request-payer requester s3://usgs-landsat/collection02/level-1/standard/oli-tirs/2021/122/028/LC09_L1GT_122028_20211107_20220119_02_T2/LC09_L1GT_122028_20211107_20220119_02_T2_stac.json
aws s3 ls --request-payer requester s3://usgs-landsat/collection02/level-1/standard/oli-tirs/2022/060/002/LO09_L1TP_060002_20220316_20220316_02_T1/LO09_L1TP_060002_20220316_20220316_02_T1_stac.json
aws s3 ls --request-payer requester s3://usgs-landsat/collection02/level-1/standard/oli-tirs/2022/137/206/LT09_L1GT_137206_20220107_20220123_02_T2/LT09_L1GT_137206_20220107_20220123_02_T2_stac.json
aws s3 ls --request-payer requester s3://usgs-landsat/collection02/level-1/standard/oli-tirs/2016/138/039/LC08_L1TP_138039_20161105_20200905_02_T1/LC08_L1TP_138039_20161105_20200905_02_T1_stac.json
aws s3 ls --request-payer requester s3://usgs-landsat/collection02/level-1/standard/oli-tirs/2019/157/021/LO08_L1GT_157021_20191221_20200924_02_T2/LO08_L1GT_157021_20191221_20200924_02_T2_stac.json
aws s3 ls --request-payer requester s3://usgs-landsat/collection02/level-1/standard/oli-tirs/2015/138/206/LT08_L1GT_138206_20150628_20200925_02_T2/LT08_L1GT_138206_20150628_20200925_02_T2_stac.json
aws s3 ls --request-payer requester s3://usgs-landsat/collection02/level-1/standard/etm/2006/024/035/LE07_L1TP_024035_20061119_20200913_02_T1/LE07_L1TP_024035_20061119_20200913_02_T1_stac.json
aws s3 ls --request-payer requester s3://usgs-landsat/collection02/level-1/standard/tm/1995/124/064/LT05_L1TP_124064_19950211_20200912_02_T1/LT05_L1TP_124064_19950211_20200912_02_T1_stac.json
aws s3 ls --request-payer requester s3://usgs-landsat/collection02/level-1/standard/mss/1995/098/068/LM05_L1GS_098068_19950831_20200823_02_T2/LM05_L1GS_098068_19950831_20200823_02_T2_stac.json
aws s3 ls --request-payer requester s3://usgs-landsat/collection02/level-1/standard/tm/1988/183/062/LT04_L1TP_183062_19880706_20200917_02_T1/LT04_L1TP_183062_19880706_20200917_02_T1_stac.json
aws s3 ls --request-payer requester s3://usgs-landsat/collection02/level-1/standard/mss/1983/117/071/LM04_L1GS_117071_19830609_20200903_02_T2/LM04_L1GS_117071_19830609_20200903_02_T2_stac.json
2022-07-06 10:18:15 45702 LC09_L1GT_122028_20211107_20220119_02_T2_stac.json
2022-07-01 06:11:39 47221 LO09_L1TP_060002_20220316_20220316_02_T1_stac.json
2022-07-06 10:32:13 31900 LT09_L1GT_137206_20220107_20220123_02_T2_stac.json
2022-06-30 11:03:24 49892 LC08_L1TP_138039_20161105_20200905_02_T1_stac.json
2022-07-06 11:52:17 46876 LO08_L1GT_157021_20191221_20200924_02_T2_stac.json
2022-07-06 09:55:48 33616 LT08_L1GT_138206_20150628_20200925_02_T2_stac.json
2022-06-29 17:32:08 47419 LE07_L1TP_024035_20061119_20200913_02_T1_stac.json
2022-06-29 13:41:54 46530 LT05_L1TP_124064_19950211_20200912_02_T1_stac.json
2022-07-06 11:21:52 32714 LM05_L1GS_098068_19950831_20200823_02_T2_stac.json
2022-06-30 03:17:31 46528 LT04_L1TP_183062_19880706_20200917_02_T1_stac.json
2022-07-06 12:07:18 32717 LM04_L1GS_117071_19830609_20200903_02_T2_stac.json
When looking up a scene's metadata, if the STAC catalog did not have an item for a scene, we'd fall back to looking for a STAC item JSON in the AWS S3 bucket. This, however, doesn't work for legacy missions (L4,5,7) as the bucket is organized by sensor and we hard-coded the L8,9 sensor.
Example scene: LE07_L1GT_063018_20170915_20200830_02_T2
This add the sensor mapping and dynamic sensor value in S3 path.