Beispiel #1
0
 def setUp(self):
     self.latitude_of_projection_origin = 0.0
     self.longitude_of_projection_origin = 0.0
     self.semi_major_axis = 6377563.396
     self.semi_minor_axis = 6356256.909
     self.ellipsoid = GeogCS(self.semi_major_axis, self.semi_minor_axis)
     self.ortho_cs = Orthographic(self.latitude_of_projection_origin,
                                  self.longitude_of_projection_origin,
                                  ellipsoid=self.ellipsoid)
Beispiel #2
0
class Test_as_cartopy_projection(tests.IrisTest):
    def setUp(self):
        self.latitude_of_projection_origin = 0.0
        self.longitude_of_projection_origin = 0.0
        self.semi_major_axis = 6377563.396
        self.semi_minor_axis = 6356256.909
        self.ellipsoid = GeogCS(self.semi_major_axis, self.semi_minor_axis)
        self.ortho_cs = Orthographic(
            self.latitude_of_projection_origin,
            self.longitude_of_projection_origin,
            ellipsoid=self.ellipsoid,
        )

    def test_projection_creation(self):
        res = self.ortho_cs.as_cartopy_projection()
        globe = ccrs.Globe(
            semimajor_axis=self.semi_major_axis,
            semiminor_axis=self.semi_minor_axis,
            ellipse=None,
        )
        expected = ccrs.Orthographic(
            self.latitude_of_projection_origin,
            self.longitude_of_projection_origin,
            globe=globe,
        )
        self.assertEqual(res, expected)
 def test__fail_unsupported_coord_system(self):
     cs = Orthographic(0, 0)
     test_cube = self._make_test_cube(cs=cs)
     with self.assertRaisesRegexp(
             ValueError,
             'Grib saving is not supported for coordinate system:'):
         grid_definition_section(test_cube, self.mock_grib)
Beispiel #4
0
 def setUp(self):
     self.latitude_of_projection_origin = 0.0
     self.longitude_of_projection_origin = 0.0
     self.semi_major_axis = 6377563.396
     self.semi_minor_axis = 6356256.909
     self.ellipsoid = GeogCS(self.semi_major_axis, self.semi_minor_axis)
     self.ortho_cs = Orthographic(self.latitude_of_projection_origin,
                                  self.longitude_of_projection_origin,
                                  ellipsoid=self.ellipsoid)
Beispiel #5
0
class Test_as_cartopy_projection(tests.IrisTest):
    def setUp(self):
        self.latitude_of_projection_origin = 0.0
        self.longitude_of_projection_origin = 0.0
        self.semi_major_axis = 6377563.396
        self.semi_minor_axis = 6356256.909
        self.ellipsoid = GeogCS(self.semi_major_axis, self.semi_minor_axis)
        self.ortho_cs = Orthographic(self.latitude_of_projection_origin,
                                     self.longitude_of_projection_origin,
                                     ellipsoid=self.ellipsoid)

    def test_projection_creation(self):
        res = self.ortho_cs.as_cartopy_projection()
        globe = ccrs.Globe(semimajor_axis=self.semi_major_axis,
                           semiminor_axis=self.semi_minor_axis,
                           ellipse=None)
        expected = ccrs.Orthographic(
            self.latitude_of_projection_origin,
            self.longitude_of_projection_origin,
            globe=globe)
        self.assertEqual(res, expected)
Beispiel #6
0
 def test_optional_args_None(self):
     # Check expected defaults with optional args=None.
     crs = Orthographic(0, 0, false_easting=None, false_northing=None)
     self._check_crs_defaults(crs)
Beispiel #7
0
 def test_no_optional_args(self):
     # Check expected defaults with no optional args.
     crs = Orthographic(0, 0)
     self._check_crs_defaults(crs)
Beispiel #8
0
 def test_set_optional_args(self):
     # Check that setting the optional (non-ellipse) args works.
     crs = Orthographic(0, 0, false_easting=100, false_northing=-203.7)
     self.assertEqualAndKind(crs.false_easting, 100.0)
     self.assertEqualAndKind(crs.false_northing, -203.7)