Project

General

Profile

Esgf-client » History » Version 1

Herve Caumont, 2013-06-20 10:50

1 1 Herve Caumont
h1. ESGFClient
2
3
h2. Overview
4
5
ESGFClient is a Command Line Interface written in C# able to download products from the "ESGF Data Search" getting as input the location of a RDF file or a list of single product's urls.
6
7
h2. Installation
8
9
The user can install the ESGFClient following these easy steps:
10
11
<pre><code class="XML">
12
yum install esgf-tools
13
</code></pre>
14
15
and test the installation with
16
17
<pre><code class="XML">
18
ESGFClient --help
19
</code></pre>
20
21
h2. Usage
22
23
These are the options given:
24
<pre><code class="XML">
25
Options:
26
  -f, --file=VALUE           File RDF to parse
27
  -F, --Force                Force the whole rdf's resources
28
  -O, --OpenDAP              Download ONLY the OpenDAP resources
29
  -u, --url=VALUE            Url to download
30
  -o, --openid=VALUE         OpenId used to access.
31
  -p, --password=VALUE       Password OpenId used to access.
32
  -b, --bbox=VALUE            bounding box to restrict the file search and
33
                               the file size (only with OpenDAP service). Use
34
                               west, south, east, north .
35
  -s, --dtstart=VALUE         the beginning of the time query. YYYY-MM-
36
                               DDTHH:mm:ssZ .
37
  -e, --dtend=VALUE           the end of the time query. YYYY-MM-DDTHH:mm:ssZ
38
                               .
39
  -t, --basetime=VALUE        the start of time coverage of the Dataset. YYYY-
40
                               MM-DDTHH:mm:ssZ .
41
  -v, --variable=VALUE        variable
42
  -h, --help                 show this message and exit
43
</code></pre>
44
45
h2. Download from rdf url
46
47
The --file option allows the user to automatically parse an rdf response from the ESGFGateway, in order to find all downloadable online resources, HTTP or OpenDAP.
48
In the case of OpenDAP resources, the Client try to retrieve from the RDF file all the parameters needed for a query: a time start and a time stop (for temporal queries), a bounding box (for spatial queries) and the variable to query.
49
50
All these files are protected by OpenID, so the user has to give his credentials by specifying the "--openid" option an --password. If you don't have an OpenID account visit the page https://pcmdi9.llnl.gov/esgf-web-fe/createAccount. Conversely the security certificates are automatically downloaded by the WGET script.
51
52
Example:
53
<pre><code class="XML">
54
ESGFClient -f "http://sb-10-11-31-23.test.terradue.int/catalogue/cmip5rcp/zos/rdf?bbox=-111,42,-119,43&startTime=1962-10-01T12:00:00Z&stopTime=1963-01-01T12:00:00Z&startPage=0&count=3" -o "https://pcmdi9.llnl.gov/esgf-idp/openid/username" -p "password" -F
55
</code></pre>
56
57
In order to build these correct OpenDAP query, the input bounding box and the time search parameters are converted to a set of indexes needed to make a spatial and temporal query.
58
59
h2. Download user defined resources
60
61
The --url option is used to download a user defined resource, by specifying also the temporal coverage and spatial bounding box.
62
63
Example:
64
65
h3. HTTP resource:
66
67
<pre><code class="XML">
68
ESGFClient -u "http://bcccsm.cma.gov.cn/thredds/fileServer/cmip5_data/output/BCC/bcc-csm1-1/decadal2005/mon/ocean/zos/r1i1p1/zos_Omon_bcc-csm1-1_decadal2005_r1i1p1_200601-203512.nc" -o "https://pcmdi9.llnl.gov/esgf-idp/openid/username" -p "password"
69
</code></pre>
70
71
h3. OpenDAP resource:
72
73
<pre><code class="XML">
74
ESGFClient -u "http://bcccsm.cma.gov.cn/thredds/dodsC/cmip5.output1.BCC.bcc-csm1-1.decadal2005.mon.ocean.Omon.r1i1p1.zos.1.aggregation" --bbox "-111,42,-112,43" --dtstart "2006-02-16T12:00:00Z" --dtend "2006-05-16T12:00:00Z" --basetime "2006-01-16T12:00:00Z" -o "https://pcmdi9.llnl.gov/esgf-idp/openid/username" -p "password"
75
</code></pre>
76
The download is based on a revised wget script built upon a template called *wgetTemplate.sh*, filled with the URLs to be gotten.
77
78
Then the client run the WGET script, that saves the files into the file system.
79
80
The --Force option allows to specify if all the HTTP and OpenDAP online resources from the RDF should be download or simple the first.