Skip to content. | Skip to navigation

Personal tools
You are here: GES DISC Home Registration for Data Access

Earthdata Login for Data Access

Instructions how to access the GES DISC data via HTTP/OPeNDAP, command line and desktop applications

In order to download GES DISC data via browser window, or from the command line, or via desktop applications, you must first register with Earthdata Login and then authorize NASA GESDISC Data Access:

  1. How to Register a New User in Earthdata Login
  2. How to Authorize NASA GESDISC DATA ARCHIVE in Earthdata Login
  3. To verify that authorization went successfully download any file from GES DISC archive, or click here  to see if you get valid output

Once these steps are done you could access the GES DISC data in your browser via HTTP and OPeNDAP. In order to access the data via command line and desktop applications, additional steps must be followed:

  1. Wget
  2. Curl
  3. ncdump
  4. Integrated Data Viewer 
  5. toolsUI
  6. Panoply
  7. Matlab
  8. Python
  9. Interactive Data Language
  10. GrADS

Using Wget and Curl with Earthdata Login Authentication

1. Make sure you have already allowed the URL from which you are getting data access to your user profile as explained here.

2. Create a .netrc file in your home directory.

    a. cd ~ or cd $HOME

    b. touch .netrc

    c. echo "machine urs.earthdata.nasa.gov login <uid> password <password>" >> .netrc (where <uid> is your user name and <password> is your Earthdata Login password without the brackets)

    d. chmod 0600 .netrc (so only you can access it)

       note for Windows users: wget for some of the Windows OS versions will not work with .netrc, instead .wgetrc has to be created with the following content:
http_user = <your Earthdata Login user name without brackets>
http_password = <your Earthdata Login password without brackets>

3. Create a cookie file. This file will be used to persist sessions across calls to Wget or Curl.

    a. cd ~ or cd $HOME

    b. touch .urs_cookies. Note: you have to re-create .urs_cookies in case you executed wget or curl without valid authentication.

4. Download your data.

    a. Wget:

        wget --load-cookies ~/.urs_cookies --save-cookies ~/.urs_cookies --auth-no-challenge=on --keep-session-cookies http://server[:port]/path/file[.format[?subset]] -O output[.format]

--auth-no-challenge may not be needed depending on your version of wget.

If you wish to download an entire directory, use the following:

wget --load-cookies ~/.urs_cookies --save-cookies ~/.urs_cookies --auth-no-challenge=on --keep-session-cookies -npr http://server[:port]/path/file[.format[?subset]] -O output[.format]

     b. Curl:

curl -n -c ~/.urs_cookies -b ~/.urs_cookies -L --url http://server[:port]/path/file[.format[?subset]] -o output[.format]

 where :port = optional port number,

If downloading from an OPeNDAP server:

            .format = .ascii or .nc or .nc4 or .dods

      and ?subset = subset for variables, e.g. /group/dataset[100:1:100][50:1:54]

Back to top

 

Applications and Procedures to Manage Authentication Within Them

  • ncdump- utilizes the NetCDF-C library to access Data Access Protocol resources (Use netCDF version 4.4.0 and greater)
  1. Create .netrc and .urs_cookies files as described above for wget
  2. Create a .dodsrc file in your home directory so that it tells DAP clients to use the .netrc file for password information

    Lines to add to .dodsrc file:

    HTTP.COOKIEJAR=<your home path>/.urs_cookies

    HTTP.NETRC=<your home path>/.netrc

  • Integrated Data Viewer (IDV)- Download latest version (http://www.unidata.ucar.edu/downloads/idv/current/index.jsp), GUI driven data client that utilizes the netCDF-Java library to access DAP resources
  1. Set up authentication configuration the same as for ncdump.
  2. Register with the Unidata website to download software.
  3. Launch IDV and choose a new dataset: Data > Choose Data > From a Web Server
  4. Enter the DAP URL. A pop-up window appears titled Server Authentication which asks for your credentials.
  • ToolsUI- GUI driven data client based around the CDM/netCDF data model and utilizes netCDF-Java library to access remote DAP datasets.
  1. Unidata recommends using the latest version of toolsUI (at least version 4.6 or greater). Download (ftp://ftp.unidata.ucar.edu/pub/netcdf-java/v4.6/toolsUI-4.6.4.jar)
  2. Launch with the following command line: java -Xmx1g -jar toolsUI-4.6.4.jar "-Xmx[size]" specifies the maximum size in bytes of the memory allocation pool. It must be greater than 2 MB and a multiple of 1024. "-jar" executes the program encapsulated in a JAR file.
  3. Select Viewer tab. Enter DAP data URL and hit enter. An HTTP Authentication box pops up. You may need to expand the pop up window to see all four fields. Enter your credentials and hit Apply.
  • Panoply-Sophisticated GUI driven data client based around CDM/netCDF data model and utilizes netCDF-Java to access remote DAP datasets.
  1. Download latest version of Panoply (http://www.giss.nasa.gov/tools/panoply/download.html).
  2. File > Open Remote Dataset
  3. Enter DAP data URL and hit Load. Authentication box pops up. Enter credentials and hit Load.
  • Matlab and other applications that use netCDF-C library
  1. Set up authentication configuration the same as for ncdump.
  2. Check version of the netCDF-C library that the application uses. This requires Matlab R2015b or later.
  • PyDAP- provides both an interface for python programs to read from OPeNDAP servers and the netCDF4 python module which uses the netCDF-C library to actually access data.
  1. Check version of the netCDF-C library that the application uses. Once the application has updated to version 4.3.3.1 or later, authentication configuration should be the same as for ncdump.
  2. Go to http://www.pydap.org/client.html#basic-digest and copy and paste code into a function called install_cas_client.py
  3. Start python.

        >>> import install_cas_client

        >>> from pydap.client import open_url

        >>> dataset = open_url('http://<USERNAME>:<PASSWORD>@server[:port]/path/file[.format[?subset]]')

  • Interactive Data Language (IDL)- Version 8.2 and later includes support for OPeNDAP, using netCDF4 library
  1. Start IDL.

        IDL> url = 'http://<USERNAME>:<PASSWORD>@server[:port]/path/file[.format[?subset]]'

        IDL> file_id = ncdf_open(url)

        IDL> info = ncdf_inquire(file_id)

  • Grid Analysis and Display System (GrADS)
  1. Download GrADS version 2.1.0 or later from here
  2. Create a .netrc file in your home directory and a cookie file as described in above curl download instructions
  3. Create .dodsrc file in your home directory and add to it location of .urs_cookies and .netrc files:
    HTTP.NETRC=<YourHomeDirectory>/.netrc
    HTTP.COOKIEJAR=<YourHomeDirectory>/.urs_cookies
  4. Run curl to populate .urs_cookies file, e.g.: 

         curl -n -c ~/.urs_cookies -b ~/.urs_cookies -L --url  "http://airsl1.gesdisc.eosdis.nasa.gov/data/.dummy.hdf" -o /dev/null

  1. Start GrADS. With all these pieces in place, you should be able to use sdfopen with data URL as is:

        ga-> sdfopen http://server[:port]/path/file[.format[?subset]]

        for example: ga-> sdfopen http://goldsmr4.gesdisc.eosdis.nasa.gov/dods/M2TMNXSLV

Back to top
Document Actions
NASA Logo - nasa.gov
NASA Privacy Policy and Important Notices
Last updated: Sep 16, 2016 10:40 AM ET
Top