-
-
Notifications
You must be signed in to change notification settings - Fork 26
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
read_spice_l2_fits
fails on files with lost telemetry
#202
Comments
Better way of listing all windows according to the SPICE pipeline manager: list the primary HDU plus all extensions with with XTENSION= ‘IMAGE ' |
Perhaps a solution would be only to include HDUs with type PrimaryHDU or ImageHDU. The others have type BinTableHDU. |
The test file loads with #205 If you find other files that are broken, please do either reopen this issue or create a new one please! This is in the sunraster release 0.4.2, if you update to that |
Note for later: this will probably break with a future version of the SPICE FITS files, in which additional distortion information will be encoded in two WCSDVARR HDUs (with EXTVER = j for axis j), which are also ImageHDUs according to the draft WCS IV paper. |
I reopened this issue to make sure, we keep track of that! |
Now we have such files with WCSDVARR; I have opened issue #208 for this. |
HDUs for lost pixels were already excluded following sunpy/sunraster issue sunpy#202, as they are not PrimaryHDU or ImageHDUs
Describe the bug
read_spice_l2_fits()
fails on SPICE files with lost telemetry as it considers non-window HDUs that are present in the FITS file in this case as windows.To Reproduce
Trace:
What happened?
SPICE files with lost TM have additional HDUs: LOST_TELEMETRY, PLNAPRXPIXLIST* and APRXPLNPIXLIST* (the stars are for an additional tag identifying the corresponding window), as specified in the SPICE Data Product Description Document.
read_spice_l2_fits()
fails on these files because _read_single_spice_l2_fits() assumes that every HDU that is not VARIABLE_KEYWORDS is a window, then it tries to get the XPOSURE header from the LOST_TELEMETRY HDU, and there is no such header in a non-window HDU.List of HDUs in the example file (with
astropy.io.fits.hdu.hdulist.HDUList.info()
):Expected behavior
read_spice_l2_fits()
should read such files with no error.Possible solutions (I am trying to confirm which one would be the best): when
_read_single_spice_l2_fits()
builds the list of windows, it should eitherScreenshots
No response
System Details
==============================
sunpy Installation Information
General
#######
OS: Ubuntu (21.10, Linux 5.13.0-40-generic)
Arch: 64bit, (x86_64)
sunpy: 3.1.5
Installation path: /home/eric/.local/lib/python3.9/site-packages
Required Dependencies
#####################
numpy: 1.22.3
packaging: 21.3
parfive: 1.5.1
astropy: 5.0.4
Optional Dependencies
#####################
asdf: 2.8.1
beautifulsoup4: 4.9.3
cdflib: 0.3.20
dask: 2021.1.0+dfsg
drms: 0.6.2
glymur: 0.9.9
h5netcdf: 0.11.0
h5py: 3.6.0
matplotlib: 3.5.0
mpl-animators: 1.0.0
pandas: 1.4.2
python-dateutil: 2.8.1
reproject: 0.8
scikit-image: 0.18.1
scipy: 1.8.0
sqlalchemy: 1.4.34
tqdm: 4.57.0
zeep: Missing, need zeep>=3.4.0; extra == "all"
Installation method
pip
The text was updated successfully, but these errors were encountered: