本文整理汇总了Python中vcs.testing.regression.run函数的典型用法代码示例。如果您正苦于以下问题:Python run函数的具体用法?Python run怎么用?Python run使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了run函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: range
'w20', 'w21', 'w22', 'w23', 'w24', 'w25', 'w26', 'w27', 'w28', 'w29',
'w30', 'w31', 'w32', 'w33', 'w34', 'w35', 'w36', 'w37', 'w38', 'w39',
'w40', 'w41', 'w42', 'w43', 'w44', 'w45', 'w46', 'w47', 'w48', 'w49',
'w50', 'w51', 'w52', 'w53', 'w54', 'w55', 'w56', 'w57', 'w58', 'w59',
'w60', 'w61', 'w62', 'w63', 'w64', 'w65', 'w66', 'w67', 'w68', 'w69',
'w70', 'w71', 'w72', 'w73', 'w74', 'w75', 'w76', 'w77', 'w78', 'w79',
'w80', 'w81', 'w82', 'w83', 'w84', 'w85', 'w86', 'w87', 'w88', 'w89',
'w90', 'w91', 'w92', 'w93', 'w94', 'w95', 'w96', 'w97', 'w98', 'w99',
'w100', 'w101', 'w102']
x = regression.init()
m = x.createmarker()
M=7
m.worldcoordinate=[0,M,0,M]
m.type = wmo
m.color=[242,]
m.size=[10.,]
xs = []
ys=[]
for Y in range(7):
for X in range(15):
ys.append([M-M*(Y+1)/8.,])
xs.append([M*(X+1)/16.,])
m.x = xs
m.y = ys
m.list()
x.plot(m, bg=1)
regression.run(x, "wmo_markers.png");
示例2: range
for i in range(12):
cont_index = i % 6 + 1
cont_line = vcs.createline()
cont_line.width = i % 3 + 1
cont_line.type = line_styles[i % 5]
print "Cont_line_rtype:",line_styles[i % 5]
cont_line.color = i + 200
template = multitemplate.get(i)
if cont_index != 3 and i != 4 and i != 11:
canvas.plot(clt, template, boxfill, continents=cont_index, continents_line=cont_line, bg=1)
elif cont_index == 3:
canvas.setcontinentsline(cont_line)
canvas.setcontinentstype(3)
canvas.plot(clt, template, boxfill, bg=1)
elif i == 4:
canvas.setcontinentstype(0)
# Make sure absolute path works
path = os.path.join(vcs.prefix, "share", "vcs", "data_continent_political")
canvas.plot(clt, template, boxfill, continents=path, continents_line=cont_line, bg=1)
elif i == 11:
# Make sure the dotdirectory other* works
dotdir = vcs.getdotdirectory()
current_dotdir = os.environ.get(dotdir[1], dotdir[0])
os.environ["UVCDAT_DIR"] = os.path.join(vcs.prefix, "share", "vcs")
# Should pick up the other7 continents
canvas.plot(clt, template, boxfill, continents=7, continents_line=cont_line, bg=1)
os.environ["UVCDAT_DIR"] = current_dotdir
regression.run(canvas, "test_continents.png")
示例3:
import os, sys, numpy, cdms2, MV2, vcs, vcs.testing.regression as regression
x = regression.init()
t = cdms2.createAxis(numpy.arange(120))
t.designateTime()
t.id = "time"
t.units = "months since 2014"
data = MV2.arange(120,0,-1)
data.id = "data"
data.setAxis(0,t)
x = regression.init()
x.plot(data,bg=1)
fnm = 'test_vcs_monotonic_decreasing_yxvsx_default.png'
regression.run(x, fnm)
示例4: dataset
import os, sys, cdms2, vcs, vcs.testing.regression as regression
dataset = cdms2.open(os.path.join(vcs.sample_data, "clt.nc"))
data = dataset("clt")
canvas = regression.init()
isoline = canvas.createisoline()
isoline.label = "y"
isoline.labelskipdistance = 15.0
texts = []
colors = []
for i in range(10):
text = canvas.createtext()
text.color = 20 * i
text.height = 12
colors.append(255 - text.color)
if i % 2 == 0:
texts.append(text.name)
else:
texts.append(text)
isoline.text = texts
isoline.linecolors = colors
# Next plot the isolines with labels
canvas.plot(data, isoline, bg=1)
regression.run(canvas, "test_vcs_isoline_labelskipdistance.png")
示例5: f
import os, sys, cdms2, vcs, vcs.testing.regression as regression
f = cdms2.open(os.path.join(vcs.sample_data, "clt.nc"))
s = f("clt")
x = regression.init()
iso = x.createisofill()
p = x.createprojection()
p.type = "lambert"
iso.projection = p
x.plot(s(latitude=(20, 60), longitude=(-140, -20)), iso, bg=True)
regression.run(x, "test_vcs_lambert.png")
示例6:
import vcs, numpy, cdms2, MV2, os, sys, vcs.testing.regression as regression
x = regression.init()
f=cdms2.open(os.path.join(vcs.sample_data,"ta_ncep_87-6-88-4.nc"))
vr = "ta"
s=f(vr,slice(0,1),longitude=slice(90,91),squeeze=1)
x.plot(s,bg=1)
regression.run(x, 'test_vcs_flipY.png')
示例7: f
import os, sys, numpy, cdms2, MV2, vcs, vcs.testing.regression as regression
x = regression.init()
f = cdms2.open(os.path.join(vcs.sample_data, "clt.nc"))
s = f("clt")
box = x.createboxfill()
# Should ignore the string here
box.xmtics1 = {i:"Test" for i in range(-180, 180, 15) if i % 30 != 0}
box.ymtics1 = {i:"Test" for i in range(-90, 90, 5) if i % 10 != 0}
box.xmtics2 = "lon15"
box.ymtics2 = "lat5"
template = x.createtemplate()
template.xmintic1.priority = 1
template.ymintic1.priority = 1
template.xmintic2.priority = 1
template.xmintic2.y2 += template.xmintic1.y1 - template.xmintic1.y2
template.ymintic2.priority = 1
x.plot(s, template, box, bg=1)
regression.run(x, "test_vcs_mintics.png")
示例8: range
import cdms2
import os
import sys
import vcs.testing.regression as regression
import vcs
import numpy
data = sys.argv[2]
level = sys.argv[3]
levels = {'0': range(-5,36,5),
'1': [-1000, -15, 35],
'2': [-300, -15, 0, 15, 25],
'3': range(190, 320, 10)}
x=regression.init(bg=1)
f=cdms2.open(data)
if (level == '3'):
s=f("test")
else:
s=f("sst")
iso=x.createisofill()
iso.levels=levels[level]
x.plot(s,iso)
regression.run(x, "test_vcs_isofill_level%s.png"%level)
示例9:
import os, sys, cdms2, vcs, vcs.testing.regression as regression
x = regression.init()
x.backgroundcolor = (255, 255, 255)
x.open()
regression.run(x, "test_backgroundcolor_white.png")
示例10:
import vcs, numpy, cdms2, MV2, os, sys, vcs.testing.regression as regression
x = regression.init()
d = numpy.sin(numpy.arange(100))
b = x.createboxfill()
x.plot(d,b,bg=1)
regression.run(x, "test_1d_in_boxfill.png", sys.argv[1])
示例11: range
import vcs, numpy, os, sys, cdms2, vcs.testing.regression as regression
x=regression.init()
f=cdms2.open(os.path.join(vcs.sample_data,"clt.nc"))
data=f("clt",slice(0,1,))
gm = x.createisoline()
gm.levels = range(0,110,10)
gm.linecolors = ["green","red","blue","bisque","yellow","grey",
[100,0,0,50], [0,100,0],"salmon",[0,0,100,75]]
x.plot(data,gm,bg=True)
regression.run(x, 'test_vcs_settings_color_name_rgba_isoline.png')
示例12: range
import vcs, numpy, os, sys, cdms2, vcs.testing.regression as regression
x = regression.init()
f=cdms2.open(os.path.join(vcs.sample_data,"clt.nc"))
data=f("clt",slice(0,1,))
gm = x.createboxfill()
gm.boxfill_type = "custom"
gm.levels = range(0,110,10)
gm.fillareacolors = ["green","red","blue","bisque","yellow","grey",
[100,0,0,50], [0,100,0],"salmon",[0,0,100,75]]
x.plot(data,gm,bg=True)
regression.run(x, 'test_vcs_settings_color_name_rgba_boxfill.png')
示例13:
import vcs,numpy,cdms2,MV2,os,sys
import vcs.testing.regression as regression
x = regression.init()
m = x.createmarker()
M=1
m.worldcoordinate=[0,M,0,M]
m.type = "w07"
m.color=[242,]
m.size=[1.,2.,5.]
m.x = [[.25,],[.5,],[.75]]
m.y = [.5,]
x.plot(m,bg=1)
fnm = 'wmo_marker.png'
x.png(fnm)
regression.run(x, "wmo_marker.png")
示例14: range
isoline = canvas.createisoline()
isoline.label = "y"
texts = []
colors = []
bcolors = []
bopacities = []
for i in range(10):
text = canvas.createtext()
random.seed(i*200)
text.color = random.randint(1, 255)
text.height = 12
random.jumpahead(i * 100)
colors.append(random.randint(1, 255))
random.jumpahead(i * 20)
bcolors.append(random.randint(1, 255))
bopacities.append(random.randint(0, 100))
if i % 2 == 0:
texts.append(text.name)
else:
texts.append(text)
isoline.text = texts
isoline.labelbackgroundcolors = bcolors
isoline.labelbackgroundopacities = bopacities
isoline.labelskipdistance = 15.0
# First test using isoline.text[...].color
canvas.plot(data, isoline, bg=1)
baseline = os.path.splitext(sys.argv[1])
baselineImage = "%s%s" % baseline
regression.run(canvas, baselineImage)
示例15: cdmsfile
import cdms2, os, sys, vcs, vcs.testing.regression as regression
cdmsfile = cdms2.open(os.path.join(vcs.sample_data,"clt.nc"))
data = cdmsfile('clt')
x = regression.init()
t=x.gettemplate('default')
x.plot(data, t, bg=True)
# This should force the image to update
x.setcolormap('blue2darkorange')
regression.run(x, "test_vcs_setcolormap.png")