This program can download the landsat8 images and other files from Amazon Web Services. The 11 bands can be downloaded on demand depending upon which type of scene you would like to generate. Any files required for scene generation will be downloaded. Scenes will be generated once files have been saved to local disk. Bands can be downloaded independently or automatically depending on what bands are needed for the specific calculation/composite.
This program creates GeoTIFF files of the following:
- Normalized Difference Vegetation Index Calculation
- Soil Adjusted Vegetation Index Calculation
- Visible Spectrum (Natural Color) Composite
- Short-Wave Infrared Composite
- Agriculture Composite
- Geology Composite
- Bathymetric Composite
- ./data/index.gz is index for available data, which is downloaded if not present, do not delete it.
- ./data/defaults.json is user’s last input for prompts in the program. It is safe to delete, but you will need to reinput previous values at prompt.
- If download is interrupted because of any problems the program will exit. On the next run, the downloaded file can resume download as long the incomplete ‘.part’ file is not deleted.
To use this program the scene with which you would like to work is required.
- Find the scene you would like at RemotePixel.ca.
- Note the WRS path/row number of the image (written inside blue circle at the center of each scene) or the string of the scene.
Both landsat8.py and main.py can be run interactively or from command line arguments:
- Pass ‘-h’ to see the command line uses
- Pass ‘-i’ to run interactively.
- You can also run interactive with defaults input with ‘-a’, which will retrace the previous interactive session. (Useful if your downloads were interrupted.)
- Run the ‘main.py’ script.
- If you do not have the scene string, the script allows for browing available scenes data. Enter path number and row number. If you have the scene string, input as prompted. (Input yes to use last used most recently used scene.)
- Details of scene you selected will be displayed. Confirm the scene selected. (It’s also a good idea to remember or note the scene string for future reference. The scene string is in the index ‘productId’.)
- After selecting the scene with which you would like to work, choose the calculation/composite you would like to to create. The program will automatically download any necessary bands for that image and generate the scene. Bands and generated images will be saved in ‘./data/PPPRRR/SCENE_STR/’ directory where PPP and RRR are path and row numbers.
Example uses:
- Generates RGB image for scene. LC08_L1TP_141041_20190324_20190403_01_T1
python main.py --scene LC08_L1TP_141041_20190324_20190403_01_T1 --image RGB
- Generates NIR and RGB images for scene you choose interactively after entering this command.
python main.py --image NIR RGB
See Other Resources below for more information on the GeoTIFFs calculated with this script.
If you only want to download bands for calculating scenes, the program will download those automatically. To download files independently of scene generation:
- Run the ‘landsat8.py’ script.
- Enter the scene string or WRS path/row like in Image Creator.
- Details of scene you selected will be displayed. Confirm the scene selected.
- A list of available files will be displayed. Choose the files to download.
Example uses:
- Downloads band 11 file TIF.ovr from wrs 141/41, asks for scene selection because scene string is not provided.
python landsat8.py --wrs-path 141 --wrs-row 41 --bands-no 11 --file-type TIF.ovr
- Downloads RED, GREEN and BLUE bands .TIF file from scene LC08_L1TP_141041_20190324_20190403_01_T1
python landsat8.py --scene LC08_L1TP_141041_20190324_20190403_01_T1 --bands RED GREEN BLUE
The RemotePixel.ca displays available scenes in WRS global notation. The numbers on top of any box is the path/row. The scene string can also be found out if in the URL of the image shown on the right when scene is selected. Since this script can search for all scenes for a specific WRS path/row interactively it is not necessary, but using RemotePixel.ca to locate the scene string may make locating the area of interest easier.
- (NDVI) Normalized Difference Vegetation Index
- (SAVI) Soil Adjusted Vegetation Index
- (Other Combinations) Landsat 8 Bands and Band Combinations
This code may require enabling a hidden option in the IDE. They apparently don’t work well with os.get_terminal_size() out of the box.
To enable:
- Click Help > Edit Custom VM Options
- Add: -Drun.processes.with.pty=true
- Save the file.
Code licensed under MIT License
- James Steele Howard - Original Author
- Gaurav Atreya
There are many forks of this repository. For example:
- This fork is created and maintained by Gaurav Atreya. For any developing features which aren’t merge please look into it to avoid working on same features.