jwst
jwst copied to clipboard
'Failed to achieve required error tolerance' in tweakreg step
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
Boosting max_pix_error
up to 0.05 from 0.005 does appear to fix this
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.
#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.
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
I've updated to the latest pipeline version and I'm not seeing this error message any more. Happy to close