projection.py 文件源码

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

项目:wrf-python 作者: NCAR 项目源码 文件源码
def __eq__(self, other):
        """Return True if this projection object is the same as *other*.

        Note:  WRF can use either floats or doubles, so only going to 
        guarantee floating point precision equivalence, in case the different 
        types are ever compared (or a projection is hand constructed). For WRF
        domains, 7-digit equivalence should be good enough.

        """

        if self.map_proj is not None:
            if self.map_proj != other.map_proj:
                return False
        else:
            if other.map_proj is not None:
                return False

        # Only checking for floating point equal.
        ctx = Context(prec=7, rounding=ROUND_HALF_UP)

        return (WrfProj._context_equal(self.truelat1, other.truelat1, ctx) and
                WrfProj._context_equal(self.truelat2, other.truelat2, ctx) and
                WrfProj._context_equal(self.moad_cen_lat, other.moad_cen_lat, 
                                      ctx) and
                WrfProj._context_equal(self.stand_lon, other.stand_lon, 
                                       ctx) and
                WrfProj._context_equal(self.pole_lat, other.pole_lat, ctx) and
                WrfProj._context_equal(self.pole_lon, other.pole_lon, ctx) and
                WrfProj._context_equal(self.dx, other.dx, ctx) and
                WrfProj._context_equal(self.dy, other.dy, ctx))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号