示例#1
0
 def test_secant_latitudes(self):
     lat_1, lat_2 = 40, 41
     lcc = LambertConformal(secant_latitudes=(lat_1, lat_2))
     ccrs = lcc.as_cartopy_crs()
     self.assertEqual(lat_1, ccrs.proj4_params['lat_1'])
     self.assertEqual(lat_2, ccrs.proj4_params['lat_2'])
示例#2
0
 def test_fail_secant_latitudes_excessive(self):
     emsg = 'one or two secant latitudes required'
     with self.assertRaisesRegexp(ValueError, emsg):
         LambertConformal(secant_latitudes=(1, 2, 3))
示例#3
0
 def test_secant_latitudes_single_value(self):
     lat_1 = 40
     lcc = LambertConformal(secant_latitudes=lat_1)
     ccrs = lcc.as_cartopy_crs()
     self.assertEqual(lat_1, ccrs.proj4_params['lat_1'])
     self.assertNotIn('lat_2', ccrs.proj4_params)
示例#4
0
 def test_fail_secant_latitudes_none(self):
     emsg = "one or two secant latitudes required"
     with self.assertRaisesRegex(ValueError, emsg):
         LambertConformal(secant_latitudes=())
示例#5
0
 def test_south_cutoff(self):
     lcc = LambertConformal(0, 0, secant_latitudes=(-30, -60))
     ccrs = lcc.as_cartopy_crs()
     self.assertEqual(ccrs.cutoff, 30)
示例#6
0
 def _default_coord_system(self):
     return LambertConformal(central_lat=39.0, central_lon=-96.0,
                             false_easting=0.0, false_northing=0.0,
                             secant_latitudes=(33, 45),
                             ellipsoid=self.default_ellipsoid)
示例#7
0
 def test_fail_secant_latitudes_excessive(self):
     emsg = "secant latitudes"
     with self.assertRaisesRegex(ValueError, emsg):
         LambertConformal(secant_latitudes=(1, 2, 3))
示例#8
0
 def test_no_optional_args(self):
     # Check expected defaults with no optional args.
     crs = LambertConformal()
     self._check_crs_defaults(crs)
示例#9
0
 def test_set_one_parallel(self):
     # Check that setting the optional (non-ellipse) args works.
     # (Except secant_latitudes, which are done separately).
     crs = LambertConformal(secant_latitudes=-44)
     self.assertEqual(len(crs.secant_latitudes), 1)
     self.assertEqualAndKind(crs.secant_latitudes[0], -44.0)
示例#10
0
 def test_south_cutoff(self):
     lcc = LambertConformal(0, 0, secant_latitudes=(-30, -60))
     ccrs = lcc.as_cartopy_crs()
     self.assertEqual(ccrs.cutoff, 30)
示例#11
0
 def test_secant_latitudes(self):
     lat_1, lat_2 = 40, 41
     lcc = LambertConformal(secant_latitudes=(lat_1, lat_2))
     ccrs = lcc.as_cartopy_crs()
     self.assertEqual(lat_1, ccrs.proj4_params['lat_1'])
     self.assertEqual(lat_2, ccrs.proj4_params['lat_2'])
示例#12
0
 def test_secant_latitudes_single_value(self):
     lat_1 = 40
     lcc = LambertConformal(secant_latitudes=lat_1)
     ccrs = lcc.as_cartopy_crs()
     self.assertEqual(lat_1, ccrs.proj4_params['lat_1'])
     self.assertNotIn('lat_2', ccrs.proj4_params)