Exemplo n.º 1
0
class EsaCciOdpDataStoreIndexCacheTest(unittest.TestCase):
    def test_index_cache(self):
        self.data_store = EsaCciOdpDataStore(index_cache_used=True, index_cache_expiration_days=1.0e-6)
        data_sources = self.data_store.query()
        self.assertIsNotNone(data_sources)
        for data_source in data_sources:
            data_source.update_file_list()
Exemplo n.º 2
0
class EsaCciOdpDataStoreIndexCacheTest(unittest.TestCase):
    def test_index_cache(self):
        self.data_store = EsaCciOdpDataStore(index_cache_used=True, index_cache_expiration_days=1.0e-6)
        data_sources = self.data_store.query()
        self.assertIsNotNone(data_sources)
        for data_source in data_sources:
            data_source.update_file_list()
Exemplo n.º 3
0
 def test_make_local_spatial(self):
     data_store = EsaCciOdpDataStore()
     data_source = data_store.query(ds_id='esacci.SST.day.L4.SSTdepth.multi-sensor.multi-platform.OSTIA.1-1.r1')[0]
     # The following always worked fine:
     ds = data_source.open_dataset(time_range=['2010-01-01', '2010-01-04'], region='-10,40,20,70')
     self.assertIsNotNone(ds)
     # The following reproduced Cate issues #823, #822, #818, #816, #783:
     ds = data_source.make_local('SST_DAY_L4', time_range=['2010-01-01', '2010-01-04'], region='-10,40,20,70')
     self.assertIsNotNone(ds)
Exemplo n.º 4
0
 def test_make_local_spatial(self):
     data_store = EsaCciOdpDataStore()
     data_source = data_store.query(ds_id='esacci.SST.day.L4.SSTdepth.multi-sensor.multi-platform.OSTIA.1-1.r1')[0]
     # The following always worked fine:
     ds = data_source.open_dataset(time_range=['2010-01-01', '2010-01-04'], region='-10,40,20,70')
     self.assertIsNotNone(ds)
     # The following reproduced Cate issues #823, #822, #818, #816, #783:
     ds = data_source.make_local('SST_DAY_L4', time_range=['2010-01-01', '2010-01-04'], region='-10,40,20,70')
     self.assertIsNotNone(ds)
Exemplo n.º 5
0
 def test_make_local_wo_subsets(self):
     data_store = EsaCciOdpDataStore()
     local_data_store = DATA_STORE_REGISTRY.get_data_store('local')
     cci_dataset_collection = 'esacci.OZONE.mon.L3.NP.multi-sensor.multi-platform.MERGED.fv0002.r1'
     data_source = data_store.query(cci_dataset_collection)[0]
     random_string = f"test{random.choice(string.ascii_lowercase)}"
     ds = data_source.make_local(random_string)
     self.assertIsNotNone(ds)
     local_data_store.remove_data_source(f"local.{random_string}")
Exemplo n.º 6
0
 def test_make_local_spatial_3(self):
     data_store = EsaCciOdpDataStore()
     # The following reproduces Cate issue #904:
     cci_dataset_collection = 'esacci.AEROSOL.5-days.L3C.AEX.GOMOS.Envisat.AERGOM.2-19.r1'
     data_source = data_store.query(cci_dataset_collection)[0]
     ds_from_remote_source = data_source.open_dataset(time_range=['2002-04-01', '2002-04-06'],
                                                      var_names=['AEX550_uncertainty', 'ANG400-800-AEX'],
                                                      region='-113.9, 40.0,-113.8, 40.1')
     self.assertIsNotNone(ds_from_remote_source)
Exemplo n.º 7
0
 def test_for_duplicates_in_drs_ids(self):
     data_store = EsaCciOdpDataStore()
     data_sets = data_store.query()
     ids = []
     for dataset in data_sets:
         ids.append(dataset.id)
     if len(ids) == len(set(ids)):
         contains_duplicates = False
     else:
         contains_duplicates = True
     self.assertFalse(contains_duplicates)
Exemplo n.º 8
0
 def test_make_local_spatial_2(self):
     data_store = EsaCciOdpDataStore()
     local_data_store = DATA_STORE_REGISTRY.get_data_store('local')
     # The following reproduces Cate issues #823, #822, #818, #816, #783, #892, #900:
     cci_dataset_collection = 'esacci.SST.day.L4.SSTdepth.multi-sensor.multi-platform.OSTIA.1-1.r1'
     data_source = data_store.query(cci_dataset_collection)[0]
     ds_from_remote_source = data_source.open_dataset(time_range=['1991-09-01', '1991-09-03'],
                                                      var_names=['sea_ice_fraction', 'analysed_sst'],
                                                      region='-2.8, 70.6,-2.7, 70.7')
     self.assertIsNotNone(ds_from_remote_source)
     random_string = f"test{random.choice(string.ascii_lowercase)}"
     ds = data_source.make_local(random_string,
                                 time_range=['1991-09-01', '1991-09-03'],
                                 region='-2.8, 70.6,-2.7, 70.7')
     self.assertIsNotNone(ds)
     local_data_store.remove_data_source(f"local.{random_string}")
Exemplo n.º 9
0
    def test_make_local_spatial_1(self):
        data_store = EsaCciOdpDataStore()
        local_data_store = DATA_STORE_REGISTRY.get_data_store('local')
        # The following reproduces Cate issues #823, #822, #818, #816, #783, #892, #900:

        cci_dataset_collection = 'esacci.SST.satellite-orbit-frequency.L3U.SSTskin.AVHRR-3.Metop-A.AVHRRMTA_G.2-1.r1'
        data_source = data_store.query(cci_dataset_collection)[0]
        ds_from_remote_source = data_source.open_dataset(time_range=['2006-11-21', '2006-11-23'],
                                                         var_names=['sst_dtime', 'sea_surface_temperature_depth'],
                                                         region='-49.8, 13.1,-49.7, 13.2')
        self.assertIsNotNone(ds_from_remote_source)
        random_string = f"test{random.choice(string.ascii_lowercase)}"
        ds = data_source.make_local(random_string,
                                    time_range=['2006-11-21', '2006-11-23'],
                                    region='-49.8, 13.1,-49.7, 13.2')
        self.assertIsNotNone(ds)
        local_data_store.remove_data_source(f"local.{random_string}")
Exemplo n.º 10
0
 def test_normalization_of_time(self):
     data_store = EsaCciOdpDataStore()
     cci_dataset_collection = 'esacci.ICESHEETS.yr.Unspecified.GMB.GRACE-instrument.GRACE.UNSPECIFIED.1-2.greenland_gmb_mass_trends'
     data_source = data_store.query(cci_dataset_collection)[0]
     ds = data_source.open_dataset(time_range=['2005-07-02', '2005-07-02'], var_names=['GMB_trend'])
     self.assertIsNotNone(ds)
Exemplo n.º 11
0
 def test_unsupported_operand_type_fix(self):
     data_store = EsaCciOdpDataStore()
     cci_dataset_collection = 'esacci.PERMAFROST.yr.L4.ALT.multi-sensor.multi-platform.MODIS.01-0.r1'
     data_source = data_store.query(cci_dataset_collection)[0]
     ds = data_source.open_dataset(time_range=['2010-01-01', '2011-01-30'], var_names=['ALT'])
     self.assertIsNotNone(ds)
Exemplo n.º 12
0
 def test_unconverted_time(self):
     data_store = EsaCciOdpDataStore()
     cci_dataset_collection = 'esacci.OC.5-days.L3S.CHLOR_A.multi-sensor.multi-platform.MERGED.4-2.sinusoidal'
     data_source = data_store.query(cci_dataset_collection)[0]
     ds = data_source.open_dataset(time_range=['2010-01-01', '2010-01-30'], var_names=['CHLOR_A'])
     self.assertIsNotNone(ds)
Exemplo n.º 13
0
 def test_query_web_access(self):
     store = EsaCciOdpDataStore()
     all_data_sources = store.query()
     self.assertIsNotNone(all_data_sources)