-
Notifications
You must be signed in to change notification settings - Fork 24
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
Is it possible to read only the Header Unit and not the Data Unit? #30
Comments
right now it doesn't seem to be advisable with the current decoder (ie: to implement this, we'd need to implement the I'll try to implement this on my way back to Clermont-Fd (tuesday night). |
I have just pushed a branch I think I must try harder to provide a better API/interface for this though... |
I tested branch I tested that by using the Reader below:
I call
Passing to |
Ok... It occurred to me I only implemented it for image hdu. (In any case, I'll try with your reader impls. On Monday. I am on holidays, starting now.) |
The file I'm testing with is actually an image and Below is an excerpt of the FITS cards of my test file:
|
ok. I've found the underlying issue. let me fix that. |
ok. done. I am still not very happy with the way I have implemented the lazy loading. |
I just tested with branch However, when using an In both cases, this different behavior deserves to be documented, so that as a user I understand the tradeoffs of using |
Regarding the API, it would be clearer indeed to separate the Header part from the Data part so that one can retrieve them separately. Something like:
|
Wrt the API: yes, that's what I was thinking as well. Wrt the doc: yep, that also needs to be properly documented. Wrt the io.Reader it's indeed the intended behavior: an io.Reader can only consume blocks of data, no seeking can be achieved. |
I'm evaluating
astrogo/fitsio
for scanning the header units of hundreds of thousands of FITS files. I'm not interested in the contents of the data units.I noticed that the method DecodeHDU reads not only the Header Unit but also its associated Data Unit.
This behavior is inconvenient for my use case. The structure of each one of the 800+K FITS files I need to scan is basically:
Is there any way to tell
astrogo/fitsio
not to consume (i.e. read from disk) the data unit (i.e. 18MB in this particular case) but only the header unit (i.e. 14 KB in this particular case)? Given the number and the structure of the files I need to scan, that would greatly help.The text was updated successfully, but these errors were encountered: