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

Subversion URL: http://proj.badc.rl.ac.uk/svn/ndg/TI04-geosplat/trunk/gsc/scripts/exampleGSCLClient1.py@798
Revision 798, 1.6 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 readline
4from ZSI.client import Binding
5from clientConfig import SOAP_SERVER_PORT
6from common import *
7# start session
8print "Start session..."
9server = Binding(url="", host="localhost", port=SOAP_SERVER_PORT)
10
11(sessionID, secureToken)=server.startSession("jane", "jane1")
12print (sessionID, secureToken)
13
14print "\nProvide file URIs..."
15(optionCategories, options, \
16               optionStrings, secureToken)=server.provideFileURIs(sessionID, secureToken, ["/tmp/tmp.nc"])
17               
18print (optionCategories, options, optionStrings, secureToken)
19               
20
21print "\nSelecting variables from files..."           
22output=server.selectOptions(sessionID, [["secureToken", secureToken], ["fileVariable_1.1", "var1"]])
23output=deUnicodeObject(output)
24print output
25
26print "\nSelecting graphical outputs from options..."
27output=server.selectOptions(sessionID, [["secureToken", secureToken], ["graphicalOutputType", "2DPlot_1.1"]])
28output=deUnicodeObject(output)
29print output
30
31print "\nSelecting plot options..."
32output=server.selectOptions(sessionID, [["secureToken",secureToken], ["plotType", "boxfill"], ["fileFormat","gif"], \
33                                        ["projection", "standard"], ["imageSize", "800x600"], ["continentsSwitch","on"]])
34output=deUnicodeObject(output)
35print output
36
37print "\nCreating output..."
38output=server.createOutput(sessionID, secureToken)
39output=deUnicodeObject(output)
40print output
41
42import os
43
44from clientConfig import OUTPUT_DIR_LOCAL_PATH, OUTPUT_DIR_URL_PATH
45path=str(output[2]).replace(OUTPUT_DIR_URL_PATH, OUTPUT_DIR_LOCAL_PATH)
46print "LOOK at my file:", path
47os.system("gifview %s &" % path)
Note: See TracBrowser for help on using the repository browser.