def preprocess(download_key, src_path=DEFAULT_DOWNLOAD_PATH, dst_path=DEFAULT_PROCESSED_PATH,
               ndvi=False, pansharpen=False, verbose=False, ndvigrey=False, bounds=None):

    try:
        bands = [2,3,4]
        if pansharpen:
            p = PanSharpen(src_path, bands=bands, dst_path=dst_path,
                           verbose=verbose,  bounds=bounds)
        elif ndvigrey:
            p = NDVI(src_path, verbose=verbose, dst_path=dst_path, bounds=bounds)
        elif ndvi:
            p = NDVIWithManualColorMap(src_path, dst_path=dst_path,
                                       verbose=verbose, bounds=bounds)
        else:
            p = Simple(src_path, bands=bands, dst_path=dst_path, verbose=verbose, bounds=bounds)

    except IOError as err:
        print str(err)
        exit(str(err))
    except FileDoesNotExist as err:
        print str(err)
        exit(str(err))

    return p.run()
Example #2
0
    def test_ndvi_with_manual_colormap(self):

        p = NDVIWithManualColorMap(path=self.landsat_image, dst_path=self.temp_folder)
        print p.run()
        self.assertTrue(exists(join(self.temp_folder, "test", "test_NDVI.TIF")))
Example #3
0
    def test_ndvi_with_manual_colormap(self):

        p = NDVIWithManualColorMap(path=self.landsat_image, dst_path=self.temp_folder)
        self.assertTrue(exists(p.run()))
Example #4
0
    def test_ndvi_with_manual_colormap(self):

        p = NDVIWithManualColorMap(path=self.landsat_image, dst_path=self.temp_folder)
        self.assertTrue(exists(p.run()))