...
You need to download ecmwf-api-client-perl.tgz, extract its content and to a directory pointed by the environment variable PERL5LIB
. This code relies on the JSON perl module, as well as libwww-perl and Crypt::SSLeay.
Java
You need to download ecmwf-api-client-java.tgz. You will also need the Java JSON package.
Installing your API key
Note |
---|
The keys from the old data server are not valid for this new service. |
...
Code Block | ||||
---|---|---|---|---|
| ||||
#!/usr/bin/env perl
use ECMWF::DataServer;
my $server = ECMWF::DataServer->new();
$server.retrieve({
'dataset' : "tigge",
'step' : "24/to/120/by/24",
'number' : "all",
'levtype' : "sl",
'date' : "20071001/to/20071003",
'time' : "00/12",
'origin' : "all",
'type' : "pf",
'param' : "tp",
'area' : "70/-130/30/-60",
'grid' : "2/2",
'target' : "data.grib"
}) |
Java
Code Block | ||
---|---|---|
| ||
import org.ecmwf.DataServer; import org.json.JSONObject; public class DataServerExample { public static void main(String[] args) throws Exception { DataServer x = new DataServer(); JSONObject req = new JSONObject(); req.put("dataset" , "tigge"); req.put("step" , "24/to/120/by/24"); req.put("number" , "all"); req.put("levtype" , "sl"); req.put("date" , "20071001/to/20071003"); req.put("time" , "00/12"); req.put("origin" , "all"); req.put("type" , "pf"); req.put("param" , "tp"); req.put("area" , "70/-130/30/-60"); req.put("grid" , "2/2"); req.put("target" , "data.grib"); x.retrieve(req); } } |
Choosing a dataset
The "dataset
" parameter is one of:
...