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

WCS corruption after opening image with bad header #2395

Open
tvwenger opened this issue Jun 28, 2024 · 0 comments
Open

WCS corruption after opening image with bad header #2395

tvwenger opened this issue Jun 28, 2024 · 0 comments

Comments

@tvwenger
Copy link

tvwenger commented Jun 28, 2024

Describe the bug
When opening an image with a bad header (in my case, the cube had "CTYPE1" = "RA-TAN" instead of "RA---TAN" and "CTYPE2" = "DEC-TAN" instead of "DEC--TAN"), CARTA complains about the WCS and fails to properly label the coordinates of the data. That's fine, as it's a problem with the data header.

The problem, however, is that any subsequent images (with good headers) opened in that same CARTA session also fail to properly load the WCS. That is, if I close the original (bad) image and open a different image (with a correct header), no proper coordinates are displayed for the image.

To Reproduce
Steps to reproduce the behavior:

  1. Open this FITS cube with a good header in CARTA. Everything is fine.
  2. Close that image, then open this FITS cube with a bad header. The CARTA log complains about the WCS, and CARTA fails to generate a coordinate system.
  3. Close that image, and open the original good header image again. There are no errors in the CARTA log, and yet CARTA fails to generate a coordinate system.

Expected behavior
Whether or not a bad header was loaded should not impact CARTA's ability to load subsequent image coordinates within the same session.

Platform info (please complete the following information):

  • OS [e.g. macOS Monterey]: Ubuntu/WSL
  • Browser [e.g. chrome, safari, electron app]: Firefox
  • Browser version [e.g. 22]: 127.0.2
  • Backend branch [e.g. dev, v3b2 release]: 4.1.0
  • Frontend branch [e.g. dev, v3b2 release]: 4.1.0

Additional context
Here's the CARTA log when opening the "bad header" image:

[2024-06-28 16:14:13.239Z] [CARTA] [info] Session 2312038391 [172.28.128.1] Connected. Num sessions: 1
[2024-06-28 16:14:27.120Z] [CARTA] [info] Could not find BEAMS table.
[2024-06-28 16:14:27.132Z] [CARTA] [warning] [casacore] Zero or no rest frequency provided for velocity axis.
[2024-06-28 16:14:27.135Z] [CARTA] [warning] [casacore] Zero or no rest frequency provided for velocity axis.
[2024-06-28 16:14:27.307Z] [CARTA] [warning] Session 2312038391: Image has no beam information.
[2024-06-28 16:14:55.359Z] [CARTA] [info] Could not find BEAMS table.
[2024-06-28 16:14:55.361Z] [CARTA] [info] [casacore] FITS card 8: CRVAL1  =                    0
[2024-06-28 16:14:55.361Z] [CARTA] [info] [casacore] Keyword value has wrong data type.
[2024-06-28 16:14:55.361Z] [CARTA] [info] [casacore] ... converted to type double.
[2024-06-28 16:14:55.361Z] [CARTA] [info] [casacore] FITS card 9: CRVAL2  =                    0
[2024-06-28 16:14:55.361Z] [CARTA] [info] [casacore] Keyword value has wrong data type.
[2024-06-28 16:14:55.361Z] [CARTA] [info] [casacore] ... converted to type double.
[2024-06-28 16:14:55.362Z] [CARTA] [info] [casacore] FITS card 10: CRVAL3  =                   20
[2024-06-28 16:14:55.362Z] [CARTA] [info] [casacore] Keyword value has wrong data type.
[2024-06-28 16:14:55.362Z] [CARTA] [info] [casacore] ... converted to type double.
[2024-06-28 16:14:55.369Z] [CARTA] [info] [casacore] FITS card 8: CRVAL1  =                    0
[2024-06-28 16:14:55.369Z] [CARTA] [info] [casacore] Keyword value has wrong data type.
[2024-06-28 16:14:55.369Z] [CARTA] [info] [casacore] ... converted to type double.
[2024-06-28 16:14:55.369Z] [CARTA] [info] [casacore] FITS card 9: CRVAL2  =                    0
[2024-06-28 16:14:55.369Z] [CARTA] [info] [casacore] Keyword value has wrong data type.
[2024-06-28 16:14:55.369Z] [CARTA] [info] [casacore] ... converted to type double.
[2024-06-28 16:14:55.369Z] [CARTA] [info] [casacore] FITS card 10: CRVAL3  =                   20
[2024-06-28 16:14:55.369Z] [CARTA] [info] [casacore] Keyword value has wrong data type.
[2024-06-28 16:14:55.369Z] [CARTA] [info] [casacore] ... converted to type double.
[2024-06-28 16:14:55.369Z] [CARTA] [info] [casacore] Header
CTYPE2  = 'DEC-TAN '
was interpreted as
CTYPE2  = 'DEC--TAN'
[2024-06-28 16:14:55.369Z] [CARTA] [info] [casacore] celfix incurred the error Inconsistent or unrecognized coordinate axis types
[2024-06-28 16:14:55.369Z] [CARTA] [info] [casacore] cylfix incurred the error Inconsistent or unrecognized coordinate axis types
[2024-06-28 16:14:55.369Z] [CARTA] [warning] [casacore] The wcs function failures are too severe to continue ...
[2024-06-28 16:14:55.369Z] [CARTA] [warning] [casacore] No proper coordinate system defined in FITS file. Using dummy linear system instead.

N.B. CARTA seems to have figured out that "DEC-TAN" should be "DEC--TAN", but it did not do the same for "RA-TAN" to "RA---TAN", which is ultimately what caused the WCS failure.

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

No branches or pull requests

1 participant