本文整理汇总了Python中cdo.Cdo.setCdo方法的典型用法代码示例。如果您正苦于以下问题:Python Cdo.setCdo方法的具体用法?Python Cdo.setCdo怎么用?Python Cdo.setCdo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cdo.Cdo
的用法示例。
在下文中一共展示了Cdo.setCdo方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_fillmiss
# 需要导入模块: from cdo import Cdo [as 别名]
# 或者: from cdo.Cdo import setCdo [as 别名]
def test_fillmiss(self):
cdo = Cdo()
if not SHOW:
return
if cdo.hasNetcdf:
if 'CDO' in os.environ:
cdo.setCdo(os.environ.get('CDO'))
cdo.debug = DEBUG
rand = cdo.setname('v',input = '-random,r25x25 ', options = ' -f nc')
missRange = '0.25,0.85'
withMissRange = tempfile.NamedTemporaryFile(delete=True,prefix='cdoPy').name
arOrg = cdo.copy(input = rand,returnMaArray = 'v')
arWmr = cdo.setrtomiss(missRange,input = rand,output = withMissRange,returnMaArray='v')
arFm = cdo.fillmiss( input = withMissRange,returnMaArray = 'v')
arFm1s= cdo.fillmiss2(2, input = withMissRange,returnMaArray = 'v')
if 'setmisstonn' in cdo.operators:
arM2NN= cdo.setmisstonn( input = withMissRange,returnMaArray = 'v')
pool = multiprocessing.Pool(8)
pool.apply_async(plot, (arOrg, ),{"title":'org' })#ofile='fmOrg')
pool.apply_async(plot, (arWmr, ),{"title":'missing' })#ofile='fmWmr')
pool.apply_async(plot, (arFm, ),{"title":'fillmiss' })#ofile= 'fmFm')
pool.apply_async(plot, (arFm1s,),{"title":'fillmiss2'})#ofile='fmFm2')
if 'setmisstonn' in cdo.operators:
pool.apply_async(plot, (arM2NN,), {"title":'setmisstonn'})#, ofile='fmsetMNN')
pool.close()
pool.join()
else:
print("test_fillmiss disables because of missing python-netCDF4")
示例2: testCDO
# 需要导入模块: from cdo import Cdo [as 别名]
# 或者: from cdo.Cdo import setCdo [as 别名]
def testCDO(self):
cdo = Cdo()
newCDO="/usr/bin/cdo"
if os.path.isfile(newCDO):
cdo.setCdo(newCDO)
self.assertEqual(newCDO,cdo.getCdo())
cdo.setCdo('cdo')