Skip to content

Commit

Permalink
Add zone_frac to kips
Browse files Browse the repository at this point in the history
we will multiply the number of zones plotted by 1/zone_frac
  • Loading branch information
rjfarmer committed Feb 21, 2018
1 parent 8d59353 commit a59d116
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions mesaPlot/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -1880,27 +1880,27 @@ def plotHistory(self,m,xaxis='model_number',y1='star_mass',y2=None,show=True,

def plotKip(self,m,show=True,reloadHistory=False,xaxis='num',ax=None,xrng=[None,None],mix=None,show_mix=True,
cmin=None,cmax=None,burnMap=[mpl.cm.Purples_r,mpl.cm.hot_r],fig=None,yrng=None,ylabel=None,
show_mass_loc=False,show_mix_labels=True,mix_alpha=1.0,step=1,y2=None,title=None,y2rng=None):
show_mass_loc=False,show_mix_labels=True,mix_alpha=1.0,step=1,y2=None,title=None,y2rng=None,zone_frac=1.0):

self.plotKip3(m,plot_type='history',xaxis='model_number',show=show,
reloadHistory=reloadHistory,ax=ax,mod_min=xrng[0],mod_max=xrng[1],show_mix=show_mix,mix=mix,
cmin=cmin,cmax=cmax,cmap=burnMap,fig=fig,yrng=yrng,ylabel=ylabel,
show_mass_loc=show_mass_loc,show_mix_labels=show_mix_labels,mix_alpha=mix_alpha,
xstep=step,y2=y2,title=title,y2rng=y2rng)
xstep=step,y2=y2,title=title,y2rng=y2rng,zone_frac=zone_frac)

def plotKip2(self,m,show=True,reloadHistory=False,xaxis='num',ageZero=0.0,ax=None,xrng=[None,None],mix=None,
cmin=None,cmax=None,burnMap=[mpl.cm.Purples_r,mpl.cm.hot_r],fig=None,yrng=None,
show_mix=True,show_burn=True,
show_mass_loc=False,show_mix_labels=True,mix_alpha=1.0,step=1,max_mass=99999.0,age_collapse=False,age_log=True,age_reverse=False,
mod_out=None,xlabel=None,title=None,colorbar=True,burn=True,end_time=None,ylabel=None,age_zero=None,y2=None,y2rng=None):
mod_out=None,xlabel=None,title=None,colorbar=True,burn=True,end_time=None,ylabel=None,age_zero=None,y2=None,y2rng=None,zone_frac=1.0):

self.plotKip3(m,plot_type='history',xaxis='star_age',show=show,
reloadHistory=reloadHistory,ax=ax,mod_min=xrng[0],mod_max=xrng[1],show_mix=show_mix,mix=mix,
cmin=cmin,cmax=cmax,cmap=burnMap,fig=fig,yrng=yrng,
show_mass_loc=show_mass_loc,show_mix_labels=show_mix_labels,mix_alpha=mix_alpha,
xstep=step,y2=y2,title=title,y2rng=y2rng,colorbar=colorbar,ylabel=ylabel,
age_zero=age_zero,age_lookback=age_collapse,age_log=age_log,age_reverse=age_reverse,
mod_index=mod_out,xlabel=xlabel,show_burn=burn,end_time=end_time)
mod_index=mod_out,xlabel=xlabel,show_burn=burn,end_time=end_time,zone_frac=zone_frac)


#Will replace plotKip and plotKip2 when finished
Expand All @@ -1913,7 +1913,7 @@ def plotKip3(self,m,plot_type='history',xaxis='model_number',yaxis='mass',zaxis=
cmin=None,cmax=None,cmap=[mpl.cm.Purples_r,mpl.cm.hot_r],colorbar=True,cbar_label=None,
show_mass_loc=False,show_mix_labels=True,mix_alpha=1.0,
age_lookback=False,age_log=True,age_reverse=False,age_units='years',end_time=None,age_zero=None,
y2=None,y2rng=None,mod_index=None,zlog=False):
y2=None,y2rng=None,mod_index=None,zlog=False,zone_frac=1.0):

if fig==None:
fig=plt.figure(figsize=(12,12))
Expand Down Expand Up @@ -1962,7 +1962,7 @@ def plotKip3(self,m,plot_type='history',xaxis='model_number',yaxis='mass',zaxis=
mix_data=[]

#Number of zones to plot
num_zones=np.max(m.hist.num_zones)
num_zones=np.max(m.hist.num_zones) * 1.0/zone_frac

if plot_type=='history':
if xaxis=='model_number':
Expand Down

0 comments on commit a59d116

Please sign in to comment.