本文整理汇总了Python中cartopy.crs.Globe方法的典型用法代码示例。如果您正苦于以下问题:Python crs.Globe方法的具体用法?Python crs.Globe怎么用?Python crs.Globe使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cartopy.crs
的用法示例。
在下文中一共展示了crs.Globe方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: setup
# 需要导入模块: from cartopy import crs [as 别名]
# 或者: from cartopy.crs import Globe [as 别名]
def setup(self):
# Image length.
self.imlen = 256
# Image.
self.img = Image.open(
"LunarLROLrocKaguya_1180mperpix_downsamp.png").convert("L")
self.imgsize = self.img.size
# Crater catalogue.
self.craters = igen.ReadLROCHeadCombinedCraterCSV(
filelroc="../catalogues/LROCCraters.csv",
filehead="../catalogues/HeadCraters.csv",
sortlat=True)
# Long/lat limits
self.cdim = [-180., 180., -60., 60.]
# Coordinate systems.
self.iglobe = ccrs.Globe(semimajor_axis=1737400,
semiminor_axis=1737400,
ellipse=None)
self.geoproj = ccrs.Geodetic(globe=self.iglobe)
self.iproj = ccrs.PlateCarree(globe=self.iglobe)
示例2: _globe_from_proj4
# 需要导入模块: from cartopy import crs [as 别名]
# 或者: from cartopy.crs import Globe [as 别名]
def _globe_from_proj4(proj4_terms):
"""Create a `Globe` object from PROJ.4 parameters."""
globe_terms = filter(lambda term: term[0] in _GLOBE_PARAMS,
proj4_terms.items())
globe = ccrs.Globe(**{_GLOBE_PARAMS[name]: value for name, value in
globe_terms})
return globe
# copy of class in cartopy (before it was released)
示例3: load
# 需要导入模块: from cartopy import crs [as 别名]
# 或者: from cartopy.crs import Globe [as 别名]
def load(self, df, centerings):
"""
A meta-method which abstracts the internals of individual projections' load procedures.
Parameters
----------
df : GeoDataFrame
The GeoDataFrame which has been passed as input to the plotter at the top level.
This data is needed to calculate reasonable centering variables in cases in which the
user does not already provide them; which is, incidentally, the reason behind all of
this funny twice-instantiation loading in the first place.
centerings: dict
A dictionary containing names and centering methods. Certain projections have certain
centering parameters whilst others lack them. For example, the geospatial projection
contains both ``central_longitude`` and ``central_latitude`` instance parameter, which
together control the center of the plot, while the North Pole Stereo projection has
only a ``central_longitude`` instance parameter, implying that latitude is fixed (as
indeed it is, as this projection is centered on the North Pole!).
A top-level centerings method is provided in each of the ``geoplot`` top-level plot
functions; each of the projection wrapper classes defined here in turn selects the
functions from this list relevent to this particular instance and passes them to
the ``_generic_load`` method here.
We then in turn execute these functions to get defaults for our ``df`` and pass them
off to our output ``cartopy.crs`` instance.
Returns
-------
crs : ``cartopy.crs`` object instance
Returns a ``cartopy.crs`` object instance whose appropriate instance variables have
been set to reasonable defaults wherever not already provided by the user.
"""
# WebMercator is a special case.
if self.__class__.__name__ == 'WebMercator':
class WebMercator(ccrs.Mercator):
def __init__(self, args):
super().__init__(
central_longitude=0,
min_latitude=-85.0511287798066,
max_latitude=85.0511287798066,
globe=ccrs.Globe(
ellipse=None,
semimajor_axis=ccrs.WGS84_SEMIMAJOR_AXIS,
semiminor_axis=ccrs.WGS84_SEMIMAJOR_AXIS,
nadgrids='@null'
),
**args
)
return WebMercator(self.args)
else:
return getattr(ccrs, self.__class__.__name__)(**{**centerings, **self.args})