本文整理汇总了Python中cdo.Cdo.sellonlatbox方法的典型用法代码示例。如果您正苦于以下问题:Python Cdo.sellonlatbox方法的具体用法?Python Cdo.sellonlatbox怎么用?Python Cdo.sellonlatbox使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cdo.Cdo
的用法示例。
在下文中一共展示了Cdo.sellonlatbox方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_phc
# 需要导入模块: from cdo import Cdo [as 别名]
# 或者: from cdo.Cdo import sellonlatbox [as 别名]
def test_phc(self):
ifile = "-select,level=0 " + DATA_DIR + '/icon/phc.nc'
cdo = Cdo()
cdo.debug = DEBUG
if not cdo.hasNetcdf:
return
#cdo.merge(input='/home/ram/data/icon/input/phc3.0/PHC__3.0__TempO__1x1__annual.nc /home/ram/data/icon/input/phc3.0/PHC__3.0__SO__1x1__annual.nc',
# output=ifile,
# options='-O')
s = cdo.sellonlatbox(0,30,0,90, input="-chname,SO,s,TempO,t " + ifile,output='test_my_phc.nc',returnMaArray='s',options='-f nc')
plot(np.flipud(s[0,:,:]),ofile='org',title='original')
sfmo = cdo.sellonlatbox(0,30,0,90, input="-fillmiss -chname,SO,s,TempO,t " + ifile,returnMaArray='s',options='-f nc')
plot(np.flipud(sfmo[0,:,:]),ofile='fm',title='fillmiss')
sfm = cdo.sellonlatbox(0,30,0,90, input="-fillmiss2 -chname,SO,s,TempO,t " + ifile,returnMaArray='s',options='-f nc')
plot(np.flipud(sfm[0,:,:]),ofile='fm2',title='fillmiss2')
ssetmisstonn = cdo.sellonlatbox(0,30,0,90, input="-setmisstonn -chname,SO,s,TempO,t " + ifile,returnMaArray='s',options='-f nc')
plot(np.flipud(ssetmisstonn[0,:,:]),ofile='setmisstonn',title='setmisstonn')
if (parse_version(cdo.version()) >= parse_version('1.7.2')):
smooth = cdo.sellonlatbox(0,30,0,90, input="-smooth -chname,SO,s,TempO,t " + ifile,returnMaArray='s',options='-f nc')
plot(np.flipud(ssetmisstonn[0,:,:]),ofile='smooth',title='smooth')
示例2: subset
# 需要导入模块: from cdo import Cdo [as 别名]
# 或者: from cdo.Cdo import sellonlatbox [as 别名]
def subset(resource=[], bbox='-80,50,22.5,70'):
"""
returns a subset
:param resource: netCDF input files of one dataset
:param bbox: bounding box
"""
from tempfile import mkstemp
from cdo import Cdo
cdo = Cdo()
resource.sort()
ip, nc_concat = mkstemp(dir='.',suffix='.nc')
nc_concat = cdo.cat(input=resource, output=nc_concat)
ip, nc_subset = mkstemp(dir='.',suffix='.nc')
nc_subset = cdo.sellonlatbox('%s' % bbox, input=nc_concat, output=nc_subset)
logger.info('subset done: %s ' % nc_subset)
return nc_subset