gbrammer / grizli

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

Bug when fitting EAZY photoz with NIRISS data #215

Closed TheSkyentist closed 4 months ago

TheSkyentist commented 4 months ago

When attempting to prepare for redshift fitting with grizli, I run auto_script.generate_fit_params with the include_photometry flag set to True. This causes an error when the code attempts to run eazy.photoz.PhotoZ: https://github.com/gbrammer/grizli/blob/2ed70d9bfa284309364b8ae7148ffed2a4570271/grizli/pipeline/photoz.py#L397 The following error is retrieved:

ValueError: No valid filters found in [root]_phot_apcorr.fits!  Check that all flux and uncertainty columns are specified / translated correctly.

This is because NIRISS filters have an additional N aggregated onto the names (known to cause problems elsewhere, see #191). The translation list will need to be updated with the additional N aggregated onto the filter names: https://github.com/gbrammer/grizli/blob/2ed70d9bfa284309364b8ae7148ffed2a4570271/grizli/pipeline/photoz.py#L258 In addition, "-CLEAR" is not properly stripped from filter names when making the combined catalog, causing further issues. I will issue a PR to fix both of these issues.