Skip to content

Commit

Permalink
Column fix
Browse files Browse the repository at this point in the history
  • Loading branch information
bmorris3 committed Jan 27, 2021
1 parent d1ffd55 commit 1b5b612
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions linea/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,12 @@ def __init__(self, record_array={}, extra_basis_vectors=None,

for key in attrs:
if (hasattr(self.recs, 'columns') and
key in [i.name.lower() for i in self.recs.columns]):
setattr(self, key, self.recs[key])
key in [i.lower() for i in self.recs.names]):
setattr(self, key, self.recs[key.upper()])

# Catch case for renamed roll angle key in the PIPE outputs
elif (hasattr(self.recs, 'columns') and
'roll' in [i.name.lower() for i in self.recs.columns]):
'roll' in [i.lower() for i in self.recs.names]):
setattr(self, 'roll_angle', self.recs['roll'])

self.time = (Time(self.bjd_time, format='jd')
Expand Down Expand Up @@ -504,11 +504,13 @@ def regress(self, design_matrix):
Covariance matrix for the least squares estimators
:math:`\sigma_{\hat{\beta}}^2`
"""
flux = np.concatenate([lc.flux for lc in self])
fluxerr = np.concatenate([lc.fluxerr for lc in self])
mask = np.concatenate([lc.mask for lc in self])

b, c = linreg(design_matrix,
np.concatenate(self.flux)[~mask],
np.concatenate(self.fluxerr)[~mask])
flux[~mask],
fluxerr[~mask])

return RegressionResult(design_matrix, b, c)

Expand Down

0 comments on commit 1b5b612

Please sign in to comment.