nugrid_set.py 文件源码

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

项目:NuGridPy 作者: NuGrid 项目源码 文件源码
def plot_TPDCZ(self,fig=13,marker=[]):

        '''Plots TPDCZ vs TP'''

        minis=[]
        for hh in range(len(self.run_historydata)):
                historydata=self.run_historydata[hh]
                sefiles_out=se(self.runs_H5_out[hh])
                sefiles=sefiles_out
                mini=float(sefiles_out.se.get('mini'))
                zini=float(sefiles_out.se.get('zini'))
                label=str(mini)+'$M_{\odot}$, Z='+str(zini)
                minis.append(mini)
                TPstart,TPmods,TP_max_env,TPend,min_m_TP,max_m_TP,DUPmods,DUPm_min_h,c13_pocket_min,c13_pocket_max=self.TPAGB_properties(historydata,sefiles_out)

                ###Temperature

                pulse_peak_T=[]
                pulse_number=[]
                plt.figure(fig)
                for k in range(len(TPmods)):
                    model=int(float(TPmods[k]))
                    T_profile=sefiles_out.get(model,'temperature')*sefiles_out.get('temperature_unit')
                    mass=sefiles_out.get(model,'mass')
                    #plt.figure(2)
                    print 'testse'
                    print TPmods[k]
                    #plt.plot(mass,T_profile,label='cycle '+str(TPmods[k]),marker=marker[k],markevery=100)
                    #plt.figure(11)
                    #models=sefiles_out.se.cycles
                    #models=map(int,models)
                    #print 'model taken: ',models[min(range(len(models)), key=lambda i: abs(models[i]-model))]
                    idx_mass=min(range(len(mass)), key=lambda i: abs(mass[i]-min_m_TP[k]))  
                    pulse_peak_T.append(max(T_profile[idx_mass:]))
                    print k+1
                    print '{:.3E}'.format(T_profile[idx_mass])
                    pulse_number.append(k+1)

                plt.plot(pulse_number,pulse_peak_T,marker=marker[hh],linestyle='--',label=label)

                plt.legend()
                plt.ylabel('$T_{max,PDCZ}$')
                plt.xlabel('TP number')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号