• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python regression.init函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了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;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python regression.run函数代码示例发布时间:2022-05-27
下一篇:
Python mapscript.rectObj函数代码示例发布时间:2022-05-27
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap