-
Notifications
You must be signed in to change notification settings - Fork 15
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
Iterate over the cards of an HDU header. #374
Comments
Hi @chrsoo , thanks for making this suggestion.
That is a great suggestion, thank you!
That issue has not been updated regularly, so is likely out of date, however looking through the documentation I agree that this feature is not supported yet.
That's a good idea, thank you.
I think a struct is definitely preferable in general.
I think there are two considerations:
I can see a potential for using something like Regarding the suggestions for 2.: I would have a preference for using I am happy to continue further discussions in the PR, but in general I am on board with this idea, thank you! |
Hi,
I would like to iterate over all the cards in the header of an HDU for use in my own tool developed in Rust. From what I can tell the current
rust-fitsio
API assumes prior knowledge of all header keyword names, something I would like to avoid.I did not find this in the list of features documented in issue #15.
Iterating over the cards is possible by using
fits_get_hdrspace
for finding out the total number of cards and then retrieve them by number throughfits_read_record
orfits_read_keyn
, as indicated in section 5.4.1 of the cfitsio documentation.I have taken a first stab at this, but before creating a PR that respects the contributing guidelines, it would be great if you could provide some initial feedback, specfically:
fitsio
API are implements as key/value and key / (value, comment) it may be preferable to use tuples, what would you suggest?ffgrec
) and use slices to reference the right section in the buffer. (Being a Rust neophyte, I thought the approach of using individual buffers (andffgkyn
) was easier...)Best regards,
Chris
The text was updated successfully, but these errors were encountered: