-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
Add Save Method to NDCube #111
Comments
we will have inherited the |
Good point, I completely forgot about that! But it seems |
Hey @DanRyanIrish ,can |
Hi @yashrsharma44. I'm really glad to hear you are interested in addressing this issue and would love to see you write a PR. I'd be very interested to hear more about what |
Sorry my bad ;), you were right regarding the interface of |
OK. Well it's good to have that confirmed. Would you still be interested in working on a PR to do this? |
Yeah ! I would need some guidance regarding writing up the |
OK, great. In that case I can write up an outline of how the write method should work and then we can discuss. |
Hey @DanRyanIrish , can we discuss the above in some common mailing list? |
Hi @yashrsharma44. I think it's best to discuss it here so anyone who's interested can see. Then we can update the description at the top of the issue with decisions for easy reference. |
So an One structure for saving and
This I think is pretty intuitive for FITS files. We haven't said where As for the extra_coords, there is no limit to the number of them, and they can apply to up to N dimensions. So perhaps all hdus after hdu3 be defined as separate extra_coords? E.g.
Issues I see that have no been addressed in the above plan include:
What do you think @yashrsharma44? I think we should also get @Cadair's feedback on this. |
Sorry for missing out on the discussion!
Some queries from my side -
What are the different
Can you elaborate on this ? Ping @DanRyanIrish |
Hi @yashrsharma44. I'm not sure @Cadair needs to give feedback at this time. Let's push ahead with this plan! |
Hey @DanRyanIrish , I forgot to ask, what type of FITS data structure are you planning to prefer to store the data for writing |
The |
@hayesla and @grahamkerr request this functionality in #409. Their conversation has been redirected here. Although note that much of the above discussion was had in the context of ndcube 1.x. In #409 @hayesla said:
@hayesla, as you see from this thread, we agree with you that a save/write method or function would be very useful. What you suggest would be the easiest thing to do but given the very generalised nature of NDCube there is more to consider. See the above discussions. Since those discussions were had, ndcube 2.0 has been largely implemented, which means we also need to think about how to save the In the meantime, however, if you have more to add about how a write method could be implemented feel free to chime in here. If you would like to work on implementing it once 2.0 has been released, please let us know! |
It's worth remembering that you would only be able to save a NDCube backed by an |
That's a very good point. So in APE-14 land there is no generalized way to save to FITS? Given the scope of ndcube, that makes me unsure about a save to FITS method. Although perhaps how useful it could be to users might still be a reason to provide it. |
What about HDF5? If gWCS can be serialized to that and we provide a reader as well, then maybe we don't need to provide a FITS writer. |
gWCS will serialise to asdf, but currently there is no way to save a FITS WCS to asdf (although that could be developed). As I am aware asdf is really the only serialisation option for gWCS at this point.
There is no serialisation at all in APE 14, it's very likely that all underlying implementations of APE 14 would have their own serialisation formats. |
Add a
save
method toNDCube
with the following API:NDCube.save(self, filename, file_type="FITS"):
For now it should just support FITS. More file types can be added later. The method should save the information in an
NDCube
, including data, mask, uncertainty, unit, extra coordinates, WCS, etc., in a standardized way.The text was updated successfully, but these errors were encountered: