__init__.py 文件源码

python
阅读 28 收藏 0 点赞 0 评论 0

项目:PaleoView 作者: GlobalEcologyLab 项目源码 文件源码
def _transform1d(plotfunc):
    # shift data and longitudes to map projection region, then compute
    # transformation to map projection coordinates.
    @functools.wraps(plotfunc)
    def with_transform(self,x,y,*args,**kwargs):
        x = np.asarray(x)
        # input coordinates are latitude/longitude, not map projection coords.
        if kwargs.pop('latlon', latlon_default):
            # shift data to map projection region for
            # cylindrical and pseudo-cylindrical projections.
            if self.projection in _cylproj or self.projection in _pseudocyl:
                if x.ndim == 1:
                    x = self.shiftdata(x)
                elif x.ndim == 0:
                    if x > 180:
                        x = x - 360.
            # convert lat/lon coords to map projection coords.
            x, y = self(x,y)
        return plotfunc(self,x,y,*args,**kwargs)
    return with_transform
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号