kevin218 / Eureka

Eureka! is a data reduction and analysis pipeline intended for time-series observations with JWST.
https://eurekadocs.readthedocs.io/
MIT License
58 stars 45 forks source link

[Bug]: S4 wave_1d_trimmed variable #537

Closed taylorbell57 closed 1 year ago

taylorbell57 commented 1 year ago

FAQ check

Instrument

Other (any stage)

What happened?

In Stage 3 and 4, with some MIRI observations I get ~4 crazy noisy columns in my 2D lightcurves. Initially I thought there was something wrong with the data, but if in Stage 4 I change the wave_min to 7 instead of 5, then the left four columns of the 2D lightcurve are still horribly bad even though they were fine in the previous plot. Clearly there must be a bug in the normalization function or something.

With wave_min set to 5: fig4101_2D_LC

With wave_min set to 7: fig4101_2D_LC

Error traceback output

No response

What operating system are you using?

No response

What version of Python are you running?

No response

What Python packages do you have installed?

Using the version of Eureka! from the dev/tjb branch, but with all the installed packages I've been using for months (so other package updates can't be the cause).

Code of Conduct

taylorbell57 commented 1 year ago

Hmm, or perhaps it's an issue with not removing the columns requested and then mis-labelling the x-axis. By my eye, the 2D lightcurve has about the same number of pixels so it may not have actually been trimmed

taylorbell57 commented 1 year ago

Aha, for some reason the wavelength array gets trimmed too early and as a result the 2D image doesn't get trimmed for the 2D lightcurve figure.

https://github.com/kevin218/Eureka/blob/0463d1070fd4486d61da60c67c9cd82f5cd862cf/src/eureka/S4_generate_lightcurves/s4_genLC.py#L167-L169

https://github.com/kevin218/Eureka/blob/0463d1070fd4486d61da60c67c9cd82f5cd862cf/src/eureka/S4_generate_lightcurves/s4_genLC.py#L384-L385

https://github.com/kevin218/Eureka/blob/0463d1070fd4486d61da60c67c9cd82f5cd862cf/src/eureka/S4_generate_lightcurves/plots_s4.py#L177-L183

Deleting the first collection of lines linked above takes care of the issue.