Skip to content

Commit a59d116

Browse files
committed
Add zone_frac to kips
we will multiply the number of zones plotted by 1/zone_frac
1 parent 8d59353 commit a59d116

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

mesaPlot/plot.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1880,27 +1880,27 @@ def plotHistory(self,m,xaxis='model_number',y1='star_mass',y2=None,show=True,
18801880

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

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

18911891
def plotKip2(self,m,show=True,reloadHistory=False,xaxis='num',ageZero=0.0,ax=None,xrng=[None,None],mix=None,
18921892
cmin=None,cmax=None,burnMap=[mpl.cm.Purples_r,mpl.cm.hot_r],fig=None,yrng=None,
18931893
show_mix=True,show_burn=True,
18941894
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,
1895-
mod_out=None,xlabel=None,title=None,colorbar=True,burn=True,end_time=None,ylabel=None,age_zero=None,y2=None,y2rng=None):
1895+
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):
18961896

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

19051905

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

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

19641964
#Number of zones to plot
1965-
num_zones=np.max(m.hist.num_zones)
1965+
num_zones=np.max(m.hist.num_zones) * 1.0/zone_frac
19661966

19671967
if plot_type=='history':
19681968
if xaxis=='model_number':

0 commit comments

Comments
 (0)