本文整理汇总了Python中nco.Nco.ncra方法的典型用法代码示例。如果您正苦于以下问题:Python Nco.ncra方法的具体用法?Python Nco.ncra怎么用?Python Nco.ncra使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类nco.Nco
的用法示例。
在下文中一共展示了Nco.ncra方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: dailyAve
# 需要导入模块: from nco import Nco [as 别名]
# 或者: from nco.Nco import ncra [as 别名]
def dailyAve():
from nco import Nco
import datetime
nco = Nco()
for d in range(365):
dp = datetime.date(startY,1,1)+datetime.timedelta(d)
print "Averaging TRMM 3B42 for day "+dp.strftime('%j')+"..."
ifile = ' '.join("3B42_daily."+str(year)+"."+dp.strftime('%m')+"."+dp.strftime('%d')+".7.nc" for year in range(startY,endY))
ofile = "3B42_aver."+dp.strftime('%j')+".nc"
if not os.path.isfile(ofile):
nco.ncra(input=ifile, output=ofile)
nco.ncrcat(input="3B42_aver.*.nc", output="3B42_cat.nc", options="-d time,1,365")
nco.ncwa(input="3B42_cat.nc", output="3B42_MAP.nc", options='-N -a time')
return None
示例2: test_specifying_input_files
# 需要导入模块: from nco import Nco [as 别名]
# 或者: from nco.Nco import ncra [as 别名]
def test_specifying_input_files(testfiles8589):
"""
3.5 Specifying Input Files
ncra 85.nc 86.nc 87.nc 88.nc 89.nc 8589.nc
ncra 8[56789].nc 8589.nc
ncra -p input-path 85.nc 86.nc 87.nc 88.nc 89.nc 8589.nc
ncra -n 5,2,1 85.nc 8589.nc
"""
inputs = ['85.nc', '86.nc', '87.nc', '88.nc', '89.nc']
nco = Nco(debug=True)
nco.ncra(input=inputs, ouptut='8589.nc')
nco.ncra(input='8[56789].nc', ouptut='8589.nc')
srcdir = os.path.split(inputs[0])
nco.ncra(input=inputs, ouptut='8589.nc', path=srcdir)
nco.ncra(input=inputs, ouptut='8589.nc', nintap='5,2,1')
示例3: test_specifying_input_files
# 需要导入模块: from nco import Nco [as 别名]
# 或者: from nco.Nco import ncra [as 别名]
def test_specifying_input_files(testfiles8589):
"""
3.5 Specifying Input Files
ncra 85.nc 86.nc 87.nc 88.nc 89.nc 8589.nc
ncra 8[56789].nc 8589.nc
ncra -p input-path 85.nc 86.nc 87.nc 88.nc 89.nc 8589.nc
ncra -n 5,2,1 85.nc 8589.nc
"""
nco = Nco(debug=True)
nco.ncra(input=testfiles8589, output='8589.nc')
nco.ncra(input=testfiles8589, output='8589.nc', nintap='5,2,1')
srcdir = os.path.dirname(testfiles8589[0])
basenames = [ os.path.basename(x) for x in testfiles8589 ]
nco.ncra(input=basenames, output='8589.nc', path=srcdir)
regpath = os.path.join(srcdir, '8[56789].nc')
nco.ncra(input=regpath, output='8589.nc')
示例4: test_specifying_input_files
# 需要导入模块: from nco import Nco [as 别名]
# 或者: from nco.Nco import ncra [as 别名]
def test_specifying_input_files(testfiles8589):
"""
3.5 Specifying Input Files
ncra 85.nc 86.nc 87.nc 88.nc 89.nc 8589.nc
ncra 8[56789].nc 8589.nc
ncra -p input-path 85.nc 86.nc 87.nc 88.nc 89.nc 8589.nc
ncra -n 5,2,1 85.nc 8589.nc
"""
nco = Nco(debug=True)
nco.ncra(input=testfiles8589, output="8589.nc")
nco.ncra(input=testfiles8589, output="8589.nc", nintap="5,2,1")
srcdir = os.path.dirname(testfiles8589[0])
basenames = [os.path.basename(x) for x in testfiles8589]
nco.ncra(input=basenames, output="8589.nc", path=srcdir)
# unable to use brackets, perhaps because we're no longer using shell=True when calling subprocess()?
regpath = os.path.join(srcdir, "8[56789].nc")
nco.ncra(input=regpath, output="8589.nc", use_shell=True)
示例5: test_ncra_single_file
# 需要导入模块: from nco import Nco [as 别名]
# 或者: from nco.Nco import ncra [as 别名]
def test_ncra_single_file(foo_nc):
nco = Nco(debug=True)
infile = foo_nc
nco.ncra(input=infile, output="out.nc")
示例6: test_ncra_mult_files
# 需要导入模块: from nco import Nco [as 别名]
# 或者: from nco.Nco import ncra [as 别名]
def test_ncra_mult_files(foo_nc, bar_nc):
nco = Nco(debug=True)
infiles = [foo_nc, bar_nc]
nco.ncra(input=infiles, output="out.nc")