open-gamma-ray-astro / gamma-astro-data-formats

Data formats for gamma-ray astronomy
https://gamma-astro-data-formats.readthedocs.io
Creative Commons Attribution 4.0 International
30 stars 27 forks source link

Required axis order and make clear how axis order is defined #166

Closed maxnoe closed 3 years ago

maxnoe commented 4 years ago

The FITS standard uses axis definion (stored in the TDIMX) keyword contrary to e.g. numpy.

In numpy, the shape of an array goes from slowest varying (outer most dimension) to fastest varying (inner most dimension).

The FITS standard uses the exact opposite definition for TDIM.

We should clarify which order we mean in the documentation.

Also, if the axis order is only recommended, how is the actual axis order specificed? By the order of the columns?

maxnoe commented 4 years ago

It is currently very confusing at least for gammapy, as it seems that it expects a different array in the file than when directly instantiated:

https://docs.gammapy.org/dev/api/gammapy.irf.EffectiveAreaTable2D.html#gammapy.irf.EffectiveAreaTable2D

maxnoe commented 3 years ago

Seems like I just missed the definiion in irf axes section of the docs, sorry for the spam