Skip to content

Commit

Permalink
Add LANDSAT filter
Browse files Browse the repository at this point in the history
  • Loading branch information
tmiddelkoop committed Nov 9, 2021
1 parent 8bf98f0 commit ca580df
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
8 changes: 6 additions & 2 deletions landsat/ReadMe.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
```
3 changes: 2 additions & 1 deletion landsat/search.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,6 @@
"top": 38.99,
"bottom":38.79,
"left": -92.56,
"right": -92.36
"right": -92.36,
"landsat": "LANDSAT_8"
}
3 changes: 2 additions & 1 deletion landsat/search.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"))
Expand All @@ -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

0 comments on commit ca580df

Please sign in to comment.