lens.py 文件源码

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

项目:MulensModel 作者: rpoleski 项目源码 文件源码
def _set_single_mass(self, new_mass):
        """
        Initializes total_mass and epsilon if only one mass componenet
        is defined (i.e. a point lens).
        """
        if isinstance(new_mass, u.Quantity):
            if new_mass.unit.physical_type == 'dimensionless':
                new_mass *= u.solMass
            elif new_mass.unit.physical_type != 'mass':
                msg = 'wrong physical_type of new total_mass: {:}'
                raise ValueError(msg.format(new_mass.unit.physical_type))
            self._total_mass = new_mass
        else:
            self._total_mass = new_mass * u.solMass

        self._epsilon = np.array([1.0])
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号