dfm / tess-atlas

MIT License
9 stars 8 forks source link

Compute GP in post-processing #173

Closed avivajpeyi closed 2 years ago

avivajpeyi commented 2 years ago

For helping debug some fits in #167

Trying to use the same code that is used to compute lightcurve models during postprocessing.

Maybe either

Option 1:

        gp = GaussianProcess(
            kernel, t=t, diag=yerr ** 2 + jitter_prior ** 2, mean=lightcurve
        )
        my_planet_transit_model.gp_mu = gp.predict(y, t=t, return_var=False)

or Option 2:

        gp = GaussianProcess(
            kernel, t=t, diag=yerr ** 2 + jitter_prior ** 2, mean=lightcurve
        )
        my_planet_transit_model.gp = gp

Option 1 will allow me to get the GP mu values for each sample, while Option 2 will allow me to get the GP itself (another step will be required to compute the GP mu/var/sigma)

avivajpeyi commented 2 years ago

Woops, Option 1 wont work because the GaussianProcess(... mean=lightcurve), hence the lightcurve is also accounted for in the GP

Screenshot 2022-01-18 at 1 13 25 PM Screenshot 2022-01-18 at 1 13 14 PM Screenshot 2022-01-18 at 12 52 34 PM

avivajpeyi commented 2 years ago

nvm! I figured it out -->

gp.predict(residual, t=t, return_var=False)

I was fitting the raw data previously instead of the residual of y-lc!

The updated fit:

Screenshot 2022-01-18 at 1 59 15 PM