[yt-users] Trouble with SFR plots of enzo data

Munier Azzam Salem msalem at astro.columbia.edu
Tue Mar 5 10:42:38 PST 2013


I forgot to mention, the X-axis is time and the Y-axis is SFR (M_solar / yr)


On Tue, Mar 5, 2013 at 1:41 PM, Munier Azzam Salem <
msalem at astro.columbia.edu> wrote:

> Hey Guys,
>
>       I've been using yt's star analysis module to produce plots of SFR
> vs. time to compare the star formation histories across multiple runs. It
> works well except when it doesn't.
>
>      I've been working with enzo and for late time files (I believe
> produced after a run was restarted) the star formation history cuts off and
> drops to 0 for the earlier times. Weirder still, when I open earlier data
> files and plot them atop, the earlier results disagree! I attached a plot
> of this below.
>
>     Does anyone know what's happening here? Is there a better way to do
> this?
>
>      best,
>         Munier
>
>
> The Code:
>
>
> *import matplotlib as mpl*
> *mpl.use('agg')*
> *import matplotlib.pyplot as plt*
> *from yt.mods import **
> *from yt.analysis_modules.star_analysis.api import **
> *
> *
> *def SFR(fName,stroke):*
> *
> *
> *  # open file*
> *  try:*
> *    pf=load(fName)*
> *  except YTOutputNotIdentified:*
> *    return False*
> *
> *
> *  # calculate SFR*
> *  dd = pf.h.all_data()*
> *  sfr = StarFormationRate(pf,data_source=dd)*
> *
> *
> *  plt.plot(sfr.time,sfr.Msol_yr,stroke,linewidth=1)*
> *  return ( sfr.time.min() , sfr.time.max() )*
> *
> *
> *MaxVals = []*
> *SFR("../FIDUCIAL/DD0005/test_sim_0005","k-")*
> *SFR("../FIDUCIAL/DD0010/test_sim_0010","k-")*
> *SFR("../FIDUCIAL/DD0017/test_sim_0017","k-")*
> *
> *
> *plt.xlim((1.27E10,1.30E10))*
> *plt.savefig("SFR")*
>
>
>
> --
> Munier A. Salem // 845.489.6450
>



-- 
Munier A. Salem // 845.489.6450
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20130305/dab2f0ec/attachment.html>


More information about the yt-users mailing list