Script to download IMERG

Use this Forum to find information on, or ask a question about, NASA Earth Science data.
Post Reply
ehsantaghizadeh
Posts: 2
Joined: Sun Jul 09, 2023 12:36 pm America/New_York
Answers: 0

Script to download IMERG

by ehsantaghizadeh » Sun Jul 09, 2023 1:04 pm America/New_York

Hi,
I could download IMERG data manually from https://disc.gsfc.nasa.gov/datasets/GPM_3IMERGDL_06/summary > Web Services> Subset Get Data. I would like to download IMERG data automatically and routinely. May I ask how can I do that? Can someone help me to write such a script, please?
Sincerely

Tags:

GES DISC - zliu
User Services
User Services
Posts: 19
Joined: Tue Sep 17, 2019 2:11 pm America/New_York
Answers: 0

Re: Script to download IMERG

by GES DISC - zliu » Mon Jul 17, 2023 5:01 am America/New_York

You could write a script to generate a list of links using a sample from Subset/Get Data. Also add wget or curl to the script to download the data from the list of links. The instructions for wget or curl: https://disc.gsfc.nasa.gov/information/howto?title=How%20to%20Access%20GES%20DISC%20Data%20Using%20wget%20and%20curl

ehsantaghizadeh
Posts: 2
Joined: Sun Jul 09, 2023 12:36 pm America/New_York
Answers: 0

Re: Script to download IMERG

by ehsantaghizadeh » Mon Jul 17, 2023 11:43 am America/New_York

GES DISC - zliu wrote:
> You could write a script to generate a list of links using a sample from
> Subset/Get Data. Also add wget or curl to the script to download the data
> from the list of links. The instructions for wget or curl:
> https://disc.gsfc.nasa.gov/information/howto?title=How%20to%20Access%20GES%20DISC%20Data%20Using%20wget%20and%20curl

Dear zliu,
Thank you so much for your helpful reply.
I tried the following script. It seems to work and I hope the data is downloaded correctly.

#!/bin/bash

year2d=$(date -d -2day +"%Y")
mon2d=$(date -d -2day +"%m")
day2d=$(date -d -2day +"%d")

cd /home1/data/imergdl

#Download last IMERG data
wget --load-cookies ~/.urs_cookies --save-cookies ~/.urs_cookies --keep-session-cookies --content-disposition https://gpm1.gesdisc.eosdis.nasa.gov/opendap/GPM_L3/GPM_3IMERGDL.06/${year2d}/${mon2d}/3B-DAY-L.MS.MRG.3IMERG.${year2d}${mon2d}${day2d}-S000000-E235959.V06.nc4.nc4?precipitationCal[0:0][2150:2500][1099:1349],time,lon[2150:2500],lat[1099:1349] -O IMERGDL${year2d}${mon2d}${day2d}.nc4

GES DISC - zliu
User Services
User Services
Posts: 19
Joined: Tue Sep 17, 2019 2:11 pm America/New_York
Answers: 0

Re: Script to download IMERG

by GES DISC - zliu » Mon Jul 17, 2023 12:34 pm America/New_York

You could use Giovanni, https://giovanni.gsfc.nasa.gov/giovanni/#service=TmAvMp&starttime=&endtime=&data=GPM_3IMERGDL_06_precipitationCal

and Panoply (displaying the downloaded file), https://www.giss.nasa.gov/tools/panoply/ to verify your downloaded file.

ehsantaghizadeh
Posts: 2
Joined: Sun Jul 09, 2023 12:36 pm America/New_York
Answers: 0

Re: Script to download IMERG

by ehsantaghizadeh » Mon Jul 17, 2023 3:41 pm America/New_York

Dear zliu,
Thank you for your helpful suggestion. I will try these.
Last edited by ehsantaghizadeh on Mon Jul 17, 2023 3:42 pm America/New_York, edited 1 time in total.

Post Reply