当前位置: 首页>>代码示例>>Python>>正文


Python crs.Globe方法代码示例

本文整理汇总了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) 
开发者ID:silburt,项目名称:DeepMoon,代码行数:26,代码来源:test_input_data_gen.py

示例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) 
开发者ID:pytroll,项目名称:pyresample,代码行数:12,代码来源:cartopy.py

示例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}) 
开发者ID:ResidentMario,项目名称:geoplot,代码行数:54,代码来源:crs.py


注:本文中的cartopy.crs.Globe方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。