kevin218 / Eureka

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

Added new centroiding method mgmc and fixed bugs. #509

Closed isaedelman closed 1 year ago

isaedelman commented 1 year ago

Stage3 is having an issue with the method used for centroiding. The method currently used is fgc it is also the cuase of the issue. When running SW photometry fgc struggles with centroiding. So I added a new method mgmc. This new method is called mgmc and uses gaussian centroiding. This allows for the detection of a centroid location x, y. Along with 1-sig gaussian widths sx, sy. This enables the code to correclty find the source in the calints files. Allowing for a more precise and fucntioning method for SW photometry. Bugs were also addressed such as masking NANs and plotting figures.

This pull request resolves #470 by implementing a new centroiding method that does not suffer from the same bug and uses other open source software.

flake8 and pytest both pass on my machine, and I have documented all new .ecf parameters in the docs. I have also written doc strings for all new functions.

On my laptop the new mgmc method takes (109.72 min) to run while the old fgc method takes (108.68 min) to run (used 1681 integrations for time trials). But the mgmc method works while the fgc method fails.

isaedelman commented 1 year ago

Here is an example of the (fgc method) output with figures 3108 & 3109: Figure(3108): fig3108-1D_LC

Figure(3109): fig3109-Centroid

isaedelman commented 1 year ago

Here is an example of the (mgmc method) output with figures 3108 & 3109:

Figure(3108): fig3108-1D_LC

Figure(3109): fig3109-Centroid

taylorbell57 commented 1 year ago

So GitHub's automated tests don't seem to like forks... I can confirm flake8 passes right now, and am running pytest locally now

taylorbell57 commented 1 year ago

Can also confirm that all tests currently pass

taylorbell57 commented 1 year ago

Also, if the ctr_cutout_size values don't have the exact same meaning as in the 'fgc' method, please edit the description as needed in the ECF templates and in the ecf.rst file.

taylorbell57 commented 1 year ago

Finally, you'll also need to update the MIRI photometry ECF template and test ECF

taylorbell57 commented 1 year ago

All tests and flake8 pass successfully on my laptop - I'll read through the code when I get the time

taylorbell57 commented 1 year ago

Gah, it doesn't want to merge in automatically - I'll try fixing any conflicts in 1-2 hours

taylorbell57 commented 1 year ago

Huh, so it did successfully merge the code into main but somehow failed to acknowledge the fact that it did so... I'll just manually close this PR, but fear not, the code merged successfully and gave you credit where it was due