nugrid_set.py 文件源码

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

项目:NuGridPy 作者: NuGrid 项目源码 文件源码
def lifetime(self,label=""):
        '''
            Calculate stellar lifetime till first TP 
            dependent of initial mass
        '''
                plt.rcParams.update({'font.size': 20})
                plt.rc('xtick', labelsize=20)
                plt.rc('ytick', labelsize=20)
                t0_model=self.set_find_first_TP()
                m=self.run_historydata
                i=0
        age=[]
        mass=[]
                for case in m:
            ##lifetime till first TP
            age.append(np.log10(case.get("star_age")[t0_model[i]]))
            mass.append(case.get("star_mass")[0])
            i+=1
        plt.plot(mass,age,"*",markersize=10,linestyle="-",label=label)
        plt.xlabel('star mass $[M_{\odot}]$',fontsize=20)
        plt.ylabel('Logarithmic stellar lifetime',fontsize=20)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号