A Prototype Source Model Editor

I have created a GUI editor for creating and modifying source model xml files for use by Likelihood. It is available from the likeGui package and is implemented in Python. This is a brief tutorial of its use.

Starting it up from the linux command-line:

noric13[jchiang] ModelEditor

A dialog window pops up in which we specify the acceptance cone parameters, source catalog, and output file name.

The acceptance cone we choose has angular radius 20 degrees and is centered on the Galactic anticenter. One may specify xml source files that are either in the format recognized by theĀ  flux packageor an xml model file for Likelihood such as the DC2 preliminary catalog. The default is the version of the 3EG catalogthat was prepared for DC1. The flux limit has the same units of flux used in the xml file. For point sources used by the flux package, flux values are in units of photons m -2 s -1

If desired, the name of the source can be changed by editing the entry box on the upper right side:

This does not have to be performed if only a parameter attribute value is modified.

Presently, the SpatialModel component uses the EGRET Galactic diffuse model as its FITS image template. The name of this file must be edited by hand in the xml file in order to specify a different template.

<?xml version="1.0" ?>
<source_library title="source library">
  <source name="Extragalactic Diffuse" type="DiffuseSource">
    <spectrum type="PowerLaw">
      <parameter free="1" max="100.0" min="1e-05" name="Prefactor" scale="1e-07" value="1.45"/>
      <parameter free="0" max="-1.0" min="-3.5" name="Index" scale="1.0" value="-2.1"/>
      <parameter free="0" max="200.0" min="50.0" name="Scale" scale="1.0" value="100.0"/>
    </spectrum>
    <spatialModel type="ConstantValue">
      <parameter free="0" max="10.0" min="0.0" name="Value" scale="1.0" value="1.0"/>
    </spatialModel>
  </source>
  <source name="Galactic Diffuse" type="DiffuseSource">
    <spectrum type="PowerLaw">
      <parameter free="1" max="1000.0" min="0.001" name="Prefactor" scale="0.001" value="11.0"/>
      <parameter free="0" max="-1.0" min="-3.5" name="Index" scale="1.0" value="-2.1"/>
      <parameter free="0" max="200.0" min="50.0" name="Scale" scale="1.0" value="100.0"/>
    </spectrum>
    <spatialModel file="$(LIKELIHOODROOT)/src/test/Data/gas.cel" type="SpatialMap">
      <parameter free="0" max="1000.0" min="0.001" name="Prefactor" scale="1.0" value="1.0"/>
    </spatialModel>
  </source>
  <source name="my_3EG_J0459p3352" type="PointSource">
    <spectrum type="PowerLaw">
      <parameter free="1" max="1000.0" min="0.001" name="Prefactor" scale="1e-09" value="2.079"/>
      <parameter free="1" max="-1.0" min="-5.0" name="Index" scale="1.0" value="-2.54"/>
      <parameter free="0" max="2000.0" min="30.0" name="Scale" scale="1.0" value="100.0"/>
    </spectrum>
    <spatialModel type="SkyDirFunction">
      <parameter free="0" max="360.0" min="-360.0" name="RA" scale="1.0" value="74.78"/>
      <parameter free="0" max="90.0" min="-90.0" name="DEC" scale="1.0" value="33.87"/>
    </spatialModel>
  </source>
  <source name="my_3EG_J0520p2556" type="PointSource">
    <spectrum type="PowerLaw">
      <parameter free="1" max="1000.0" min="0.001" name="Prefactor" scale="1e-09" value="2.873"/>
      <parameter free="1" max="-1.0" min="-5.0" name="Index" scale="1.0" value="-2.83"/>
      <parameter free="0" max="2000.0" min="30.0" name="Scale" scale="1.0" value="100.0"/>
    </spectrum>
    <spatialModel type="SkyDirFunction">
      <parameter free="0" max="360.0" min="-360.0" name="RA" scale="1.0" value="80.14"/>
      <parameter free="0" max="90.0" min="-90.0" name="DEC" scale="1.0" value="25.75"/>
    </spatialModel>
  </source>
   <source name="Crab Pulsar" type="PointSource">
    <spectrum type="BrokenPowerLaw">
      <parameter free="1" max="1000.0" min="0.001" name="Prefactor" scale="1e-09" value="1"/>
      <parameter free="1" max="-1.0" min="-5." name="Index1" scale="1.0" value="-1.8"/>
      <parameter free="1" max="2000.0" min="30.0" name="BreakValue" scale="1.0" value="1500.0"/>
      <parameter free="1" max="-1.0" min="-5." name="Index2" scale="1.0" value="-2.3"/>
    </spectrum>
    <spatialModel type="SkyDirFunction">
      <parameter free="0" max="360.0" min="-360.0" name="RA" scale="1.0" value="83.57"/>
      <parameter free="0" max="90.0" min="-90.0" name="DEC" scale="1.0" value="22.01"/>
    </spatialModel>
  </source>
</source_library>

Interaction with DS9

If you have DS9 v3.0.3 and the XPAmessaging system installed, you can set point source locations interactively on a display of a WCS-compliant FITS image using DS9's Regions capability. In order to get ModelEditor.py to communicate with DS9 via XPA, you must first install Russell Owen's RO.DS9 python package. If everything is installed correctly, a "ds9" pull-down menu will be available:

"Display sources" will plot the locations of the current set of point sources on the current DS9 frame, and "Import sources" will add the point sources displayed in the current frame to the list of sources. NB: DS9 must be running for these menu items to have any effect.