diff --git a/landsat/ReadMe.md b/landsat/ReadMe.md index ec7cd1d..116555f 100644 --- a/landsat/ReadMe.md +++ b/landsat/ReadMe.md @@ -22,13 +22,17 @@ Access data via command line tools. Get the index and view. mkdir -v data gsutil ls gs://gcp-public-data-landsat gsutil cp gs://gcp-public-data-landsat/index.csv.gz data/ -gzip -d index.csv.gz +gzip -d data/index.csv.gz ``` ## Stage Three -Automate +Automate (2m to download and decompress) ``` +gcloud compute ssh instance-1 +sudo apt install --yes git +git clone https://github.internet2.edu/CLASS/CLASS-Examples.git +cd CLASS-Examples/landsat/ bash get-index.sh python3 search.py | bash download.sh ``` diff --git a/landsat/search.json b/landsat/search.json index ca2389e..7bf77f2 100644 --- a/landsat/search.json +++ b/landsat/search.json @@ -2,5 +2,6 @@ "top": 38.99, "bottom":38.79, "left": -92.56, - "right": -92.36 + "right": -92.36, + "landsat": "LANDSAT_8" } diff --git a/landsat/search.py b/landsat/search.py index cd578f3..02ca0c3 100644 --- a/landsat/search.py +++ b/landsat/search.py @@ -15,6 +15,7 @@ right=config['right'] top=config['top'] bottom=config['bottom'] +landsat=config['landsat'] # SCENE_ID,PRODUCT_ID,SPACECRAFT_ID,SENSOR_ID,DATE_ACQUIRED,COLLECTION_NUMBER,COLLECTION_CATEGORY,SENSING_TIME,DATA_TYPE,WRS_PATH,WRS_ROW,CLOUD_COVER,NORTH_LAT,SOUTH_LAT,WEST_LON,EAST_LON,TOTAL_SIZE,BASE_URL reader=csv.reader(open("data/index.csv")) @@ -34,6 +35,6 @@ if DEBUG: print(west,left,east,right,north,top,south,bottom) # Test if box is contained-ish by image - if west <= left and east >= right and north >= top and south <= bottom: + if west <= left and east >= right and north >= top and south <= bottom and SPACECRAFT_ID==landsat: if DEBUG: print(west,left,east,right,north,top,south,bottom,WRS_PATH,WRS_ROW,BASE_URL) print(BASE_URL) # output BASE_URL