-
Notifications
You must be signed in to change notification settings - Fork 32
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
pixell cannot load CompImageHDU #96
Comments
+1 because I was about to raise this issue a few days ago when working with Matt's files, but never actually got around to it. |
This issue has resurfaced. Here is the output from attempting to load the public DR5 cluster survey mask on LAMBDA:
The file is here: https://lambda.gsfc.nasa.gov/product/act/actpol_dr5_szcluster_catalog_get.cfm |
Seems to work if you point it to second hdu:
Not sure if a compressed image (as this is) needs to live at hdu>0 in order to be a binary table? |
Indeed a compressed image cannot be a PrimaryHDU (see here). A reasonable behavior for read_fits, when hdu=None, might be for it to skip "empty" (for some definition of empty) HDUs until it finds a good one? |
Sorry I missed this (but have sorted out my GitHub mail filtering) - I agree with what @mhasself said above (spinning through hdus to find the first non-empty one, if hdu is not given). |
Description
pixell can't load images that are saved into compressed HDUs of FITS files, even though this is supported by astropy. (The example file below comes from SPT folks so it's a real thing CMB people use.)
This is because enmap.ndmap_proxy_fits uses an API specific to uncompressed HDUs (for reasons of I/O and RAM efficiency in the case where only a small submap should ultimately be loaded from disk). A new proxy class will be needed to access CompImageHDU objects (or plausibly any HDU types that do not expose the raw API).
What I did
Unzip the attached FITS file and try to load it, e.g. like:
Here's the demo file: compressed_zeros_TQU_zea.fits.zip
The text was updated successfully, but these errors were encountered: