Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TweakRegStep expands reference catalog when alignment fails #8078

Closed
stscijgbot-jp opened this issue Nov 17, 2023 · 7 comments
Closed

TweakRegStep expands reference catalog when alignment fails #8078

stscijgbot-jp opened this issue Nov 17, 2023 · 7 comments

Comments

@stscijgbot-jp
Copy link
Collaborator

Issue JP-3468 was created on JIRA by Varun Bajaj:

When running the TweakRegStep with expand_refcat=True, if aligning an image fails, its sources are still added to the reference catalog.  This breaks the astrometric consistency of the reference catalog, and the next image(s) can lock onto these unaligned sources (or just not match and add even more unaligned sources).  This can cause a cascade of misaligned images that can report the alignment as successful.  

 

I think this can be fixed in tweakwcs.imalign.align_wcs by adding an extra condition to line 698:

if expand_refcat &  (wcat.corrector.meta['fit_info'] == 'SUCCESS'): ```
 

If test data is necessary I can provide some, however this is a general behavior that can probably be replicated by setting the tolerance/sigma of the TweakRegStep quite low, so the alignment would fail anyway.

 

It would also be nice to have an option to write out the final reference catalog, but I understand that's out of the scope of a single ticket.
@stscijgbot-jp
Copy link
Collaborator Author

Comment by Varun Bajaj on JIRA:

I believe Mihai Cara is the relevant dev here.

@stscijgbot-jp
Copy link
Collaborator Author

Comment by Mihai Cara on JIRA:

Thanks for reporting this issue. Proposed fix may solve the issue of adding catalogs that failed alignment to the reference catalog. However it would also result in subsets of images that do not overlap to the first group of images to be skipped.

That is, let's say im1, im2, and im3 overlap and im4 and im5 also overlap (among themselves but not with any im1-3). Then im4 would not be added to the reference catalog and therefore im5 would fail to align to im4.

The fix will have to be a little bit more complex in order to detect these situations.

@stscijgbot-jp
Copy link
Collaborator Author

Comment by Mihai Cara on JIRA:

spacetelescope/tweakwcs#195 fixes this issue.

@stscijgbot-jp
Copy link
Collaborator Author

Comment by Mihai Cara on JIRA:

A new release of tweakwcs will be needed  once this fix is tested.

@hbushouse hbushouse added this to the Build 10.2 milestone Jan 8, 2024
@stscijgbot-jp
Copy link
Collaborator Author

stscijgbot-jp commented Jan 23, 2024

Comment by Howard Bushouse on JIRA:

Mihai Cara Has there been a new release of tweakwcs that contains the fix? It looks like it may have been included in 0.8.6?

@stscijgbot-jp
Copy link
Collaborator Author

stscijgbot-jp commented Jan 24, 2024

Comment by Mihai Cara on JIRA:

https://tweakwcs.readthedocs.io/en/latest/source/CHANGELOG.html#january-2024

It looks like it may have been included in 0.8.6?

That's correct.

@stscijgbot-jp
Copy link
Collaborator Author

Comment by Jo Taylor on JIRA:

Varun Bajaj did you find that this issue was fixed in the latest jwst version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants