当前位置: 首页>>代码示例>>Python>>正文


Python regression.init函数代码示例

本文整理汇总了Python中testing.regression.init函数的典型用法代码示例。如果您正苦于以下问题:Python init函数的具体用法?Python init怎么用?Python init使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了init函数的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: plot_a_ratio

def plot_a_ratio(s,gm,ratio):
    ret = 0
    x = regression.init()
    x.drawlogooff()
    x.open()
    x.geometry(400,800)
    y = regression.init()
    y.open()
    y.geometry(800,400)
    for X in [x,y]:
        X.plot(s,gm,ratio=ratio)
        if X.islandscape():
            orient = "ldscp"
        else:
            orient = "port"
        fnm = "aspect_ratio_%s_%s.png" % (orient,ratio)
        X.png(fnm)
        src = os.path.join(pth0,fnm)
        ret += regression.check_result_image(fnm, src)
    return ret
开发者ID:chaosphere2112,项目名称:uvcdat,代码行数:20,代码来源:test_vcs_aspect_ratio.py

示例2: f

import os, sys, vcs, cdms2, testing.regression as regression

f = cdms2.open(vcs.sample_data+"/clt.nc")
s = f("clt", time=slice(0, 1), squeeze=1)
x = regression.init()
iso = vcs.createisofill("isoleg")
iso.levels = [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100]
iso.fillareastyle = "pattern"
iso.fillareacolors = vcs.getcolors([0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100])
iso.fillareaindices = [1, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20]
x.plot(s, iso, bg=1)
fnm = "test_vcs_patterns.png"
regression.run(x, fnm, threshold=regression.defaultThreshold+5.)
开发者ID:chaosphere2112,项目名称:uvcdat,代码行数:13,代码来源:test_vcs_patterns.py

示例3: 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()

t1 = vcs.createtemplate()
t1.scale(.5, "y")
t1.move(-.15, "y")
t2 = vcs.createtemplate(source=t1.name)
t2.move(.5, 'y')

canvas.plot(clt, t1, continents=0, bg=True)
canvas.plot(clt, t2, continents=1, bg=True)

regression.run(canvas, "test_vcs_no_continents.png")
开发者ID:chaosphere2112,项目名称:uvcdat,代码行数:21,代码来源:test_vcs_no_continents.py

示例4: range

import cdms2
import os
import sys
import testing.regression as regression
import vcs

data = sys.argv[2]
level = sys.argv[3]
levels = {'0': range(-5,36,5),
          '1': [-1000, -15, 35],
          '2': [-300, -15, 0, 15, 25]}

x=regression.init(bg=1)
f=cdms2.open(data)
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:chaosphere2112,项目名称:uvcdat,代码行数:19,代码来源:test_vcs_isofill_levels.py

示例5: f

if (sys.argv[2] == 'foreground'):
    bg = 0
plot = sys.argv[3]
x_over_y = sys.argv[4]
if (x_over_y == '0.5'):
    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)
开发者ID:chaosphere2112,项目名称:uvcdat,代码行数:31,代码来源:test_vcs_autot_axis_titles.py

示例6:

import os, sys, cdms2, vcs, testing.regression as regression

testConfig = {'a_boxfill': ('clt.nc', 'clt', (200, 200)),
              'a_mollweide_boxfill': ('clt.nc', 'clt', (222, 322)),
              'a_isofill': ('clt.nc', 'clt', (200, 200)),
              'a_isoline': ('clt.nc', 'clt', (200, 200)),
              'vector_default': ('clt.nc', ('u', 'v'), (200, 200)),
              'a_meshfill': ('sampleCurveGrid4.nc', 'sample', (222, 322)),
              'a_robinson_meshfill': ('sampleCurveGrid4.nc', 'sample', (222, 322))}

# Tests if the info produced when clicking on a map is correct.
src = sys.argv[1]
plot = sys.argv[2]
x = regression.init(bg=False, geometry=(800, 600))

vector = False
# 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)
elif (plot.find('vector') != -1):
    gm = x.getvector(plot[plot.index('_') + 1:])
    vector = True
else:
    print "Invalid plot"
    sys.exit(13)
开发者ID:chaosphere2112,项目名称:uvcdat,代码行数:31,代码来源:test_vcs_click_info.py

示例7:

import os, sys, numpy, cdms2, MV2, vcs, testing.regression as regression

# We have to specify the geometry to make sure that the size of the canvas doesn't change between the init and the plot functions
x = regression.init(bg=True, geometry=(1200,1091))
text = x.createtext()
text.string = ["A very very very very long string", "A\nmult-line\nstring", "Short"]
# Use any value for initial; then we'll manually "right align" using the text extents
text.x = [.1]
text.y = [.1, .5, .9]

# This function only gets the extents for the *current* size
extents = x.gettextextent(text)
# Now we'll manually populate this with the desired values
text.x = []
for min_x, max_x, min_y, max_y in extents:
    w = max_x - min_x
    #h = max_y - min_y
    text.x.append(1 - w)

x.plot(text, bg=1)
regression.run(x, "test_textextents.png")
开发者ID:lee1043,项目名称:uvcdat,代码行数:21,代码来源:test_vcs_textextents.py

示例8: f

import vcs
import cdms2
import sys
import os
import testing.regression as regression


pth = os.path.join(os.path.dirname(__file__), "..")
sys.path.append(pth)

import checkimage

x = regression.init(bg=1, geometry=(1620, 1080))

f = cdms2.open(vcs.sample_data + "/clt.nc")
s = f('clt')
iso = x.createisoline()
iso.level=[5, 50, 70, 95]
iso.line = ['dot', 'dash', 'dash-dot', 'long-dash']
x.plot(s,iso,continents=0)
name = "test_vcs_line_patterns.png"
regression.run(x, name)
开发者ID:sampsonbryce,项目名称:uvcdat,代码行数:22,代码来源:test_vcs_line_patterns.py


注:本文中的testing.regression.init函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。