Published: Feb. 7, 2019
All publicly available Earth observation data from NASA’s Land Processes Distributed Active Archive Center (LP DAAC) are available online via Hypertext Transfer Protocol Secure (HTTPS). However, NASA Earthdata login credentials are required to download the data. Users looking to download LP DAAC data directly via a command line utility will need to pass their Earthdata login username and password to do so. This document demonstrates how to set up a .netrc file or a .wgetrc file to store your NASA Earthdata login username and password, which can be used to authenticate your credentials when attempting to download LP DAAC data from the command line. Additionally, if you are looking to download data directly in R or Python, be sure to check out the scripts provided in How to Access the LP DAAC Data Pool with R and How to Access the LP DAAC Data Pool with Python.
Two common command line utilities for downloading data over the internet are curl and wget. These tools each have different command line arguments and parameters that will need to be passed to them to authenticate your NASA Earthdata login credentials when downloading data from the LP DAAC.
The instructions below demonstrate how to set up a .netrc file, for use with curl, or a .wgetrc file, for use with wget, to successfully download a file from the LP DAAC via HTTPS.
Set up a .netrc file in your home directory
type NUL >> %userprofile%\.netrc | echo machine urs.earthdata.nasa.gov >> %userprofile%\.netrc
echo login REPLACEWITHUSERNAME >> %userprofile%\.netrc | echo password REPLACEWITHPASSWORD >> %userprofile%\.netrc
touch ~/.netrc | chmod og-rw ~/.netrc | echo machine urs.earthdata.nasa.gov >> ~/.netrc
Download LP DAAC data from the command line
curl -O -b ~/.urs_cookies -c ~/.urs_cookies -L -n https://e4ftl01.cr.usgs.gov//DP107/MOLA/MYD13Q1.006/2013.01.09/MYD13Q1.A2013009.h09v07.006.2015254175244.hdf
where wget in the command prompt to find the directory
touch .wgetrc | chmod og-rw .wgetrc
type NUL >> .wgetrc
echo http-user=REPLACEWITHUSERNAME >> .wgetrc | echo http-password=REPLACEWITHPASSWORD >> .wgetrc
wget -i filelistcontainingmultipleURLs.txt