gbrammer / grizli

Grizli: The "Grism redshift and line" analysis software
MIT License
64 stars 50 forks source link

Optional 1/f when setting JWST/HST keywords #212

Closed TheSkyentist closed 2 months ago

TheSkyentist commented 4 months ago

Currently if set_jwst_to_hst_keywords is called before initialize_jwst_image then a 1/f correction is always applied. This can even lead to 1/f correction being applied twice. It would be good to allow the user to pass an option to disable this if they'd like. Otherwise this won't change any of the default behaviour.

gbrammer commented 4 months ago

This fix seems fine and relatively harmless, but it could be more automatic to also have exposure_oneoverf_correction first check for the presence of the ONEFEXP keyword in the file and then break out without doing anything if the keyword is found. And add an additional keyword option force that defaults to False in exposure_oneoverf_correction but that will redo the correction if True even if it had already been done previously.

TheSkyentist commented 4 months ago

This was a good suggestion. I've added the check against the ONEFEXP keyword, as well as adding a force option in the function.