Пример #1
0
 def test_postproc_specmean():
     testdata = os.path.dirname(
         __file__) + "/test_data/ifsdata/6hr/ICMSHECE3+199001"
     if test_utils.is_lfs_ref(testdata):
         logging.info(
             "Skipping test_postproc_specmean, download test data from lfs first"
         )
         return
     abspath = test_utils.get_table_path()
     targets = cmor_target.create_targets(abspath, "CMIP6")
     source = cmor_source.ifs_source.create(130, 128)
     target = [
         t for t in targets if t.variable == "ta" and t.table == "Amon"
     ][0]
     task = cmor_task.cmor_task(source, target)
     postproc.mode = postproc.skip
     ifs2cmor.temp_dir_ = os.getcwd()
     ifs2cmor.ifs_spectral_file_ = testdata
     ifs2cmor.postprocess([task])
     path = os.path.join(os.getcwd(), "ta_Amon.nc")
     nose.tools.eq_(getattr(task, "path"), path)
     nose.tools.eq_(
         getattr(task, "cdo_command"),
         "-sp2gpl -monmean -sellevel,100000.,92500.,85000.,70000.,"
         "60000.,50000.,40000.,30000.,25000.,20000.,15000.,10000.,7000.,"
         "5000.,3000.,2000.,1000.,500.,100. "
         "-selzaxis,pressure -selcode,130")
Пример #2
0
 def test_postproc_specmean():
     testdata = os.path.dirname(__file__) + "/test_data/ifsdata/6hr/ICMSHECE3+199001"
     if test_utils.is_lfs_ref(testdata):
         logging.info("Skipping test_postproc_specmean, download test data from lfs first")
         return
     abspath = test_utils.get_table_path()
     targets = cmor_target.create_targets(abspath, "CMIP6")
     source = cmor_source.ifs_source.create(131, 128)
     target = [t for t in targets if t.variable == "ua" and t.table == "CFday"][0]
     task = cmor_task.cmor_task(source, target)
     setattr(task, "path", testdata)
     command = postproc.create_command(task)
     nose.tools.eq_(command.create_command(), "-sp2gpl -daymean -selzaxis,hybrid -selcode,131")