jwst icon indicating copy to clipboard operation
jwst copied to clipboard

'Failed to achieve required error tolerance' in tweakreg step

Open thomaswilliamsastro opened this issue 2 years ago • 4 comments

With the latest pipeline version, there's an error in the update_fits_wcsinfo call in tweakreg_step:

RuntimeError: Failed to achieve required error tolerance

which as far as I know is due to the new gwcs update. Currently the pipeline just catches the error and warns, but as far as I understand this means the forward facing WCS in the fits files are not updated. This may just be a case of increasing the tolerance, but presumably this should be updated to not consistently fail, instead of just catching the error

thomaswilliamsastro avatar Sep 13 '22 09:09 thomaswilliamsastro

Boosting max_pix_error up to 0.05 from 0.005 does appear to fix this

thomaswilliamsastro avatar Sep 13 '22 09:09 thomaswilliamsastro

Yes, we're aware of this issue, which did in fact arise in the most recent release of the gwcs package. We have PR's in progress to try to optimize the fitting tolerances in order to reduce the number of failures. Note that the inclusion of a FITS SIP solution is being done just as a convenience for users who want to be able to do things like get moderately accurate coordinate readback from tools like ds9 (which of course doesn't yet understand gwcs models) and is not intended to be a highly accurate form of the WCS. In all cases the transforms stored in the wcs object in the data product should be used to obtain the most accurate coordinates. Do not rely on the FITS WCS representations.

hbushouse avatar Sep 13 '22 12:09 hbushouse

#7038 was just merged, which contains updates to relax the tolerances on the SIP fitting in tweakreg. Let us know if that updates is sufficient to fix the problems you were seeing.

hbushouse avatar Sep 14 '22 15:09 hbushouse

Unfortunately not, for a F335M mosaic (the 30Dor observations), I'm still getting a lot of:

2022-09-20 14:50:21,002 - stpipe.TweakRegStep - WARNING - The fit may be poorly conditioned

2022-09-20 14:50:21,004 - stpipe.TweakRegStep - WARNING - Failed to update 'meta.wcsinfo' with FITS SIP approximation. Reported error is: 2022-09-20 14:50:21,005 - stpipe.TweakRegStep - WARNING - "Failed to achieve required error tolerance"

errors popping up

thomaswilliamsastro avatar Sep 20 '22 12:09 thomaswilliamsastro

I've updated to the latest pipeline version and I'm not seeing this error message any more. Happy to close

thomaswilliamsastro avatar Feb 25 '23 02:02 thomaswilliamsastro