ASTER GDEM v3 via Python3

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
Post Reply
n.germano
Posts: 1
Joined: Mon Apr 20, 2020 7:48 am America/New_York
Answers: 0

ASTER GDEM v3 via Python3

by n.germano » Mon Apr 20, 2020 7:58 am America/New_York

Hi everyone,
I would like to download the ASTER GDEM v3 files via Python3 APIs (if possible). My intention is to download files after typing the coordinates of my interest.

Thank you.
Nicola

Tags:

LP DAAC - ckrehbiel
Subject Matter Expert
Subject Matter Expert
Posts: 59
Joined: Tue Nov 12, 2019 3:29 pm America/New_York
Answers: 0

Re: ASTER GDEM v3 via Python3

by LP DAAC - ckrehbiel » Wed Apr 29, 2020 12:00 pm America/New_York

Here are three potential solutions to your question:

1. The Application for Extracting and Exploring Analysis Ready Samples (AppEEARS).
AppEEARS is an easy to use web application for accessing and transforming geospatial data from a variety of federal data archives, that enables users to subset data spatially, temporally, and by band/layer parameters. AppEEARS also includes an API that allows you to submit requests for specific coordinates of interest, and return ASTER GDEM data mosaicked and clipped to your specific region of interest that can be downloaded via Python as GeoTIFF or NetCDF-4 files.

Links:
Web Interface: https://lpdaacsvc.cr.usgs.gov/appeears/
API: https://lpdaacsvc.cr.usgs.gov/appeears/api/
Getting Started with the AppEEARS API in Python Tutorials: https://lpdaac.usgs.gov/resources/e-learning/#API

2. DAAC2DISK
The LP DAAC2Disk utility allows users to simplify the search and HTTPS download process of the LP DAAC's data pool holdings. The LP DAAC2Disk utility is available as a script that can be downloaded and executed from the command line. The script is available for various platforms and can be downloaded at: https://lpdaac.usgs.gov/tools/daac2diskscripts/

Check out the pages 3-5 of the user guide (https://lpdaac.usgs.gov/documents/603/D ... 200313.pdf) to see how to query for ASTER GDEM version 3 data using a bounding box. The script will return the files intersecting that bounding box and will prompt the user if they would like to download the data and to enter a NASA Earthdata Login username and password, and then download the data.

3. NASA Earthdata Common Metadata Repository (CMR) API
CMR is a spatial and temporal metadata registry that stores metadata from a variety of science disciplines and includes ASTER GDEM version 3 (ASTGTM.003). CMR includes an API that would allow you to search for specific ASTER GDEM files spatially, and would return links to the desired files that could then be downloaded in Python. Information for getting started with the CMR API can be found at: https://earthdata.nasa.gov/collaborate/ ... pi/cmr-api

Below is an example CMR query in Python to return all of the ASTGTM.003 files over the US state of Colorado:

Code: Select all

import requests 
req = requests.get('https://cmr.earthdata.nasa.gov/search/granules.json?short_name=ASTGTM&version=003&page_size=2000&pageNum=1&bounding_box=-109,36,-101,41').json()['feed']['entry'] 
fileList = [g['links'][0]['href'] for g in req] 
Note: The bounding box parameters must be 4 comma-separated numbers: lower left longitude, lower left latitude, upper right longitude, upper right latitude.

Post Reply