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

Improve error message when cannot find a named HDU in a fits file #78

Open
gsleap opened this issue Sep 24, 2024 · 1 comment
Open

Improve error message when cannot find a named HDU in a fits file #78

gsleap opened this issue Sep 24, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@gsleap
Copy link
Member

gsleap commented Sep 24, 2024

Example from @d3v-null:

03_mwalib.py test_files/1120082744/1120082744_DipAmps.metafits   
Traceback (most recent call last):
  File "/demo/03_mwalib.py", line 62, in <module>
    main()
  File "/demo/03_mwalib.py", line 48, in main
    ctx = MetafitsContext(metafits)
          ^^^^^^^^^^^^^^^^^^^^^^^^^
mwalib.MwalibError: src/metafits_context/mod.rs:682
test_files/1120082744/1120082744_DipAmps.metafits HDU 9999: Fits error: FitsError { status: 301, message: "illegal HDU number" }

In this case the actual error was that the TILEDATA hdu was present but did not have:
EXTNAME = 'TILEDATA' / extension name

A better error message would have saved some troubleshooting time and been clearer- e.g.:

Cannot locate 'TILEDATA' HDU in FITS file: xxxxx.fits
@gsleap gsleap added the bug Something isn't working label Sep 24, 2024
@gsleap
Copy link
Member Author

gsleap commented Sep 24, 2024

NOTE: test file is from v1.3 of hyperdrive in test_files/1120082744/1120082744_DipAmps.metafits

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant