source: TI04-geosplat/trunk/gsc/scripts/exampleGSCLClient3.py @ 798

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI04-geosplat/trunk/gsc/scripts/exampleGSCLClient3.py@798
Revision 798, 1.9 KB checked in by astephen, 14 years ago (diff)

Latest working version with install method.
Can accept more than one file but doesn't combine variables yet.

  • Property svn:executable set to *
Line 
1#!/usr/bin/env python
2
3import sys,os
4
5from ZSI.client import Binding
6from clientConfig import SOAP_SERVER_PORT
7from clientConfig import OUTPUT_DIR_LOCAL_PATH, OUTPUT_DIR_URL_PATH
8from common import *
9
10# start session
11print "THIS ONE SHOULD DO AN ANIMATION\n\n"
12
13print "Start session..."
14server = Binding(url="", host="localhost", port=SOAP_SERVER_PORT)
15
16(sessionID, secureToken)=server.startSession("jane", "jane1")
17print (sessionID, secureToken)
18
19print "\nProvide file URIs..."
20(optionCategories, options, \
21               optionStrings, secureToken)=server.provideFileURIs(sessionID, secureToken, ["/tmp/ani.nc"])
22               
23print (optionCategories, options, optionStrings, secureToken)
24               
25
26print "\nSelecting variables from files..."           
27output=server.selectOptions(sessionID, [["secureToken", secureToken], ["fileVariable_1.1", "pqn"]])
28output=deUnicodeObject(output)
29print output
30
31print "\nSelecting graphical outputs from options..."
32output=server.selectOptions(sessionID, [["secureToken", secureToken], ["graphicalOutputType", "Animation_1.1"]])
33output=deUnicodeObject(output)
34print output
35
36print "\nSelecting animation axes..."
37output=server.selectOptions(sessionID, [["secureToken", secureToken], ["axisLoopForAnimation", "time"], ["axisLoopForAnimation", "latitude"],
38                                        ["axisLoopForAnimation", "longitude"]])
39print output
40
41print "\nSelecting plot options..."
42output=server.selectOptions(sessionID, [["secureToken",secureToken], ["plotType", "boxfill"], ["fileFormat","gif"], \
43                                        ["projection", "standard"], ["imageSize", "800x600"], ["continentsSwitch","on"]])
44output=deUnicodeObject(output)
45print output
46
47print "\nCreating output..."
48output=server.createOutput(sessionID, secureToken)
49output=deUnicodeObject(output)
50
51print output
52
53path=str(output[2]).replace(OUTPUT_DIR_URL_PATH, OUTPUT_DIR_LOCAL_PATH)
54print "LOOK at my file:", path
55
56if os.path.isfile(path):
57    os.system("konqueror %s &" % path)
Note: See TracBrowser for help on using the repository browser.