本文整理汇总了Python中vcs.testing.regression.run函数的典型用法代码示例。如果您正苦于以下问题:Python run函数的具体用法?Python run怎么用?Python run使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了run函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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");
开发者ID:UV-CDAT,项目名称:uvcdat,代码行数:29,代码来源:test_vcs_wmo_markers.py
示例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")
开发者ID:UV-CDAT,项目名称:uvcdat,代码行数:29,代码来源:test_vcs_continents.py
示例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)
开发者ID:UV-CDAT,项目名称:uvcdat,代码行数:14,代码来源:test_vcs_monotonic_decreasing_yxvsx_default.py
示例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")
开发者ID:UV-CDAT,项目名称:uvcdat,代码行数:26,代码来源:test_vcs_isoline_labelskipdistance.py
示例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")
开发者ID:sankhesh,项目名称:uvcdat,代码行数:11,代码来源:test_vcs_lambert.py
示例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')
开发者ID:UV-CDAT,项目名称:uvcdat,代码行数:8,代码来源:test_vcs_flipY.py
示例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")
开发者ID:UV-CDAT,项目名称:uvcdat,代码行数:20,代码来源:test_vcs_mintics.py
示例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)
开发者ID:UV-CDAT,项目名称:uvcdat,代码行数:24,代码来源:test_vcs_isofill_levels.py
示例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")
开发者ID:sankhesh,项目名称:uvcdat,代码行数:6,代码来源:test_vcs_canvas_background.py
示例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])
开发者ID:sankhesh,项目名称:uvcdat,代码行数:7,代码来源:test_vcs_1d_in_boxfill.py
示例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')
开发者ID:UV-CDAT,项目名称:uvcdat,代码行数:11,代码来源:test_vcs_settings_color_name_rgba_isoline.py
示例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')
开发者ID:UV-CDAT,项目名称:uvcdat,代码行数:12,代码来源:test_vcs_settings_color_name_rgba_boxfill.py
示例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")
开发者ID:UV-CDAT,项目名称:uvcdat,代码行数:20,代码来源:test_vcs_wmo_marker.py
示例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)
开发者ID:UV-CDAT,项目名称:uvcdat,代码行数:30,代码来源:test_vcs_isoline_labels_background.py
示例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")
开发者ID:UV-CDAT,项目名称:uvcdat,代码行数:11,代码来源:test_vcs_setcolormap.py
示例16:
0.059503571833625334
0.059503571833625334 0.05664014775641405 0.05193557222118004
0.04777129850801233 0.0407139313814465 0.029382624830271705
0.018469399844287374 0.0162382275289592 0.02646680241827459
0.04792041732949079 0.0689138797030203 0.08167038620212037
0.09273558459066569 0.11266293431057901 0.13663018925347364
0.15229174546388072 0.15284435880966177 0.13423845476113883
0.09945904378274077 0.07032267160267985 0.05551039827020481
0.045537187647785464 0.040532491867244946 0.03577527125478327
-999. -999. -999.
-0.058062458673116 -0.08764922509099882 -0.11697036914487152
-0.14836133615864944 -0.17956528904564023 -0.21109198032585794
-0.23846429237248942 -0.2598536549218765 -0.27795672866320387
-0.2939939095159731 -0.30541031366330024 -0.307643559333884
-0.30078421139811795 -0.2841339526883441 -0.26485737397202497
-0.24287299694779327 -0.22379014890999907 -0.20121548204699846
-0.1746486732156772 -0.14585019344118372 -0.12070675757803526
-0.0997891159111037 -0.08229393660994214 -0.06779720501287469
-0.057213385470859794 -0.04875768191096844 -0.0402377347189964
-0.030169328367807245 -0.017560662894847895 -0.006968922654137132
0.0009773980274431048 0.007054306637034288 0.010472286514133042
0.010702384151997032 0.009231553701801242 0.007544033101056543
0.004639797857203645 -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999.
-999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999. -999.
-999. -999. -999.
""".split()
data = numpy.array(data, dtype=numpy.float)
data = MV2.masked_less(data, -900)
x.plot(data, yx, bg=1)
regression.run(x, "test_vcs_1D_datawc_missing.png")
开发者ID:sankhesh,项目名称:uvcdat,代码行数:30,代码来源:test_vcs_1D_datawc_missing.py
示例17: 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",slice(0,1),squeeze=1)
x = regression.init()
gm = x.createboxfill()
gm.boxfill_type = "custom"
gm.levels = [1.e20,1.e20]
gm.ext_1 = "y"
gm.ext_2 = "y"
x.plot(s, gm, bg=1)
fnm = os.path.split(__file__)[1][:-3] + ".png"
regression.run(x, fnm, sys.argv[1])
开发者ID:UV-CDAT,项目名称:uvcdat,代码行数:13,代码来源:test_vcs_box_custom_as_def_vistrails_exts.py
示例18: f
elif args.src == "canvas":
## Still setting vcs to make sure it is not used
vcs._colorMap = "blue2green"
x.setcolormap("blue2grey")
else:
## Still setting vcs and canvas to make sure it is not used
vcs._colorMap = "blue2green"
x.setcolormap("blue2grey")
gm.colormap = "blue2orange"
if args.gm != "meshfill":
f=cdms2.open(os.path.join(vcs.sample_data,"clt.nc"))
if args.gm == "vector":
u = f("u")[...,::2,::2]
v = f("v")[...,::2,::2]
gm.scale = 8.
else:
s=f("clt",slice(0,1))
else:
f=cdms2.open(os.path.join(vcs.sample_data,'sampleCurveGrid4.nc'))
s=f("sample")
if args.gm == "vector":
x.plot(u,v,gm,bg=True)
else:
x.plot(s,gm,bg=True)
fnm = "test_vcs_colormaps_source_%s_%s.png" % (args.gm,args.src)
x.png(fnm)
baselineImage = args.baseline
ret = regression.run(x, fnm, baselineImage)
开发者ID:UV-CDAT,项目名称:uvcdat,代码行数:30,代码来源:test_vcs_colormaps_source.py
示例19:
# Create the fill area and the text annotations
fill_test = x.createfillarea('fill_hatches_patterns')
fill_test.style = style_list
fill_test.index = index_list
fill_test.color = color_list
fill_test.x = x_list
fill_test.y = y_list
fill_test.pixelspacing = [15, 15]
fill_test.pixelscale = 15.0
fill_info = x.createtext('fill_info')
fill_info.angle = 45
fill_info.height = 12
fill_info.color = 241 # Black
fill_info.string = txt_str_list
fill_info.x = txt_x_list
fill_info.y = txt_y_list
# Create a title
plot_title = x.createtext('plot_title')
plot_title.height = 40
plot_title.string = ['Testing hatches and patterns in VCS/CDAT']
plot_title.x = [.01]
plot_title.y = [.9]
# Initialize and use a second graphics canvas
x.plot(plot_title, bg=1)
x.plot(fill_test, bg=1)
x.plot(fill_info, bg=1)
regression.run(x, "test_vcs_hatches_patterns.png")
开发者ID:UV-CDAT,项目名称:uvcdat,代码行数:30,代码来源:test_vcs_hatches_patterns.py
示例20: int
import os, sys, cdms2, vcs, vcs.testing.regression as regression
import matplotlib
sp = matplotlib.__version__.split(".")
if int(sp[0])*10+int(sp[1])<15:
# This only works with matplotlib 1.5 and greater
sys.exit()
# Load the clt data:
dataFile = cdms2.open(os.path.join(vcs.sample_data, "clt.nc"))
clt = dataFile("clt")
clt = clt(latitude=(-90.0, 90.0), longitude=(-180., 175.), squeeze=1,
time=('1979-1-1 0:0:0.0', '1988-12-1 0:0:0.0'))
# Initialize canvas:
canvas = regression.init()
canvas.setcolormap(vcs.matplotlib2vcs("viridis"))
canvas.plot(clt, bg=1)
fnm = os.path.split(__file__)[1][:-3] + ".png"
regression.run(canvas, fnm)
开发者ID:UV-CDAT,项目名称:uvcdat,代码行数:19,代码来源:test_vcs_matplotlib_colormap.py
注:本文中的vcs.testing.regression.run函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论