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

[BUG] Exceptions if image extension does not contain a pixel plane. #4

Open
teald opened this issue May 2, 2024 · 0 comments
Open
Assignees
Labels
bug Something isn't working

Comments

@teald
Copy link
Member

teald commented May 2, 2024

Describe the bug
Images lacking a pixel plane will raise an IndexError if some functions (e.g., .info) are called.

To Reproduce
Steps and requirements to reproduce the behavior:

  1. Try to load in a file with image extensions lacking a pixel plane (see attached file)
  2. Load the file using from_file
  3. Try to

Expected behavior
From Chris:

I think ext.data or ext.mask or ext.variance should all return None for such an extension. It's slightly cleaner than having ext.data crash and is entirely reasonable (ImageHDU.data returns None in such a case).
ad.info should probably say something simple like

Index  Content                  Type              Dimensions     Format
[ 0]   science                  NDAstroData       (2048, 2048)   float32
[ 1]   science                  NDAstroData       (2048, 2048)   float32
[ 2]   none```

Example code
Assuming you have this data from the archive in the local directory.

from astrodata import from_file

data = from_file("S20231217S0093.fits")
data.info()

Screenshots
N/A

Desktop (please complete the following information):

  • OS: OSX
  • Version Ventura 13.5

Additional context
N/A

@teald teald added the bug Something isn't working label May 2, 2024
@teald teald self-assigned this May 2, 2024
@teald teald changed the title [BUG] [BUG] Exceptions if image extension does not contain a pixel plane. May 2, 2024
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