The getgranulelist script
This script is written in python language and uses standard packages. It has been tested with python2.6 and python2.7, slight changes may be necessary for a different version. The main task of the script is to build the URL of the query to the webservice offering this operation and then calling this URL, so it can be very easily adapted to any of your favorite language. An example of such a call is given below.In case of any issue, feel free to This email address is being protected from spambots. You need JavaScript enabled to view it. .
Please download the script here.
Usage
Usage: getgranulelist [options] Options: -h, --help show this help message and exit -p identifier, --product=identifier collection (dataset) to search for granules -d date,date, --date=date,date start and end dates for which to the search the dataset granules, expressed as <start,stop> with each date as <YYYY-MM-DDThh:mm:ss> -b minLat,maxLat,minLon,maxLon, --bbox= minLat,maxLat,minLon,maxLon geographical selection frame, expressed as <minLat,maxLat,minLon,maxLon> with longitudes (between -180 and 180) and latitudes (between -90 and 90) in degrees (ex: --bbox=-80/80/-180/180) -l, --list list some of the available products -u, --url list also the available URLs for each product
Example
- getting orbit files (L2P) for geophysical product from ERS-1 altimeter (product id = GW_L2P_ALT_ERS1_GDR, refer to the product description pages or use getgranulelist --list to see available products), in a 60S-60N 100W-0E geographical area on 1st February 1994. The --url option will display the corresponding file FTP link in addition to the file name.
getgranulelist --product=GW_L2P_ALT_ERS1_GDR --date=1994-02-01T00:00:00,1994-02-02T00:00:00 --bbox=-60.,60.,-100.,0. --url
The script will return the following result :
QUERYING..... http://www.ifremer.fr/naiad/naiad/services-2.1.10/index.php?method=GetListOfGranules&AUTHENTICATION=guest&TIME=1994-02-01T00:00:00/1994-02-02T00:00:00&COLLECTION=GW_L2P_ALT_ERS1_GDR&BBOX=-100.,-60.,0.,60.&URL=true&PUBLIC=true GW_L2P_ALT_ERS1_GDR_19940201_000000_19940201_004551_115_0061.nc ftp://w1f612:tempo2@eftp.ifremer.fr/waveuser/globwave/data/l2p/altimeter/gdr/ers1/1994/032/GW_L2P_ALT_ERS1_GDR_19940201_000000_19940201_004551_115_0061.nc.gz GW_L2P_ALT_ERS1_GDR_19940201_013606_19940201_022618_115_0063.nc ftp://w1f612:tempo2@eftp.ifremer.fr/waveuser/globwave/data/l2p/altimeter/gdr/ers1/1994/032/GW_L2P_ALT_ERS1_GDR_19940201_013606_19940201_022618_115_0063.nc.gz GW_L2P_ALT_ERS1_GDR_19940201_031633_19940201_040647_115_0065.nc ftp://w1f612:tempo2@eftp.ifremer.fr/waveuser/globwave/data/l2p/altimeter/gdr/ers1/1994/032/GW_L2P_ALT_ERS1_GDR_19940201_031633_19940201_040647_115_0065.nc.gz GW_L2P_ALT_ERS1_GDR_19940201_045701_19940201_054715_115_0067.nc ftp://w1f612:tempo2@eftp.ifremer.fr/waveuser/globwave/data/l2p/altimeter/gdr/ers1/1994/032/GW_L2P_ALT_ERS1_GDR_19940201_045701_19940201_054715_115_0067.nc.gz GW_L2P_ALT_ERS1_GDR_19940201_090827_19940201_095824_115_0072.nc ftp://w1f612:tempo2@eftp.ifremer.fr/waveuser/globwave/data/l2p/altimeter/gdr/ers1/1994/032/GW_L2P_ALT_ERS1_GDR_19940201_090827_19940201_095824_115_0072.nc.gz GW_L2P_ALT_ERS1_GDR_19940201_104839_19940201_113852_115_0074.nc ftp://w1f612:tempo2@eftp.ifremer.fr/waveuser/globwave/data/l2p/altimeter/gdr/ers1/1994/032/GW_L2P_ALT_ERS1_GDR_19940201_104839_19940201_113852_115_0074.nc.gz GW_L2P_ALT_ERS1_GDR_19940201_122908_19940201_131920_115_0076.nc ftp://w1f612:tempo2@eftp.ifremer.fr/waveuser/globwave/data/l2p/altimeter/gdr/ers1/1994/032/GW_L2P_ALT_ERS1_GDR_19940201_122908_19940201_131920_115_0076.nc.gz GW_L2P_ALT_ERS1_GDR_19940201_140935_19940201_145948_115_0078.nc ftp://w1f612:tempo2@eftp.ifremer.fr/waveuser/globwave/data/l2p/altimeter/gdr/ers1/1994/032/GW_L2P_ALT_ERS1_GDR_19940201_140935_19940201_145948_115_0078.nc.gz GW_L2P_ALT_ERS1_GDR_19940201_155003_19940201_164016_115_0080.nc ftp://w1f612:tempo2@eftp.ifremer.fr/waveuser/globwave/data/l2p/altimeter/gdr/ers1/1994/032/GW_L2P_ALT_ERS1_GDR_19940201_155003_19940201_164016_115_0080.nc.gz GW_L2P_ALT_ERS1_GDR_19940201_214141_19940201_223131_116_0001.nc ftp://w1f612:tempo2@eftp.ifremer.fr/waveuser/globwave/data/l2p/altimeter/gdr/ers1/1994/032/GW_L2P_ALT_ERS1_GDR_19940201_214141_19940201_223131_116_0001.nc.gz GW_L2P_ALT_ERS1_GDR_19940201_232209_19940202_001222_116_0003.nc ftp://w1f612:tempo2@eftp.ifremer.fr/waveuser/globwave/data/l2p/altimeter/gdr/ers1/1994/032/GW_L2P_ALT_ERS1_GDR_19940201_232209_19940202_001222_116_0003.nc.gz
Adapting the script
As shown on above example, the script actually just build and call the URL to a webservice then parse and display the result to user's console. It is then quite easy to perform the same task in any other language provided you just build correctly the URL which is quite straightforward to understand. In above example, the corresponding URL is displayed on console :
http://www.ifremer.fr/naiad/naiad/services-2.1.10/index.php?method=GetListOfGranules&AUTHENTICATION=guest&TIME=1994-02-01T00:00:00/1994-02-02T00:00:00&COLLECTION=GW_L2P_ALT_ERS1_GDR&BBOX=-100.,-60.,0.,60.&URL=true&PUBLIC=true