gamma-astro-data-formats icon indicating copy to clipboard operation
gamma-astro-data-formats copied to clipboard

Defining a common XML format for models in Fermi/LAT Science Tools and GammaLib

Open jknodlseder opened this issue 8 years ago • 6 comments

The GammaLib software implements so far the XML format that has been defined for the Fermi/LAT Science Tools (ST) for model definition. GammaLib has several additional spatial model components, and the XML format has been extended to cover also these cases. More spatial models are now also added to the Fermi/LAT Science Tools, hence to keep compatibility between GammaLib and Fermi/LAT Science Tools it would be important to agree now on a common naming convention. This could also be the moment to change some of the initial naming conventions so that model components have a more coherent set of names. It is proposed that the Fermi/LAT Science Tools and GammaLib softwares will implement some proxies to ease the transition from the old to the new format, but ultimately, only the new format should be used in the future for model definition.

The discussion on this has started on Fermi/LAT confluence and in an e-mail thread, here just the summary of what is proposed so far.

The proposal is to change the type attributes of the spatialModel elements in the XML file (see an example XML file below). The following types are proposed:

  • PointSource as replacement of SkyDirFunction in ST and GammaLib
  • RadialDisk as replacement for SpatialDisk in ST and DiskFunction in GammaLib
  • RadialGaussian as replacement for SpatialGaussian in ST and GaussFunction in GammaLib
  • RadialShell as replacement for ShellFunction in GammaLib
  • EllipticalDisk stays as is in GammaLib
  • EllipticalGaussian as replacement for EllipticalGauss in GammaLib
  • EllipticalShell if needed in the future
  • DiffuseIsotropic as replacement for ConstantValue in ST and GammaLib
  • DiffuseMap as replacement for SpatialMap in ST and GammaLib
  • DiffuseMapCube as replacement for MapCubeFunction in ST and GammaLib

In addition, the type attributes of the source elements in the XML file are proposed to be defined as follows:

  • PointSource for point sources (as is)
  • ExtendedSource for all radial and elliptical models (is DiffuseSource in ST)
  • DiffuseSource for all diffuse models (as is)

Below for illustration of the type attributes and the source and spatialModel elements an XML of the current XML file format:

  <source name="Crab" type="PointSource">
    <spectrum type="PowerLaw">
       <parameter name="Prefactor" scale="1e-16" value="5.7"  min="1e-07" max="1000.0" free="1"/>
       <parameter name="Index"     scale="-1"    value="2.48" min="0.0"   max="+5.0"   free="1"/>
       <parameter name="Scale"     scale="1e6"   value="0.3"  min="0.01"  max="1000.0" free="0"/>
    </spectrum>
    <spatialModel type="SkyDirFunction">
      <parameter name="RA"  scale="1.0" value="83.6331" min="-360" max="360" free="0"/>
      <parameter name="DEC" scale="1.0" value="22.0145" min="-90"  max="90"  free="0"/>
    </spatialModel>
  </source>

jknodlseder avatar Apr 26 '16 19:04 jknodlseder