当前位置: 首页 > 工具软件 > NASA ECHO > 使用案例 >

Ubuntu NASA全球GPM免费降雨数据下载

袁谭三
2023-12-01

https://disc.gsfc.nasa.gov/data-access#windows_wget

wget for Mac/Linux

  1. Make sure you have set up your Earthdata account.
  2. Install wget if necessary. A version of wget 1.18 compiled with gnuTLS 3.3.3 or OpenSSL 1.0.2 or LibreSSL 2.0.2 or later is recommended.
  3. Create a .netrc file in your home directory.
    1. cd ~ or cd $HOME
    2. touch .netrc
    3. 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)
    4. chmod 0600 .netrc (so only you can access it)
  4. Create a cookie file. This file will be used to persist sessions across calls to wget or curl.
    1. cd ~ or cd $HOME
    2. touch .urs_cookies.
      Note: you may need to re-create .urs_cookies in case you have already executed wget without valid authentication.
  5. Download your data using wget:

    wget --load-cookies ~/.urs_cookies --save-cookies ~/.urs_cookies --auth-no-challenge=on --keep-session-cookies <url>

    * If you are using subsetting services through the GES DISC website:

    wget --load-cookies ~/.urs_cookies --save-cookies ~/.urs_cookies --auth-no-challenge=on --keep-session-cookies --content-disposition <url>

    wget --load-cookies ~/.urs_cookies --save-cookies ~/.urs_cookies --auth-no-challenge=on --keep-session-cookies -i <url.txt>

    Add the --content-disposition to your command when using subsetting services:

    wget --load-cookies ~/.urs_cookies --save-cookies ~/.urs_cookies --auth-no-challenge=on --keep-session-cookies --content-disposition -i <url.txt>

    1. To download one file:
      • --auth-no-challenge may not be needed depending on your version of wget
      • <url> is the link that points to a file you wish to download or to an OPeNDAP resource.
      • Only use --content-disposition for downloading subsetted files through the GES DISC website.
      • Your Earthdata password might be requested on the first download
    2. To download multiple data files at once, create a plain-text <url.txt> file with each line containing a GES DISC data file URL. Then, enter the following command:
 类似资料: