nugrid_set.py 文件源码

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

项目:NuGridPy 作者: NuGrid 项目源码 文件源码
def set_plot_CC_T_rho_max(self,linestyle=[],burn_limit=0.997,color=['r'],marker=['o'],markevery=500): 
        '''
            Plots 
            end_model - array, control how far in models a run is plottet, if -1 till end
            symbs_1  - set symbols of runs
        '''
        if len(linestyle)==0:
            linestyle=200*['-']
        plt.figure('CC evol')
                for i in range(len(self.runs_H5_surf)):
                        sefiles=se(self.runs_H5_out[i])
            t1_model=-1
            sefiles.get('temperature')
            sefiles.get('density')
                        mini=sefiles.get('mini')
            zini=sefiles.get('zini')
                        model=sefiles.se.cycles
                        model_list=[]
                        for k in range(0,len(model),1):
                                model_list.append(model[k])
                        rho1=sefiles.get(model_list,'rho')   #[:(t1_model-t0_model)]
                        T1=sefiles.get(model_list,'temperature')#[:(t1_model-t0_model)]
                        rho=[]
                        T=[]
            T_unit=sefiles.get('temperature_unit')
            labeldone=False
                        for k in range(len(model_list)):
                t9=np.array(T1[k])*T_unit/1e9
                T.append(max(t9))
                rho.append(max(rho1[k]))
            label=str(mini)+'$M_{\odot}$, Z='+str(zini)
            plt.plot(T,rho,label=label,color=color[i],marker=marker[i],markevery=markevery)                 
        plt.xlabel('$T_{9,max} (GK)$')
        plt.ylabel(r'$\rho [cm^{-3}]$')
        plt.yscale('log')
        plt.xscale('log')
        plt.legend(loc=2)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号