Page 1 of 1
Script to download IMERG
Posted: Sun Jul 09, 2023 1:04 pm America/New_York
by ehsantaghizadeh
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
Re: Script to download IMERG
Posted: Mon Jul 17, 2023 5:01 am America/New_York
by GES DISC-EDL - zliu
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
Re: Script to download IMERG
Posted: Mon Jul 17, 2023 11:43 am America/New_York
by ehsantaghizadeh
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
Re: Script to download IMERG
Posted: Mon Jul 17, 2023 12:34 pm America/New_York
by GES DISC-EDL - zliu
Re: Script to download IMERG
Posted: Mon Jul 17, 2023 3:41 pm America/New_York
by ehsantaghizadeh
Dear zliu,
Thank you for your helpful suggestion. I will try these.