This is just a quick macro designed to access a LAT catalog source list fits file and produce an xml model for a given ROI. The macro models all sources using the PowerLaw2 spectral type, manual modification of the xml file is necessary for use of other types. The macro puts an underscore in front of the 1FGL name (avoids parsing issues) and removes the space from the name as well. The macro uses the Flux1000 (flux from 1GeV to 100 GeV) for the PowerLaw2 Integral argument and thus makes the UpperLimit(LowerLimit) values 1e5(1e3) MeV. Full usage is: from make1FGLxml import * mymodel=srcList('LATsrclist.fits','eventfile.fits','myLATxmlmodel.xml') mymodel.makeModel('$fullpathtodiffusefiles/gll_iem_v02.fits','gal_v02','$fullpathtodiffusefiles/isotropic_iem_v02.txt','eg_v02') The above will take the ROI info from eventfile.fits and then the cycle through the LATsrclist.fits file and will make an xml file for sources within ROIradius+5 degrees of the ROI center. The extra five degrees is to account for sources outside the ROI which may contribute at lower energies due to the larger PSF there. Note, however, that if a source is outside the ROI radius all parameters are fixed in the output xml file. "$fullpathtodiffusefiles" should be replaced with the path to the diffuse files on your machine, typing the above exactly as shown will not work. The names given will correspond to the diffuse response columns precomputed in the event files. If no galactic diffuse model is specified, the defaul gll_iem_v02.fit in the external libraries (included with the ScienceTools) is used. If no isotropic template file is given, the standard isotropic power law component is used. Alternate usages for the makeModel function are: mymodel.makeModel('$fullpathtodiffusefiles/gll_iem_v02.fits','gal_v02') #if not using the isotropic template mymodel.makeModel() #to use the gll_iem_v02.fit galactic diffuse and standard isotropic power law component mymodel.makeModel(ISOfile='$fullpathtodiffusefiles/isotropic_iem_v02.txt',ISOname='eg_v02') #to use gll_iem_v02.fit without specifying it exactly and the isotropic template The srcList object also has a Print function which will display the contents of the object, useful to make sure everything is good before making the model. Note, this does not have clobber protection so an existing xml file of the same name will be overwritten. The macro does, however, warn you that this will happen when making the srcList object.