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] cd ST_new/likeGui/v7r0p2/python/ noric13[jchiang] source ../cmt/setup.csh noric13[jchiang] python ModelEditor.py
- We begin by extracting the 3EG sources within a specified acceptance cone on the sky:\\\\
\\\\
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. The source catalogs that this application is able to read are in the format used by the flux package. The default is the version of the 3EG catalog that 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 \\\\ - A list of the extracted sources appears in the list box on the left. Selection of a source in this list box causes the source model components and parameter values to be displayed in the list boxes on the right. \\\\
\\\\
If desired, one can change the name of the source by editing its name in entry box on the upper right side:\\\\
\\\\ - Model components for the spectral and spatial parts of the source can be changed via the pull-down menues associated with each component. Here we choose a broken power-law for modeling the Crab.\\\\
\\\\ - To edit any parameter value, just double-left-click on that parameter in the list box and a dialog window will pop-up giving access to all of the attributes associated with that parameter.\\\\
\\\\ - After altering a model component, e.g., PowerLaw -> BrokenPowerLaw, one must explicitly save the model components by clicking on the "Set Components" button:\\\\
\\\\ - One can also alter the spatial model, switching between diffuse sources (ConstantValue, SpatialMap) and point sources (SkyDirFunction):\\\\
\\\\
Presently, the SpatialModel component uses the EGRET Galactic diffuse model as its FITS file template. One must edit this by hand in the xml file in order to specify a different template file.\\\\ - Finally, one can delete sources and add point-like or diffuse sources by hand, by-passing the extraction step if desired:\\\\
\\\\ - For reference, here is an abridged version of the xml file that results from this session:\\\\
anticenter_model.xml
<?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>