Skip to content

Commit 09e37d0

Browse files
committed
corr v2
Updated the correction file slightly to account for some likely metallicity dependence and modified behavior slightly near the turnoff. Also fixed a weird bug where passing an integer value for `eep` to `Isochrone` could cause the interpolation to fail.
1 parent 35d715e commit 09e37d0

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

brutus/seds.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,6 +267,7 @@ def build_interpolator_corr(self):
267267
# Set label references.
268268
self.logt_idx = np.where(np.array(self.predictions) == 'logt')[0][0]
269269
self.logl_idx = np.where(np.array(self.predictions) == 'logl')[0][0]
270+
self.logg_idx = np.where(np.array(self.predictions) == 'logg')[0][0]
270271

271272
def get_predictions(self, labels, apply_corr=True):
272273
"""
@@ -308,6 +309,7 @@ def get_predictions(self, labels, apply_corr=True):
308309
dlogt, dlogr = corrs.T
309310
preds[:, self.logt_idx] += dlogt
310311
preds[:, self.logl_idx] += 2. * dlogr
312+
preds[:, self.logg_idx] -= 2. * dlogr
311313

312314
return preds
313315

@@ -1107,7 +1109,7 @@ def build_interpolator(self):
11071109
# Fill in "holes".
11081110
for i in range(len(self.feh_u)):
11091111
for j in range(len(self.loga_u)):
1110-
# Select values where one or more predictions "failed".
1112+
# Select values where predictions exist.
11111113
sel = np.all(np.isfinite(self.pred_grid[i, j]), axis=1)
11121114
# Linearly interpolate over built-in EEP grid.
11131115
pnew = np.array([np.interp(self.eep_u, self.eep_u[sel], par,
@@ -1199,6 +1201,7 @@ def get_predictions(self, feh=0., loga=8.5, eep=None, apply_corr=True):
11991201
# Fill out input labels.
12001202
if eep is None:
12011203
eep = self.eep_u
1204+
eep = np.array(eep, dtype='float')
12021205
feh = np.full_like(eep, feh)
12031206
loga = np.full_like(eep, loga)
12041207
labels = np.c_[feh, loga, eep]
@@ -1213,6 +1216,7 @@ def get_predictions(self, feh=0., loga=8.5, eep=None, apply_corr=True):
12131216
dlogt, dlogr = corrs.T
12141217
preds[:, self.logt_idx] += dlogt
12151218
preds[:, self.logl_idx] += 2. * dlogr
1219+
preds[:, self.logg_idx] -= 2. * dlogr
12161220

12171221
return preds
12181222

@@ -1318,6 +1322,7 @@ def get_seds(self, feh=0., loga=8.5, eep=None, av=0., rv=3.3, smf=0.,
13181322
# Initialize EEPs.
13191323
if eep is None:
13201324
eep = self.eep_u
1325+
eep = np.array(eep, dtype='float')
13211326
Neep = len(eep)
13221327

13231328
# Generate predictions.

0 commit comments

Comments
 (0)