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

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


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
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20130305/af5c91b2/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: SFR.png
Type: image/png
Size: 36377 bytes
Desc: not available
URL: <http://lists.spacepope.org/pipermail/yt-users-spacepope.org/attachments/20130305/af5c91b2/attachment.png>


More information about the yt-users mailing list