source: TI03-DataExtractor/trunk/dxc/scripts/exampleCLClient2.py @ 794

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI03-DataExtractor/trunk/dxc/scripts/exampleCLClient2.py@794
Revision 794, 1.6 KB checked in by astephen, 13 years ago (diff)

Unstable but latest version with multi-variable support and split hooks
for CDML and CSML.

  • Property svn:executable set to *
Line 
1#!/usr/bin/env python
2import sys
3sys.path=sys.path+["..","scripts","../..",".", "../../pydxc"]
4
5import readline
6from ZSI.client import Binding
7from pydxc.clientConfig import SOAP_SERVER_PORT
8from pydxc.common import *
9
10# start session
11server = Binding(url="", host="localhost", port=8406)
12sessionID, secureToken=server.startSession("jane", "jane1")
13server.getOptions(sessionID, secureToken)
14print "dsg"
15print server.selectOptions(sessionID, [["secureToken",secureToken], ["datasetGroup_1","Test Data Group 1"]])
16print "ds"
17print server.selectOptions(sessionID, [["secureToken",secureToken], ["dataset_1","Test Dataset 1"]])
18print "v"
19print server.selectOptions(sessionID, [["secureToken",secureToken], ["variable_1","pqn"]])
20print "horiz"
21print server.selectOptions(sessionID, [["secureToken",secureToken], ["horizontalDomain",(90,0,0,90)]])
22print "vert"
23print server.selectOptions(sessionID, [["secureToken",secureToken], ["verticalDomain_1",("Single level",)]])
24print "options"
25print server.getOptions(sessionID, secureToken)
26print "time" 
27print server.selectOptions(sessionID, [["secureToken",secureToken], ["temporalDomain_1",[[1999,1,1,0,0,0],[1999,1,1,0,0,0],[1., "hour"]]]])
28print "format"
29print server.selectOptions(sessionID, [["secureToken",secureToken], ["outputFormat", "NetCDF"]])
30print "complete"
31print server.isComplete(sessionID, secureToken)
32print "cost"
33print server.getExtractionCosts(sessionID, secureToken)
34print "output"
35x=server.createOutput(sessionID, secureToken)
36print x
37x=deUnicodeObject(x[0][0][0])
38print "Output file is:", x.replace(OUTPUT_DIR_URL_PATH, OUTPUT_DIR_LOCAL_PATH)
39
Note: See TracBrowser for help on using the repository browser.