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

Proposal for a FITS convention for region based "skymaps" #170

Open adonath opened 3 years ago

adonath commented 3 years ago

In Gammapy we already use the GADF sky maps formats for HEALPix and WCS. In Gammapy there is now the use-case to handle "spectral" data, that was integrated / averaged over a certain region with additional extra axes, e.g. time.

This pull request proposes a new format for these "region based" maps. Here is the core of the proposal:

I hope the general need for such as format is uncontroversial, as it will allow to store e.g. time dependent counts spectra together with complex region definitions. Already now there are many use-cases where this format would be useful.

Currently the description is rather short, but as noted above the proposed format relies almost exclusively on already defined HDU definitions.

adonath commented 3 years ago

I have requested reviews from the people, that have been active in this repo for the last time. Possibly I forgot someone...

adonath commented 3 years ago

For now I have added it to the skymap section, however it could possibly be a sub-section of spectra as well. The "skymap" section seemed more natural to me, as the format definition relies on the "bands HDU" and has the support for region definitions as well. So it's a format proposal for an N-dimensional map with a single spatial bin, defined by the region.

The main argument for me is that the format does not strictly apply to a "spectrum" in a classical sense. E.g. it can be used as well to store a reduced instrument response function, e.g. a PSF with a true energy and rad axis or an RMF matrix with a true and reconstructed energy axis.

adonath commented 3 years ago

Following up on a private discussion with @registerrier (see also the PR with the prototype implementation in Gammapy https://github.com/gammapy/gammapy/pull/3231), I updated the proposal as following:

This allows to store multiple "ND spectra" with the same axes specification and let them share a single bands HDU.

registerrier commented 3 years ago

The addition of this format is indeed useful. The OGIP format only supports parts of the use cases that this supports as it is limited to purely spectral information (counts or counts rate as a function of channel).

It is not totally clear to me where this belongs, though. This convention and the one describing skymaps (https://github.com/open-gamma-ray-astro/gamma-astro-data-formats/blob/master/source/skymaps/index.rst) are not necessarily fully connected to gamma-ray format. They simply describe a FITS storage convention for multidimensional quantities.

Should we describe them here or propose them as a set of conventions for the registry of FITS conventions that is maintained by the IAU FITS working group? For instance in the section "Conventions applicable to specific types of data" . Any opinion about this @cboisson and others?

PaulKuin commented 3 days ago

It might be useful to check out the standard for MOC's at CDS. What you proposed is, of course, a general problem, and using the already developed MOC approach seems to me the way to go.