コード例 #1
0
    def test_create_dataset_raster_1Band(self):
        """Should create a GPKG (from a layer with 1 band files)"""
        layer_name = 'CANGRD.ANO.TX_SUMMER'
        var = 'CANGRD_hist_JJA_anom_ps50km_TMAX.gpkg'
        out_file = os.path.join(self.data_dir, 'cangrd/geotiff/historical',
                                'seasonal/JJA/anomaly/', var)
        if os.path.isfile(out_file):
            os.remove(out_file)
        layer_info = self.cfg['layers'][layer_name]

        create_dataset(layer_info, self.data_dir, self.data_dir)

        self.assertTrue(os.path.isfile(out_file))
コード例 #2
0
    def test_create_dataset_raster_Bands(self):
        """Should create a GPKG (from a layer with multiple bands)"""
        layer_name = 'CMIP5.SIT.RCP45.YEAR.ANO_PCTL50'
        var = 'CMIP5_rcp4.5_annual_anom_latlon1x1_SICETHKN_pctl50_P1Y.gpkg'
        out_file = os.path.join(self.data_dir, 'cmip5/netcdf/scenarios',
                                'RCP4.5/annual/anomaly/', var)
        if os.path.isfile(out_file):
            os.remove(out_file)
        layer_info = self.cfg['layers'][layer_name]

        create_dataset(layer_info, self.data_dir, self.data_dir)

        self.assertTrue(os.path.isfile(out_file))
コード例 #3
0
    def test_create_dataset_raster_no_time(self):
        """Should not create a GPKG (not a time enabled layer)"""
        layer_name = 'DCS.TM.RCP85.YEAR.2041-2060_PCTL50'
        layer_info = self.cfg['layers'][layer_name]

        result = create_dataset(layer_info, self.data_dir, self.data_dir)

        self.assertIsNone(result)
コード例 #4
0
    def test_create_dataset_no_raster(self):
        """Should not create a GPKG (Vector layer)"""
        layer_name = 'CLIMATE.STATIONS'
        layer_info = self.cfg['layers'][layer_name]

        result = create_dataset(layer_info, self.data_dir, self.data_dir)

        self.assertIsNone(result)