Open cdeil opened 10 years ago
@cdeil - the I/O framework in spectralcube will transition to using the astropy I/O framework eventually, which will make it easy for you to specify your own readers/writers. I guess at the moment I'm not sure how we can store the table of energies in the WCS object (in theory wcslib supports tabulated WCS, but I'm not sure how it's used).
How do you envisage a reader for this format working? Can you currently write a reader function that returns a SpectralCube, or is the way the data is stored in SpectralCube not suited to this file format?
I just started looking at spectral-cube
an hour ago ... the answer to all your questions above is currently "I have no idea".
Since I need to work with these gamma-ray spectral cubes now, what I'll do as a temporary solution is sub-class or wrap SpectralCube
in a GammaSpectralCube
class in gammapy
and implement what I need there, adding the energy table as a data member.
I've implemented a first version of the GammaSpectralCube
and LogEnergyAxis
with some of the functionality we need here: https://github.com/gammapy/gammapy/pull/118
I did not manage to re-use code from SpectralCube
so far, probably mainly because I did not manage to put my energy axis into the WCS
object but have it as a separate data member, but also because the core functionality I needed right now (interpolating all axes and integrating the energy axis in a specific way) wasn't available in SpectralCube
yet.
If you have any comments in the (probably pretty bad) GammaSpectralCube
and LogEnergyAxis
implementation or hints how I might re-use SpectralCube
, that would be very welcome.
Related feature request: https://github.com/astropy/astropy/issues/2362
In gamma-ray astronomy spectral cubes are used where the spectral axis is
log(energy)
, but aBINTABLE
extension is used to define the spectral bins ... I think the spectral WCS info from the cube FITS extension is never used.E.g. the Fermi LAT and GALPROP are using this format.
Here's an example:
Is it possible to support this format in
SpectralCube
? Or should I subclassSpectralCube
in gammapy?cc @ellisowen @adonath