Closed telegraphic closed 10 years ago
@telegraphic, thanks for writing an HDF5 handler!
My bad on the documentation. It should read:
from ginga.AstroImage import AstroImage
AstroImage.set_ioClass(MyIOHandler)
because it is the class you are setting the handler on.
As for the naxispath, probably for HDF5 you can return the empty list ([]). The naxispath would normally be a list of indexes into a data cube, and is there for FITS files.
One other comment regarding naxispath: since it is a keyword argument to the load_file method, you probably want to treat it as any kind of path that you would need to take to navigate through an HDF5 file. For example, if there are multiple image slices in the HDF5 file, the naxispath would be some kind of list of indexes that would help to navigate down to the particular slice in your load_file method.
If the user passes a valid naxispath (whatever that means to your method) you simply return that value that they passed. If they passed None (default), then you return whatever path you used to access the data slice that you returned.
ah ok, so for N-dimensional data, load_file should return a 2D array + a set of indexes that identify how the file is sliced. Looking at io_fits now, I can see how this is used to slice.
Once I've got something that works I'll let you know. Thanks!
Hi, I'm trying to write a file handler for HDF5, via the technique mentioned here: http://ginga.readthedocs.org/en/latest/manual/internals.html#sec-custom-io and was hoping to get some clarification on a few things. Firstly, in the example
What exactly is naxispath? It wasn't clear from the code what to pass.
Also, this method isn't working for me:
As AstroImage does not appear to have a method set_ioClass. I do see this method under AstroImage.AstroImage.set_ioClass(), but haven't been able to get this method working.