lens.py 文件源码

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

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


问题


面经


文章

微信
公众号

扫码关注公众号