Skip to content

Commit 3388eb8

Browse files
committed
Fix indexing bugs
Works on #33
1 parent a75b78c commit 3388eb8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

mesaPlot/plot.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2493,7 +2493,7 @@ def _showMassLoc(self, m, fig, ax, x, modInd):
24932493
continue
24942494

24952495
if np.any(y):
2496-
ax.plot(x, y, color=self.colors[val["color"]], linewidth=5)
2496+
ax.plot(x[modInd], y, color=self.colors[val["color"]], linewidth=5)
24972497
l.append(name)
24982498
c.append(self.colors[val["color"]])
24992499

@@ -5997,8 +5997,10 @@ def _rebinKipDataX(self, data, x, lin_x, nan=False, nan_value=1):
59975997
sorter = np.argsort(x)
59985998
ind = np.searchsorted(x, lin_x, sorter=sorter, side="left")
59995999

6000-
6001-
s_ind = sorter[ind]
6000+
try:
6001+
s_ind = sorter[ind]
6002+
except IndexError:
6003+
raise ValueError("Trying to resolved too small a timestep given the age of the star, you must pick a smaller range of models to show.")
60026004

60036005
# When flipping the ages we may end up with points at the edge
60046006
# so just make sure we dont go out of bound (searcgsoretd returns N if no suitable match found)

0 commit comments

Comments
 (0)