Beispiel #1
0
import vcs,os,filecmp
import vcs,numpy,os,sys
src=sys.argv[1]
if os.path.exists("test_vcs_dump_json.json"):
    os.remove("test_vcs_dump_json.json")

b = vcs.createboxfill("Charles.Doutriaux")
b.script("test_vcs_dump_json","a")
b = vcs.createisofill("Charles.Doutriaux")
b.script("test_vcs_dump_json","a")
b = vcs.createisoline("Charles.Doutriaux")
b.script("test_vcs_dump_json","a")
b = vcs.createmeshfill("Charles.Doutriaux")
b.script("test_vcs_dump_json","a")
b = vcs.createoneD("Charles.Doutriaux")
b.script("test_vcs_dump_json","a")
b = vcs.createfillarea("Charles.Doutriaux")
b.script("test_vcs_dump_json","a")
b = vcs.createtext("Charles.Doutriaux")
b.script("test_vcs_dump_json","a")
b = vcs.createline("Charles.Doutriaux")
b.script("test_vcs_dump_json","a")
b = vcs.createmarker("Charles.Doutriaux")
b.script("test_vcs_dump_json","a")
b = vcs.createtemplate("Charles.Doutriaux")
b.script("test_vcs_dump_json","a")
b = vcs.createprojection("Charles.Doutriaux")
b.script("test_vcs_dump_json","a")

assert(filecmp.cmp("test_vcs_dump_json.json",src))
lat2=80
lon1=0
lon2=360

# Wind speed ---
data['wnd'] = MV.sqrt(data['ua']**2+data['va']**2)
iso = canvas.createisofill()
iso.datawc_x1 = lon1
iso.datawc_x2 = lon2
iso.datawc_y1 = lat1
iso.datawc_y2 = lat2
canvas.setcolormap('blue_to_orange')
canvas.plot(data['wnd'],iso,template)

# Geopotential height field ---
lines1 = vcs.createisoline()
lines1.datawc_x1 = lon1
lines1.datawc_x2 = lon2
lines1.datawc_y1 = lat1
lines1.datawc_y2 = lat2
lines1.linecolors = ['black']
lines1.line=['solid']
lines1.label = 'y'
lines1.textcolors=['black']
canvas.plot(data['zg'],lines1,template)

# T field ---
lines2 = vcs.createisoline()
lines2.datawc_x1 = lon1
lines2.datawc_x2 = lon2
lines2.datawc_y1 = lat1
Beispiel #3
0
cl2_djfclimatology.id=''
x.drawlogooff()
bg=False
M=EzTemplate.Multi(rows=2,columns=1)
M.legend.direction='horizontal'
#M.legend.direction='horizontal'
M.margins.left=.07
M.margins.right=.07
M.margins.bottom=.1
M.margins.top=.08
M.legend.thickness=.3
M.spacing.vertical=.1
M.legend.fat=.09
x.setcolormap('bl_to_darkred')
t=M.get(legend='local')
lines=vcs.createisoline()
header=x.createtext()
header.To.height=24
header.To.halign="center"
header.To.valign="top"
header.x=.5
header.y=.98
header.string=plot_title
x.plot(header,bg=1)
iso.yticlabels1={100000:"1000",90000:"900",80000:"800",70000:"700",60000:"600",50000:"500",40000:"400",30000:"300",20000:"200",10000:"100"}

x.plot(cl_djfclimatology,t, iso)
lines.yticlabels1={100000:"1000",90000:"900",80000:"800",70000:"700",60000:"600",50000:"500",40000:"400",30000:"300",20000:"200",10000:"100"}
lines.levels=levs
x.plot(cl_djfclimatology,t,lines)
import sys,os
import vcs
import sys
import cdms2
import vtk
import os
import MV2
bg = not False
x=vcs.init()

x.setcolormap("rainbow")
gm = vcs.createisoline()

p = vcs.createprojection()
ptype = 'aeqd'
p.type = ptype
gm.projection = p

xtra = {}
f=cdms2.open(os.path.join(vcs.prefix,'sample_data','clt.nc'))
s=f("clt",**xtra)
s=MV2.masked_greater(s,78.)
x.plot(s,gm,bg=bg)




x.png('test_vcs_basic_isoline_masked_aeqd_proj.png')
import filecmp
import vcs,numpy,os,sys
src = sys.argv[1]
if os.path.exists("test_vcs_dump_json.json"):
    os.remove("test_vcs_dump_json.json")

b = vcs.createboxfill("vcs_instance")
b.script("test_vcs_dump_json","a")
b = vcs.createisofill("vcs_instance")
b.script("test_vcs_dump_json","a")
b = vcs.createisoline("vcs_instance")
b.script("test_vcs_dump_json","a")
b = vcs.createmeshfill("vcs_instance")
b.script("test_vcs_dump_json","a")
b = vcs.create1d("vcs_instance")
b.script("test_vcs_dump_json","a")
b = vcs.createfillarea("vcs_instance")
b.script("test_vcs_dump_json","a")
b = vcs.createvector("vcs_instance")
b.script("test_vcs_dump_json","a")
b = vcs.createtext("vcs_instance")
b.script("test_vcs_dump_json","a")
b = vcs.createline("vcs_instance")
b.script("test_vcs_dump_json","a")
b = vcs.createmarker("vcs_instance")
b.script("test_vcs_dump_json","a")
b = vcs.createtemplate("vcs_instance")
b.script("test_vcs_dump_json","a")
b = vcs.createprojection("vcs_instance")
b.script("test_vcs_dump_json","a")