Skip to content

Commit

Permalink
DerivedQuantities now yields total heat in units of energy/time/co-mo…
Browse files Browse the repository at this point in the history
…ving volume, not proper volume.
  • Loading branch information
mirochaj committed Sep 10, 2015
1 parent 209415d commit 9269b9b
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
5 changes: 3 additions & 2 deletions ares/analysis/DerivedQuantities.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,9 @@ def total_heat(data):

n = data['igm_n_%s' % sp]

# Multiply by number density of absorbers
heat += n * data[heat_by_pop]
# Multiply by number density of absorbers, convert to
# co-moving units
heat += n * data[heat_by_pop] / (1. + data['z'])**3

return heat

Expand Down
2 changes: 1 addition & 1 deletion ares/analysis/Global21cmSet.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ def TurningPointConstraints(self, pts=None, mp=None, fig=1,
return mp

# Draw the 120 MHz cutoff for DARE
if pts == 'D' or list('BCD'):
if pts == 'D' or (pts == list('BCD')):
mp.grid[4].plot([120]*2, mp.grid[4].get_ylim(), color='k', ls='--')
mp.grid[10].plot([120]*2, mp.grid[10].get_ylim(), color='k', ls='--')

Expand Down
21 changes: 14 additions & 7 deletions ares/analysis/ModelSet.py
Original file line number Diff line number Diff line change
Expand Up @@ -2177,10 +2177,17 @@ def ContourScatter(self, x, y, c, z=None, Nscat=1e4, take_log=False,

return ax, scat, cb

def extract_panel(self, panel, mp, fig=99):
def extract_panel(self, panel, mp, rotate_x=45, rotate_y=45, ax=None,
fig=99):
"""
Save panel of a triangle plot as separate file.
panel : int, str
Integer or letter corresponding to plot panel you want.
mp : MultiPlot instance
Object representation of the triangle plot
fig : int
Figure number.
"""

Expand All @@ -2196,7 +2203,7 @@ def extract_panel(self, panel, mp, fig=99):

ax = self.PosteriorPDF(info['axes'], z=info['z'], bins=info['bins'],
multiplier=info['multiplier'], take_log=info['take_log'],
fig=fig, **kw)
fig=fig, ax=ax, **kw)

ax.set_xticks(mp.grid[panel].get_xticks())
ax.set_yticks(mp.grid[panel].get_yticks())
Expand All @@ -2205,13 +2212,13 @@ def extract_panel(self, panel, mp, fig=99):
for i, x in enumerate(mp.grid[panel].get_xticklabels()):
xt.append(x.get_text())

ax.set_xticklabels(xt)
ax.set_xticklabels(xt, rotation=rotate_x)

yt = []
for i, x in enumerate(mp.grid[panel].get_yticklabels()):
yt.append(x.get_text())

ax.set_yticklabels(yt)
ax.set_yticklabels(yt, rotation=rotate_y)

ax.set_xlim(mp.grid[panel].get_xlim())
ax.set_ylim(mp.grid[panel].get_ylim())
Expand All @@ -2223,9 +2230,9 @@ def extract_panel(self, panel, mp, fig=99):
def TrianglePlot(self, pars=None, z=None, panel_size=(0.5,0.5),
padding=(0,0), show_errors=False, take_log=False, multiplier=1,
fig=1, inputs={}, tighten_up=0.0, ticks=5, bins=20, mp=None, skip=0,
skim=1, top=None, oned=True, twod=True, filled=True, box=None, rotate_x=45,
rotate_y=45, add_cov=False, label_panels='upper right', fix=True,
skip_panels=[], stop=None, **kwargs):
skim=1, top=None, oned=True, twod=True, filled=True, box=None,
rotate_x=45, rotate_y=45, add_cov=False, label_panels='upper right',
fix=True, skip_panels=[], stop=None, **kwargs):
"""
Make an NxN panel plot showing 1-D and 2-D posterior PDFs.
Expand Down

0 comments on commit 9269b9b

Please sign in to comment.