Пример #1
0
 def test_init_nemo2cmor(self):
     tab_dir = init_cmor()
     nemo2cmor.initialize(self.data_dir, "expn",
                          os.path.join(tab_dir, "CMIP6"),
                          datetime.datetime(1990, 3, 1))
     nemo2cmor.finalize()
     cmor.close()
Пример #2
0
 def test_init_nemo2cmor(self):
     tab_dir = get_table_path()
     conf_path = os.path.join(os.path.dirname(nemo2cmor.__file__), "resources", "metadata-template.json")
     cmor.setup(tab_dir)
     cmor.dataset_json(conf_path)
     nemo2cmor.initialize(self.data_dir, "exp", os.path.join(tab_dir, "CMIP6"), datetime.datetime(1990, 3, 1),
                          datetime.timedelta(days=100))
     nemo2cmor.finalize()
     cmor.close()
Пример #3
0
 def test_init_nemo2cmor(self):
     tab_dir = get_table_path()
     conf_path = ece2cmorlib.conf_path_default
     cmor.setup(tab_dir)
     cmor.dataset_json(conf_path)
     cmor.set_cur_dataset_attribute("calendar", "proleptic_gregorian")
     nemo2cmor.initialize(self.data_dir, "exp",
                          os.path.join(tab_dir, "CMIP6"),
                          datetime.datetime(1990, 3, 1))
     nemo2cmor.finalize()
     cmor.close()
Пример #4
0
 def test_cmor_single_task3d(self):
     tab_dir = get_table_path()
     conf_path = os.path.join(os.path.dirname(nemo2cmor.__file__), "resources", "metadata-template.json")
     cmor.setup(tab_dir)
     cmor.dataset_json(conf_path)
     nemo2cmor.initialize(self.data_dir, "exp", os.path.join(tab_dir, "CMIP6"), datetime.datetime(1990, 3, 1),
                          datetime.timedelta(days=365))
     src = cmor_source.netcdf_source("to", "nemo")
     tgt = cmor_target.cmor_target("thetao", "Omon")
     setattr(tgt, "frequency", "mon")
     setattr(tgt, "dimensions", "longitude latitude olevel time")
     setattr(tgt, "time_operator", ["mean"])
     tgt.dims = 3
     tsk = cmor_task.cmor_task(src, tgt)
     nemo2cmor.execute([tsk])
     nemo2cmor.finalize()
     cmor.close()
Пример #5
0
 def test_cmor_single_task3d(self):
     tab_dir = init_cmor()
     nemo2cmor.initialize(self.data_dir,
                          "expn",
                          os.path.join(tab_dir, "CMIP6"),
                          datetime.datetime(1990, 3, 1),
                          testmode=True)
     src = cmor_source.netcdf_source("to", "nemo")
     tgt = cmor_target.cmor_target("thetao", "Omon")
     setattr(tgt, "frequency", "mon")
     setattr(tgt, "dimensions", "longitude latitude olevel time")
     setattr(tgt, "time_operator", ["mean"])
     tgt.space_dims = {"latitude", "longitude"}
     tsk = cmor_task.cmor_task(src, tgt)
     nemo2cmor.execute([tsk])
     nemo2cmor.finalize()
     cmor.close()
Пример #6
0
 def test_cmor_single_task3d(self):
     tab_dir = get_table_path()
     conf_path = ece2cmorlib.conf_path_default
     cmor.setup(tab_dir)
     cmor.dataset_json(conf_path)
     cmor.set_cur_dataset_attribute("calendar", "proleptic_gregorian")
     nemo2cmor.initialize(self.data_dir, "exp",
                          os.path.join(tab_dir, "CMIP6"),
                          datetime.datetime(1990, 3, 1))
     src = cmor_source.netcdf_source("to", "nemo")
     tgt = cmor_target.cmor_target("thetao", "Omon")
     setattr(tgt, "frequency", "mon")
     setattr(tgt, "dimensions", "longitude latitude olevel time")
     setattr(tgt, "time_operator", ["mean"])
     tgt.space_dims = {"latitude", "longitude"}
     tsk = cmor_task.cmor_task(src, tgt)
     nemo2cmor.execute([tsk])
     nemo2cmor.finalize()
     cmor.close()