本文整理汇总了Python中testing.regression.run函数的典型用法代码示例。如果您正苦于以下问题:Python run函数的具体用法?Python run怎么用?Python run使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了run函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。
示例1:
import vcs, numpy, cdms2, MV2, os, sys, 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:chaosphere2112,项目名称:uvcdat,代码行数:7,代码来源:test_vcs_1d_in_boxfill.py
示例2: f
import os, sys, MV2, cdms2, vcs, testing.regression as regression
x = regression.init()
f = cdms2.open(os.path.join(vcs.sample_data,"clt.nc"))
s = f("clt",slice(0,1),latitude=(30, 70),longitude=(-130, -60))
s2 = MV2.masked_greater(s, 65.)
x.plot(s2,"default","isofill",bg=1)
regression.run(x, "test_vcs_isofill_mask_cell_shift.png")
开发者ID:chaosphere2112,项目名称:uvcdat,代码行数:8,代码来源:test_vcs_isofill_mask_cell_shift.py
示例3:
import vcs,cdms2,os,sys,cdtime
import testing.regression as regression
f=cdms2.open(os.path.join(vcs.sample_data,"clt.nc"))
s=f("clt",squeeze=1)
x=regression.init()
x.plot(s,bg=1,time=cdtime.comptime(2015))
fnm = os.path.split(__file__)[1][:-3]+".png"
regression.run(x, fnm)
开发者ID:chaosphere2112,项目名称:uvcdat,代码行数:9,代码来源:test_vcs_user_passed_date.py
示例4: dataFile
import cdms2, os, sys, vcs, testing.regression as regression
# 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()
# Create and plot quick boxfill with default settings:
boxfill=canvas.createboxfill()
# Change the type
boxfill.boxfill_type = 'custom'
levels = range(20,81,10)
boxfill.levels=levels
boxfill.ext_1="y"
boxfill.fillareacolors=vcs.getcolors(boxfill.levels)
canvas.plot(clt, boxfill, bg=1)
# Load the image testing module:
regression.run(canvas, "test_boxfill_custom_ext1.png")
开发者ID:chaosphere2112,项目名称:uvcdat,代码行数:25,代码来源:test_vcs_boxfill_custom_ext1.py
示例5: f
import os, sys, cdms2, 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()
iso.projection = "mercator"
x.plot(s(latitude=(-90, 90)), iso, bg=1)
regression.run(x, "test_vcs_mercator_edge.png")
开发者ID:chaosphere2112,项目名称:uvcdat,代码行数:9,代码来源:test_vcs_mercator_edge.py
示例6:
import vcs, numpy, cdms2, MV2, os, sys, testing.regression as regression
x = regression.init()
x.drawlogooff()
x.setbgoutputdimensions(1200,1091,units="pixels")
txt=x.createtext()
txt.x = [.0000005,.00000005,.5,.99999,.999999]
txt.y=[0.05,.9,.5,.9,0.05]
txt.string = ["SAMPLE TEXT A","SAMPLE TEXT B","SAMPLE TEXT C","SAMPLE TEXT D","SAMPLE TEXT E"]
txt.halign = "center"
txt.valign="base"
txt.angle=45
x.plot(txt,bg=1)
regression.run(x, "test_basic_text.png", sys.argv[1])
开发者ID:chaosphere2112,项目名称:uvcdat,代码行数:13,代码来源:test_vcs_basic_text.py
示例7: cdmsfile
import os, sys, cdms2, cdutil, genutil, vcs, testing.regression as regression
# This tests if extending the longitude to more than 360 decrees is handled correctly by
# proj4. See https://github.com/UV-CDAT/uvcdat/issues/1728 for more information.
cdmsfile = cdms2.open(os.path.join(vcs.sample_data, "clt.nc"))
clt2 = cdmsfile('clt')
clt3 = clt2(latitude=(-90.0, 90.0),squeeze=1,longitude=(-180, 200.0),time=('1979-01', '1988-12'),)
canvas = vcs.init()
gmBoxfill = vcs.getboxfill('a_robinson_boxfill')
kwargs = {}
kwargs[ 'cdmsfile' ] = cdmsfile.id
kwargs['bg'] = 1
canvas.plot(clt3, gmBoxfill, **kwargs)
regression.run(canvas, "test_vcs_robinson_wrap.png")
开发者ID:chaosphere2112,项目名称:uvcdat,代码行数:14,代码来源:test_vcs_boxfill_robinson_wrap.py
示例8: range
import vcs, numpy, os, sys, cdms2, testing.regression as regression
x = regression.init()
f=cdms2.open(os.path.join(vcs.sample_data,"sampleCurveGrid4.nc"))
data=f("sample")
gm = x.createmeshfill()
gm.levels = range(0,1501,150)
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)
ret = regression.run(x, 'test_vcs_settings_color_name_rgba_meshfill.png')
开发者ID:chaosphere2112,项目名称:uvcdat,代码行数:11,代码来源:test_vcs_settings_color_name_rgba_meshfill.py
示例9:
grid_dest=dummy.getGrid()
s.id="orig"
s_regrid2 = s.regrid(grid_dest,regridTool="regrid2")
s_regrid2.id="regrid2"
s_esmf_lin = s.regrid(grid_dest)
s_esmf_lin.id = "ESMF Linear"
s_esmf_con = s.regrid(grid_dest,regridTool="esmf",regridMethod="conservative")
s_esmf_lin.id = "ESMF Conservative"
x=regression.init()
t=x.createtemplate()
t.blank()
t.data.priority=1
t.legend.priority=1
t.dataname.priority=1
t.dataname.y=t.dataname.y*.95
M=EzTemplate.Multi(template=t,x=x,rows=2,columns=2)
gm=x.createboxfill()
levels= vcs.mkscale(*vcs.minmax(s))
cols = vcs.getcolors(levels)
gm.boxfill_type = "custom"
gm.fillareacolors = cols
gm.levels = levels
x.plot(s,M.get(),gm,bg=1)
x.plot(s_regrid2,M.get(),gm,bg=1)
x.plot(s_esmf_lin,M.get(),gm,bg=1)
x.plot(s_esmf_con,M.get(),gm,bg=1)
ret = regression.run(x, "esmf_issue_1125.png", png)
开发者ID:UV-CDAT,项目名称:uvcdat,代码行数:29,代码来源:testEsmfRegridPeriodictyRegional.py
示例10:
import os, sys, cdms2, vcs, testing.regression as regression
x = regression.init()
x.backgroundcolor = (255, 255, 255)
x.open()
regression.run(x, "test_backgroundcolor_white.png")
开发者ID:chaosphere2112,项目名称:uvcdat,代码行数:6,代码来源:test_vcs_canvas_background.py
示例11: f
import vcs, cdms2, numpy, os, sys
import testing.regression as regression
x = regression.init()
f = cdms2.open(os.path.join(vcs.sample_data, "clt.nc"))
u = f("u")
v = f("v")
V = x.createvector()
p = x.createprojection()
p.type = "robinson"
V.projection = p
x.plot(u,v,V, bg=1)
regression.run(x, "test_vcs_vectors_robinson.png")
开发者ID:chaosphere2112,项目名称:uvcdat,代码行数:13,代码来源:test_vcs_vectors_robinson.py
示例12: dataFile
import cdms2, os, sys, vcs, testing.regression as regression
# 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()
# Create and plot quick boxfill with default settings:
boxfill=canvas.createboxfill()
# Change the type
boxfill.boxfill_type = 'custom'
levels = range(20,81,10)
boxfill.levels=levels
boxfill.fillareacolors=vcs.getcolors(levels)
canvas.plot(clt, boxfill, bg=1)
regression.run(canvas, "test_boxfill_custom_no_default_levels.png")
开发者ID:chaosphere2112,项目名称:uvcdat,代码行数:22,代码来源:test_vcs_boxfill_custom_non_default_levels.py
示例13:
import sys, os, vcs, MV2, testing.regression as regression
data = MV2.array([[-0.50428531,-0.8505522 ,],
[ 0.70056821,-0.27235352,],
[ 0.05106154, 0.23012322,],
[-0.26478429, 0.11950427,],
[ 0.85760801,-0.08336641,],
[ 1.14083397,-0.78326507,]])
x = regression.init()
td = x.createtaylordiagram('new')
td.quadrans = 2
x.plot(data, td, skill = td.defaultSkillFunction, bg=1)
regression.run(x, "test_vcs_taylor_2quads.png")
开发者ID:chaosphere2112,项目名称:uvcdat,代码行数:14,代码来源:test_vcs_taylor_2quads.py
示例14: dataFile
import os, sys, cdms2, vcs, testing.regression as regression
# 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)
regression.run(canvas, "test_matplotlib_colormap.png")
开发者ID:sampsonbryce,项目名称:uvcdat,代码行数:13,代码来源:test_vcs_matplotlib_colormap.py
示例15: float
import os, sys, cdms2, vcs, testing.regression as regression
baselineName = sys.argv[1]
centerlatitude = float(sys.argv[2])
f = cdms2.open(vcs.sample_data + "/clt.nc")
a = f("clt")
x = regression.init()
p = x.getprojection('orthographic')
p.centerlatitude = centerlatitude
b = x.createboxfill()
b.projection = p
x.plot(a(latitude=(90,-90)), b, bg=1)
fileName = os.path.basename(baselineName)
fileName = os.path.splitext(fileName)[0]
fileName += '.png'
regression.run(x, fileName)
开发者ID:chaosphere2112,项目名称:uvcdat,代码行数:21,代码来源:test_vcs_boxfill_orthographic.py
示例16: dataset
import os, sys, cdms2, vcs, testing.regression as regression
dataset = cdms2.open(os.path.join(vcs.sample_data,"clt.nc"))
data = dataset("clt")
canvas = regression.init()
isofill = canvas.createisofill()
canvas.plot(data, isofill, bg=1)
isoline = canvas.createisoline()
isoline.label="y"
texts=[]
colors = []
for i in range(10):
text = canvas.createtext()
text.color = 255 - 20 * i
text.height = 12
colors.append(60 + 5 * i)
if i%2 == 0:
texts.append(text.name)
else:
texts.append(text)
isoline.text = texts
isoline.linecolors = colors
# Plot the isolines with labels
canvas.plot(data, isoline, bg=1)
regression.run(canvas, "test_isofill_isoline_labels.png")
开发者ID:chaosphere2112,项目名称:uvcdat,代码行数:26,代码来源:test_vcs_isofill_isoline_labels.py
示例17:
import vcs, numpy, os, sys, testing.regression as regression
s = numpy.sin(numpy.arange(100))
s = numpy.reshape(s,(10,10))
s = numpy.ma.masked_greater(s,.5)
x = regression.init()
x.plot(s, bg=1)
regression.run(x, "test_vcs_boxfill_10x10_masked_numpy.png")
开发者ID:chaosphere2112,项目名称:uvcdat,代码行数:9,代码来源:test_vcs_boxfill_10x10_masked_numpy.py
示例18: f
xSize = 250
ySize = 500
else:
xSize = 800
ySize = 400
pth = os.path.join(os.path.dirname(__file__), "..")
sys.path.append(pth)
f = cdms2.open(vcs.sample_data + "/" + testConfig[plot][0])
s = f(testConfig[plot][1])
x = regression.init(bg=bg, geometry=(xSize, ySize))
# graphics method
if (plot.find('boxfill') != -1):
gm = x.getboxfill(plot)
elif (plot.find('meshfill') != -1):
gm = x.getmeshfill(plot)
elif (plot.find('isofill') != -1):
gm = x.getisofill(plot)
elif (plot.find('isoline') != -1):
gm = x.getisoline(plot)
else:
print "Invalid plot"
sys.exit(13)
x.setantialiasing(0)
x.drawlogooff()
x.plot(s, gm, ratio="autot")
name = "test_vcs_autot_axis_titles_" + plot[2:] + "_" + x_over_y + "_" + str(bg) + ".png"
regression.run(x, name, sys.argv[1])
开发者ID:chaosphere2112,项目名称:uvcdat,代码行数:30,代码来源:test_vcs_autot_axis_titles.py
示例19: range
import vcs, numpy, os, sys, cdms2, 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:chaosphere2112,项目名称:uvcdat,代码行数:11,代码来源:test_vcs_settings_color_name_rgba_isoline.py
示例20: dataset
import os, sys, cdms2, vcs, testing.regression as regression
dataset = cdms2.open(os.path.join(vcs.sample_data,"clt.nc"))
data = dataset("clt")
canvas = regression.init()
boxfill = canvas.createboxfill()
boxfill.color_1 = 242
boxfill.color_2 = 250
canvas.plot(data, boxfill, bg=1)
regression.run(canvas, "test_fewer_colors_than_levels.png")
开发者ID:chaosphere2112,项目名称:uvcdat,代码行数:15,代码来源:test_fewer_colors_than_levels.py
注:本文中的testing.regression.run函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论