Ejemplo n.º 1
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()
Ejemplo n.º 2
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()
Ejemplo n.º 3
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()
Ejemplo n.º 4
0
 def test_create_netcdf_source():
     src = netcdf_source("tos", "nemo")
     eq_(src.variable(), "tos")
     eq_(src.model_component(), "nemo")
Ejemplo n.º 5
0
 def test_create_netcdf_source():
     src = netcdf_source("tos", "nemo")
     assert src.variable() == "tos"
     assert src.model_component() == "nemo"