radicamc / exoTEDRF

Tools for end-to-end reduction of JWST exoplanet observations
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Issue with stage 4 lightcurve modeling #21

Open suman-phy opened 4 days ago

suman-phy commented 4 days ago

I'm facing a problem while running Stage 4 to fit the lightcurves using fit_lightcurves.py and fit_lightcurves.yaml. It is unable to fit the mid-transit time. There is always a large random shift in the time axis.

radicamc commented 4 days ago

Can you provide some more information about this? I have never encountered such an issue before.

suman-phy commented 4 days ago

I'm working on a NIRSpec/G395 transmission spectra. The stage1 to stage 3 of data reduction worked perfectly. However, at stage 4, I'm using the 'fit_lightcurves' files with the default set of model parameters, but it is never able to fit the lightcurves. There seems to be always some error with the mid-transit time (see the figure), and the shift is also not constant between each trial.

image

radicamc commented 3 days ago

What do you mean by the "default set of model parameters"? Are you attempting to fit the mid-transit time, or fixing it? Are you able to produce some minimal working example that reproduces this issue? That would be the easiest way to diagnose what is going wrong here.

suman-phy commented 3 days ago

I'm trying to fit the mid-transit time. Below is how my ''Fit Priors + Parameters'' look like.

params : ['per_p1', 't0_p1', 'rp_p1', 'inc_p1', 'u1_inst', 'u2_inst', 'ecc_p1', 'w_p1', 'a_p1', 'sigma_inst'] dists : ['fixed', 'uniform', 'uniform', 'fixed', 'uniform', 'uniform', 'fixed', 'fixed', 'fixed', 'loguniform'] values : [3.3448285, [60010, 60012], [0.08, 0.16], 85.7, [0., 1.], [0., 1.], 0.0, 90., 7.17, [0.000001, 0.1]]

The mid-transit time is approx. 60010.5. Below is the corner plot from the fit.

image

I've tried changing the priors widely and even ran on the other set, i.e. nrs2. However, the problem persists. It seems like the model isn't generating a transit function to fit the data, although I've selected lc_model_type : 'transit'

radicamc commented 3 days ago

No, I don't think the issue is that the code is producing an eclipse as opposed to a transit model. Have you tried fixing the mid-transit time to the value that you expect? What happens then? Also, from where are you getting the expected mid-transit time? Does this come from a white light curve fit, or is it a literature value? If it's a literature value, keep in mind that the JWST timestamps are in MJD, so BJD-2450000.5. Also, where do the fixed a/R* and inclination values come from? Are they from the white light curve fit? How does the white light fit look?

suman-phy commented 3 days ago

Fixing the mid-transit doesn't change anything either (see below).

image

The expected mid-transit time is from the JWST time-stamps in MJD. The fixed a/R* and inclination values are from literature. I have also tried keeping them free, but that does not work either.

The white and chromatic lightcurve fits using Eureka! looks just fine (see below), which uses similar priors. However, I haven't been able to produce any correct fit using exoTEDRF yet.

fig5101_ch00_lc_dynesty

radicamc commented 3 days ago

Interesting. Would you be willing to share with me the exact fit_lightcurves files that you're using as well as some example light curves (just a couple would be fine) so that I can try and reproduce this? It's difficult for me to diagnose what could be going wrong without knowing exactly what you're doing. If so, you can send everything to radicamc@uchicago.edu, or share whatever private google drive, dropbox etc, link that you wish.