[Yt-svn] yt: Small changes to StarAnalysis to make the output more reliable
hg at spacepope.org
hg at spacepope.org
Wed Jun 23 13:17:59 PDT 2010
hg Repository: yt
details: yt/rev/ccebcde75143
changeset: 1789:ccebcde75143
user: Stephen Skory <stephenskory at yahoo.com>
date:
Wed Jun 23 13:17:49 2010 -0700
description:
Small changes to StarAnalysis to make the output more reliable
(\t was resulting in over-lapping output).
diffstat:
yt/extensions/StarAnalysis.py | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diffs (21 lines):
diff -r 97fa3280f8bf -r ccebcde75143 yt/extensions/StarAnalysis.py
--- a/yt/extensions/StarAnalysis.py Tue Jun 22 15:59:19 2010 -0700
+++ b/yt/extensions/StarAnalysis.py Wed Jun 23 13:17:49 2010 -0700
@@ -127,7 +127,7 @@
# Use the center of the time_bin, not the left edge.
fp.write("#time\tlookback\tredshift\tMsol/yr\tMsol/yr/Mpc3\tMsol\tcumMsol\t\n")
for i, time in enumerate((self.time_bins[1:] + self.time_bins[:-1])/2.):
- line = "%1.5e\t%1.5e\t%1.5e\t%1.5e\t%1.5e\t%1.5e\t%1.5e\n" % \
+ line = "%1.5e %1.5e %1.5e %1.5e %1.5e %1.5e %1.5e\n" % \
(time * tc / YEAR, # Time
(self.time_now - time * tc)/YEAR, # Lookback time
self.cosm.ComputeRedshiftFromTime(time * tc), # Redshift
@@ -320,7 +320,7 @@
# Add this flux to the total, weighted by mass.
self.final_spec += na.power(10., int_flux) * star[4]
# Normalize.
- self.total_mass = sum(self.star_mass)
+ self.total_mass = na.sum(self.star_mass)
self.avg_mass = na.mean(self.star_mass)
tot_metal = sum(self.star_metal * self.star_mass)
self.avg_metal = math.log10(tot_metal / self.total_mass / Zsun)
More information about the yt-svn
mailing list