-
Notifications
You must be signed in to change notification settings - Fork 58
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
Issue with slicing #407
Comments
Could you provide a web link to the file so I can run some tests? |
That has access restrictions, I sent a request for access from my gmail address |
I've got a PR to fix this: #409 Would you like to see if it works for you? |
It works! Thanks @esheldon for the super quick help! In [5]: import fitsio
...: fname = "ixpe02001099_det1_evt2_v02_bary_de200.fits"
...: fits = fitsio.FITS(fname)["EVENTS"]
...: print("First three single lines")
...: print(fits[0])
...: print(fits[1])
...: print(fits[2])
...: print("Now the three lines as a slice:")
...: print(fits[:3])
...:
...:
First three single lines
(7719, 1.93797604e+08, [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False], [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False], 67, 0.14893726, 294.65622, 287.81873, -1.19643081, -1.5426033)
(7720, 1.93797604e+08, [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False], [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False], 126, 0.7080227, 309.22623, 296.74072, -0.17053956, -1.92101329)
(7721, 1.93797604e+08, [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False], [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False], 63, 0.32745385, 301.56723, 302.6787, 1.39725891, 1.42983813)
Now the three lines as a slice:
[(7719, 1.93797604e+08, [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False], [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False], 67, 0.14893726, 294.65622, 287.81873, -1.19643081, -1.5426033 )
(7720, 1.93797604e+08, [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False], [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False], 126, 0.7080227 , 309.22623, 296.74072, -0.17053956, -1.92101329)
(7721, 1.93797604e+08, [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False], [False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False], 63, 0.32745385, 301.56723, 302.6787 , 1.39725891, 1.42983813)] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello, thanks for this great library!
For an application I'm doing, I need to quickly access slices of data from large FITS files, and I'm testing
fitsio
againstastropy.io.fits
. However, I'm having a problem when doing that, as follows.In the MWE below, when I select a single row of the file, data are loaded correctly. If I use a slice, however, data get mangled in a strange way. I guess this might have something to do with the data types? Any help is appreciated
If I
print(fits)
, it gives the following information and data types:EDIT: a workaround for me is using
read(rows=list_of_rows, columns=["TIME", "PI"])
The text was updated successfully, but these errors were encountered: