Skip to content

Commit

Permalink
Fix exception when missing mixing_region or burning_region from histo…
Browse files Browse the repository at this point in the history
…ry data
  • Loading branch information
rjfarmer committed Nov 10, 2017
1 parent 875e20b commit 6d6475c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
9 changes: 8 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,14 @@ p.plotHR(m)

[More on Kippenhan plots](docs/kipp.md)

Kippenhan plot with model number vs mass
Kippenhan plot with model number vs mass. Note all Kippenhan plots
require your history file to have both mixing_regions X and burning_regions Y
set in your history_columns.list file, where X and Y are integers that
specify the maximum number of mixing/burning
zones in your model, values around 20 will usually suffice. Models going to
core collapse may want to increase this limit to 40.


````python
import mesaPlot as mp
m=mp.MESA()
Expand Down
4 changes: 2 additions & 2 deletions mesaPlot/plot.py
Original file line number Diff line number Diff line change
Expand Up @@ -2159,7 +2159,7 @@ def _rebinKipqDataNoModInd(self,m,qtype,z,y):
try:
x = m.hist.data[qtop+"1"]
except ValueError:
raise("No field "+qtop+"* found, add mixing_regions 40 and burning_regions 40 to your history_columns.list")
raise KeyError("No field "+qtop+"* found, add mixing_regions 40 and burning_regions 40 to your history_columns.list")


numBurnZones=int([xx.split('_')[2] for xx in m.hist.data.dtype.names if qtop in xx][-1])
Expand All @@ -2182,7 +2182,7 @@ def _rebinKipqDataWithModInd(self,m,qtype,z,y,modInd):
try:
x = m.hist.data[qtop+"1"]
except ValueError:
raise("No field "+qtop+"* found, add mixing_regions 40 and burning_regions 40 to your history_columns.list")
raise KeyError("No field "+qtop+"* found, add mixing_regions 40 and burning_regions 40 to your history_columns.list")


numBurnZones=int([xx.split('_')[2] for xx in m.hist.data.dtype.names if qtop in xx][-1])
Expand Down

0 comments on commit 6d6475c

Please sign in to comment.