Skip to content

Commit

Permalink
changed implementation of logs2 so it is per-mission/sector
Browse files Browse the repository at this point in the history
  • Loading branch information
hposborn committed Jul 10, 2024
1 parent 52f271c commit e786e11
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions MonoTools/fit.py
Original file line number Diff line number Diff line change
Expand Up @@ -1302,7 +1302,7 @@ def init_GP(self, n_draws=900, max_len_lc=25000, use_binned=False):
kernel = pymc_terms.SHOTerm(sigma=phot_sigma, w0=phot_w0, Q=1/np.sqrt(2))
self.gp['train'] = celerite2.pymc.GaussianProcess(kernel+ampl_mult_kernel*periodic_kernel,self.lc.time[mask].astype(floattype),
diag=self.lc.flux_err[mask].astype(floattype)**2 + \
pm.math.dot(self.lc.cadence_index[mask,:].astype(floattype),pm.math.exp(logs2)), quiet=True)
pm.math.dot(self.lc.cadence_index[mask,:].astype(floattype),pm.math.exp(logs2)), quiet=True)
elif hasattr(self,'rotation_kernel') and self.rotation_kernel is not None:
#Building a purely rotational kernel
rotation_period=pm.Normal("rotation_period",mu=self.rotation_kernel['period'],sigma=self.rotation_kernel['period_err'])
Expand Down Expand Up @@ -1338,7 +1338,8 @@ def init_GP(self, n_draws=900, max_len_lc=25000, use_binned=False):

#self.gp['train'].log_likelihood(self.lc.flux[mask].astype(floattype) - phot_mean)
self.gp['train'].compute(self.lc.time[mask].astype(floattype),
yerr=np.sqrt(self.lc.flux_err[mask].astype(floattype) ** 2 + pm.math.exp(logs2)**2), quiet=True)
yerr=np.sqrt(self.lc.flux_err[mask].astype(floattype) ** 2 + pm.math.dot(self.lc.cadence_index[mask,:].astype(floattype),pm.math.exp(logs2))**2),
quiet=True)

loglik=self.gp['train'].marginal("loglik",observed=self.lc.flux[mask].astype(floattype))

Expand Down

0 comments on commit e786e11

Please sign in to comment.