本文整理匯總了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