예제 #1
0
    def test_do_med_image(self):

        output_filename = 'vgt-ndvi/10dmed-linearx2/1221_vgt-ndvi_10dmed-linearx2_SPOTV-Africa-1km_sv2-pv2.2.tif'
        output_file = os.path.join(self.root_out_dir, output_filename)
        ref_file = os.path.join(self.ref_dir, output_filename)
        functions.check_output_dir(os.path.dirname(output_file))

        input_files = [
            self.ref_dir +
            '/vgt-ndvi/ndvi-linearx2/19991221_vgt-ndvi_ndvi-linearx2_SPOTV-Africa-1km_sv2-pv2.2.tif',
            self.ref_dir +
            '/vgt-ndvi/ndvi-linearx2/20001221_vgt-ndvi_ndvi-linearx2_SPOTV-Africa-1km_sv2-pv2.2.tif',
            self.ref_dir +
            '/vgt-ndvi/ndvi-linearx2/20011221_vgt-ndvi_ndvi-linearx2_SPOTV-Africa-1km_sv2-pv2.2.tif',
            self.ref_dir +
            '/vgt-ndvi/ndvi-linearx2/20021221_vgt-ndvi_ndvi-linearx2_SPOTV-Africa-1km_sv2-pv2.2.tif',
            self.ref_dir +
            '/vgt-ndvi/ndvi-linearx2/20031221_vgt-ndvi_ndvi-linearx2_SPOTV-Africa-1km_sv2-pv2.2.tif',
            self.ref_dir +
            '/vgt-ndvi/ndvi-linearx2/20041221_vgt-ndvi_ndvi-linearx2_SPOTV-Africa-1km_sv2-pv2.2.tif',
            self.ref_dir +
            '/vgt-ndvi/ndvi-linearx2/20051221_vgt-ndvi_ndvi-linearx2_SPOTV-Africa-1km_sv2-pv2.2.tif',
            self.ref_dir +
            '/vgt-ndvi/ndvi-linearx2/20061221_vgt-ndvi_ndvi-linearx2_SPOTV-Africa-1km_sv2-pv2.2.tif',
            self.ref_dir +
            '/vgt-ndvi/ndvi-linearx2/20071221_vgt-ndvi_ndvi-linearx2_SPOTV-Africa-1km_sv2-pv2.2.tif',
            self.ref_dir +
            '/vgt-ndvi/ndvi-linearx2/20081221_vgt-ndvi_ndvi-linearx2_SPOTV-Africa-1km_sv2-pv2.2.tif',
            self.ref_dir +
            '/vgt-ndvi/ndvi-linearx2/20091221_vgt-ndvi_ndvi-linearx2_SPOTV-Africa-1km_sv2-pv2.2.tif',
            self.ref_dir +
            '/vgt-ndvi/ndvi-linearx2/20101221_vgt-ndvi_ndvi-linearx2_SPOTV-Africa-1km_sv2-pv2.2.tif',
            self.ref_dir +
            '/vgt-ndvi/ndvi-linearx2/20111221_vgt-ndvi_ndvi-linearx2_SPOTV-Africa-1km_sv2-pv2.2.tif',
            self.ref_dir +
            '/vgt-ndvi/ndvi-linearx2/20121221_vgt-ndvi_ndvi-linearx2_SPOTV-Africa-1km_sv2-pv2.2.tif',
            self.ref_dir +
            '/vgt-ndvi/ndvi-linearx2/20131221_vgt-ndvi_ndvi-linearx2_SPOTV-Africa-1km_sv2-pv2.2.tif',
            self.ref_dir +
            '/vgt-ndvi/ndvi-linearx2/20141221_vgt-ndvi_ndvi-linearx2_SPOTV-Africa-1km_sv2-pv2.2.tif',
            self.ref_dir +
            '/vgt-ndvi/ndvi-linearx2/20151221_vgt-ndvi_ndvi-linearx2_SPOTV-Africa-1km_sv2-pv2.2.tif',
            self.ref_dir +
            '/vgt-ndvi/ndvi-linearx2/20161221_vgt-ndvi_ndvi-linearx2_SPOTV-Africa-1km_sv2-pv2.2.tif',
            self.ref_dir +
            '/vgt-ndvi/ndvi-linearx2/20171221_vgt-ndvi_ndvi-linearx2_SPOTV-Africa-1km_sv2-pv2.2.tif',
            self.ref_dir +
            '/vgt-ndvi/ndvi-linearx2/20181221_vgt-ndvi_ndvi-linearx2_SPOTV-Africa-1km_sv2-pv2.2.tif'
        ]
        args = {
            "input_file": input_files,
            "output_format": 'GTIFF',
            "options": "compress=lzw",
            "output_file": output_file
        }
        raster_image_math.do_med_image(**args)

        equal = self.checkFile(ref_file, output_file)
        self.assertEqual(equal, 1)
예제 #2
0
def vgt_ndvi_10dmed_linearx2(input_file, output_file):

    output_file = functions.list_to_element(output_file)
    functions.check_output_dir(os.path.dirname(output_file))
    args = {
        "input_file": input_file,
        "output_file": output_file,
        "output_format": 'GTIFF',
        "options": "compress = lzw"
    }
    raster_image_math.do_med_image(**args)
예제 #3
0
def vgt_ndvi_10dmed_linearx2(input_file, output_file):

    output_file = functions.list_to_element(output_file)
    functions.check_output_dir(os.path.dirname(output_file))
    args = {"input_file": input_file, "output_file": output_file, "output_format": 'GTIFF', "options": "compress = lzw"}
    raster_image_math.do_med_image(**args)