Exemple #1
0
    def test_calculation_of_tie_point_grid_float_coords(self):
        # NOTE: This does not test against unequaly sized output of get_image_windows_to_match().

        # overwrite gt and prj
        ref = GeoArray(self.ref_path)
        ref.to_mem()
        ref.filePath = None
        tgt = GeoArray(self.tgt_path)
        tgt.to_mem()
        tgt.filePath = None

        ref.gt = [
            330000.19999996503, 10.00000001, 0.0, 5862000.7999997628, 0.0,
            -10.00000001
        ]
        # ref.gt = [330000.1, 10.1, 0.0, 5862000.1, 0.0, -10.1]
        tgt.gt = [
            335440.19999996503, 10.00000001, 0.0, 5866490.7999997628, 0.0,
            -10.00000001
        ]
        # tgt.gt = [330000.1, 10.1, 0.0, 5862000.1, 0.0, -10.1]

        # get instance of COREG_LOCAL object
        CRL = COREG_LOCAL(ref, tgt, **dict(CPUs=32, **self.coreg_kwargs))
        CRL.calculate_spatial_shifts()
Exemple #2
0
    def test_shift_calculation_nonquadratic_pixels(self):
        """Test with default parameters - should compute X/Y shifts properly and write the de-shifted target image."""

        # overwrite gt and prj
        ref = GeoArray(self.ref_path)
        ref.to_mem()
        ref.filePath = None
        ref.gt = [330000.00000001, 5.8932, 0.0, 5862000.0000001, 0.0, -10.1]
        tgt = GeoArray(self.tgt_path)
        tgt.to_mem()
        tgt.filePath = None
        tgt.gt = [335440.0000001, 5.8933, 0.0, 5866490.0000001, 0.0, -10.1]

        CR = self.run_shift_detection_correction(ref, tgt,
                                                 **dict(self.coreg_kwargs,
                                                        wp=(341500.0, 5861440.0),
                                                        footprint_poly_ref=None,
                                                        footprint_poly_tgt=None))
        self.assertTrue(CR.success)
Exemple #3
0
    def test_init_nomapinfo(self):
        dem = GeoArray(np.array([1, 2]))

        # no map info, no projection
        with self.assertRaises(ValueError):
            DEM_Processor(dem, enmapIm_cornerCoords=self.ll_cornerCoords)

        # no projection
        dem.gt = (10.6, 0.00036, -0.0, 47.5, -0.0, -0.00036)  # can be anything
        with self.assertRaises(ValueError):
            DEM_Processor(dem, enmapIm_cornerCoords=self.ll_cornerCoords)
Exemple #4
0
    def test_shift_calculation_with_image_coords_only(self):
        """Test with default parameters - should compute X/Y shifts properly and write the de-shifted target image."""
        # FIXME fails when executed alone

        # overwrite gt and prj
        ref = GeoArray(self.ref_path)
        ref.to_mem()
        ref.filePath = None
        ref.gt = [0, 1, 0, 0, 0, -1]
        ref.prj = ''
        tgt = GeoArray(self.tgt_path)
        tgt.to_mem()
        tgt.filePath = None
        tgt.gt = [0, 1, 0, 0, 0, -1]
        tgt.prj = ''

        CR = self.run_shift_detection_correction(ref, tgt,
                                                 **dict(self.coreg_kwargs,
                                                        wp=(1200, -1600),
                                                        footprint_poly_ref=None,
                                                        footprint_poly_tgt=None))
        self.assertTrue(CR.success)