mesa.py 文件源码

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

项目:NuGridPy 作者: NuGrid 项目源码 文件源码
def CO_ratio(self,ifig,ixaxis):
        """
        plot surface C/O ratio in Figure ifig with x-axis quantity ixaxis

        Parameters
        ----------
        ifig : integer
            Figure number in which to plot
        ixaxis : string
            what quantity is to be on the x-axis, either 'time' or 'model'
            The default is 'model'
        """

        def C_O(model):
            surface_c12=model.get('surface_c12')
            surface_o16=model.get('surface_o16')
            CORatio=old_div((surface_c12*4.),(surface_o16*3.))
            return CORatio

        if ixaxis=='time':
            xax=self.get('star_age')
        elif ixaxis=='model':
            xax=self.get('model_number')
        else:
            raise IOError("ixaxis not recognised")

        pl.figure(ifig)
        pl.plot(xax,C_O(self))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号