source.py 文件源码

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

项目:MulensModel 作者: rpoleski 项目源码 文件源码
def distance(self, new_distance):
        if new_distance is None:
            self._distance = new_distance
        else:
            if not isinstance(new_distance, u.Quantity):
                self._distance = new_distance * 1000. * u.pc
            else:
                if (new_distance.unit == "pc") or (new_distance.unit == "kpc"):
                    self._distance = new_distance
                else:
                    raise u.UnitsError(
                        'Allowed units for Source distance are "pc" or "kpc"')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号