def test_get_nansat_object_no_reproject(self): ''' Mosaic.Layer should open file with Nansat ''' l = Layer(self.test_file_gcps, doReproject=False) l.make_nansat_object(self.domain) self.assertEqual(type(l.n), Nansat) self.assertEqual(l.n.shape(), (200, 200))
def test_get_nansat_object(self): ''' Mosaic.Layer should open file with Nansat and reproject ''' l = Layer(self.test_file_gcps) l.make_nansat_object(self.domain) self.assertEqual(type(l.n), Nansat) self.assertEqual(l.n.shape(), (650, 700))
def test_get_mask_no_reproject(self): '''Mosaic.Layer should get mask from reprojected file ''' l = Layer(self.test_file_gcps, doReproject=False) l.make_nansat_object(self.domain) mask = l.get_mask_array() self.assertEqual(type(mask), np.ndarray) np.testing.assert_allclose(mask, np.ones((200,200))*64)
def test_get_mask_no_reproject(self): '''Mosaic.Layer should get mask from reprojected file ''' l = Layer(self.test_file_gcps, doReproject=False) l.make_nansat_object(self.domain) mask = l.get_mask_array() self.assertEqual(type(mask), np.ndarray) np.testing.assert_allclose(mask, np.ones((200, 200)) * 64)
def test_get_mask(self): '''Mosaic.Layer should get mask from reprojected file ''' n = Nansat(self.test_file_gcps) n.reproject(self.domain) swathmask = n['swathmask'] l = Layer(self.test_file_gcps) l.make_nansat_object(self.domain) mask = l.get_mask_array() self.assertEqual(type(mask), np.ndarray) self.assertEqual(mask.shape, (650, 700)) np.testing.assert_allclose(mask, swathmask*64)
def test_get_mask(self): '''Mosaic.Layer should get mask from reprojected file ''' n = Nansat(self.test_file_gcps) n.reproject(self.domain) swathmask = n['swathmask'] l = Layer(self.test_file_gcps) l.make_nansat_object(self.domain) mask = l.get_mask_array() self.assertEqual(type(mask), np.ndarray) self.assertEqual(mask.shape, (650, 700)) np.testing.assert_allclose(mask, swathmask * 64)