You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you have 2 HDUs, this returns the first to data and the second to header, obviously not the intended behavior.
You can use the hdus kwarg to select only a specific HDU but it turns out this is broken because the rest of the function expects an HDUList and after we slice it, we don't cast it back to an HDUList so everything after this explodes in fun and unexpected ways.
Even accounting for the first two problems, this function returns a list of data,header pairs, not a list of data and headers so you get a ValueError when trying to return this to a tuple as above. Fixing items 1 and 2, this example could be amended to,
data, header=sunpy.io.fits.read(filename)[0]
The text was updated successfully, but these errors were encountered:
In the docs, we have the following example of how to read the data and header directly from a file using
sunpy.io.fits.read
,There are a few problems here.
data
and the second toheader
, obviously not the intended behavior.hdus
kwarg to select only a specific HDU but it turns out this is broken because the rest of the function expects anHDUList
and after we slice it, we don't cast it back to anHDUList
so everything after this explodes in fun and unexpected ways.ValueError
when trying to return this to a tuple as above. Fixing items 1 and 2, this example could be amended to,The text was updated successfully, but these errors were encountered: