Ejemplo n.º 1
0
 def test_crop_gcpproj(self):
     n1 = Nansat(self.test_file_gcps, logLevel=40)
     n1.reproject_GCPs()
     ext = n1.crop(10, 20, 50, 60)
     xmed = abs(np.median(np.array([gcp.GCPX
                             for gcp in n1.vrt.dataset.GetGCPs()])))
     gcpproj = NSR(n1.vrt.dataset.GetGCPProjection()
                                     ).ExportToProj4().split(' ')[0]
     
     self.assertTrue(xmed > 360)
     self.assertTrue(gcpproj=='+proj=stere')
Ejemplo n.º 2
0
    def test_reproject_gcps_on_repro_gcps(self):
        n1 = Nansat(self.test_file_stere, logLevel=40)
        n2 = Nansat(self.test_file_gcps, logLevel=40)
        n2.reproject_GCPs()
        n1.reproject(n2)
        tmpfilename = os.path.join(ntd.tmp_data_path,
                                   'nansat_reproject_gcps_on_repro_gcps.png')
        n1.write_figure(tmpfilename, 2, clim='hist')

        self.assertEqual(n1.shape(), n2.shape())
        self.assertEqual(type(n1[1]), np.ndarray)
Ejemplo n.º 3
0
    def test_reproject_gcps_on_repro_gcps(self):
        n1 = Nansat(self.test_file_stere, logLevel=40)
        n2 = Nansat(self.test_file_gcps, logLevel=40)
        n2.reproject_GCPs()
        n1.reproject(n2)
        tmpfilename = os.path.join(ntd.tmp_data_path,
                                   'nansat_reproject_gcps_on_repro_gcps.png')
        n1.write_figure(tmpfilename, 2, clim='hist')

        self.assertEqual(n1.shape(), n2.shape())
        self.assertEqual(type(n1[1]), np.ndarray)
Ejemplo n.º 4
0
    def test_crop_gcpproj(self):
        n1 = Nansat(self.test_file_gcps, logLevel=40)
        n1.reproject_GCPs()
        ext = n1.crop(10, 20, 50, 60)
        xmed = abs(
            np.median(np.array([gcp.GCPX
                                for gcp in n1.vrt.dataset.GetGCPs()])))
        gcpproj = NSR(
            n1.vrt.dataset.GetGCPProjection()).ExportToProj4().split(' ')[0]

        self.assertTrue(xmed > 360)
        self.assertTrue(gcpproj == '+proj=stere')