Package: gtapps-mp
Fermi LAT Multi-Processor Scripts (version 1.4)The Fermi Science Tools (http://fermi.gsfc.nasa.gov/ssc) are a suiteof tools developed for the analysis of both Fermi LAT and GBMdata. This suite was developed by the FSSC and the instrument teams,and was reviewed by the Fermi Users' Group.  The LAT Multi-ProcessorScripts are a set of python scripts to facilitate the analysis of LATdata.  This package depends on the Fermi Science Tools.The current tools available are* gtdiffrsp_mp.py* gtexpmap_mp.py* gtltcube_mp.py* gttsmap_mp.py (Unbinned Only)Installation: navigate to the gtapps_mp directory and execute> python setup.py installTo receive information on program execution for a specific script execute:> python <gtapp>_mp.py -hSee below for details on each tool.* gtdiffrsp_mp.py *Submits the gtdiffrsp program as separate threads via python andjoins up the resulting temporary files at the end resulting in asingle file. This greatly reduces the running time. For more detailson gtdiffrsp see the gtdiffrsp help file.usage: gtdiffrsp_mp.py [-h] [--savetmp SAVETMP]jobs evfile scfile srcmdl irf outfilepositional arguments:jobs               The number of jobs you wish to spawn (usually the numberof cores on your machine).evfile             Input event file. See gtdiffrsp help for moreinformation.scfile             Spacecraft file. See gtdiffrsp help for more information.srcmdl             The source model file to use. See gtdiffrsp help for moreinformation.irf                The IRFs to use. See gtdiffrsp help for more information.outfile            Output file name.optional arguments:-h, --help         show this help message and exit--savetmp SAVETMP  Save the temporary files (default is False).example:This computes the diffuse response for the data in the file'3C279_events.fits' using 4 separate threads using the spacecraftfile 'SC.fits', the model file '3C279_model.xml' and the P7SOURCE_V6instrument response functions.  It saves the output in'3C279_events_diffrsp.fits'> python gtdiffrsp_mp.py 4 3C279_events.fits SC.fits 3C279_model.xmlP7SOURCE_V6 3C279_events_diffrsp.fits* gtexpmap_mp.py *Submits the gtexpmap program as operate threads via python and joinsup the resulting temporary exposure maps at the end resulting in asingle exposure map for the input event file. This greatly reduces therunning time. For more details on gtexpmap see the gtexpmap helpfile. Note that the checksum and datasum are incorrect for the finalfile. The number of spawned jobs is equal to xbins x ybins.usage: gtexpmap_mp.py [-h] [--savetmp SAVETMP]nlong nlat xbins ybins sfile evfile expcube IRFS srcradnenergies outfilepositional arguments:nlong              Number of longitude points. See gtexpmap help for moreinformation.nlat               Number of latitude points. See gtexpmap help for moreinformation.xbins              The number of bins along the x-axis. Must divide evenlyinto nlong.ybins              The number of bins along the y-axis. Must divide evenlyinto nlat.sfile              The spacecraft data file. See gtexpmap help for moreinformation.evfile             Input event file. See gtexpmap help for more information.expcube            Input livetime cube. See gtexpmap help for moreinformation.IRFS               IRFs to use. See gtexpmap help for more information.srcrad             Radius. See gtexpmap help for more information.nenergies          Number of energy slices. See gtexpmap help for moreinformation.outfile            Output file name.optional arguments:-h, --help         show this help message and exit--savetmp SAVETMP  Save the temporary files (default is False).example:This computes a 30 degree radius exposure map for a the data in'3C279_filtered_gti.fits' with 120 by 120 pixels and 20 energy binsusing the spacecraft file 'SC.fits', the exposure cube'3C279_ltcube.fits' and the P7SOURCE_V6 instrument response files.It submits 6 jobs by making xbins = 3 and ybins = 2 (3*2 = 6).  Both3 and 2 divide equally into 120.  The resulting file is saved as'3C279_expmap.fits'.> python gtexpmap_mp.py 120 120 3 2 SC.fits 3C279_filtered_gti.fits3C279_ltcube.fits P7SOURCE_V6 30 20 3C279_expmap.fits* gtltcube_mp.py *Submits the gtltcube program as operate threads via python and joinsup the resulting temporary exposure cubes at the end resulting in asingle exposure cube for the input event file. This greatly reducesthe running time. For more details on gtltcube see the gtltcube helpfile.usage: gtltcube_mp.py [-h] [--savetmp SAVETMP] [--zmax ZMAX]jobs sfile evfile outfilepositional arguments:jobs               The number of jobs you wish to spawn (usually the numberof cores on your machine).sfile              The spacecraft data file. See gtltcube help for moreinformation.evfile             Input event file. See gtltcube help for more information.outfile            Output file name.optional arguments:-h, --help         show this help message and exit--savetmp SAVETMP  Save the temporary files (default is False).--zmax ZMAX        zmax parameter for gtltcube (default is 180)example:This example creates a livetime cube for the file'3C279_filtered_gti.fits' using 8 threads and the 'SC.fits'spacecraft file.  It saves the output to '3C279_ltcube.fits'.  Italso sets the zmax value to 100 (the recommended value).> python gtltcube_mp.py 8 SC.fits 3C279_filtered_gti.fits3C279_ltcube.fits --zmax 100* gttsmap_mp.py *Generates a TS Map by running separate pixels on separatethreads. It creates a template counts map to determine the locationof the pixels and the calculates the TS of a test source at eachpixel on that map. It then merges the results at the end. The map isdivided into separate regions (called 000,001,002...) depending onthe number of jobs the user requests. It creates subdirectories foreach region and operates on them within the subdirectory.  For moredetails on the parameters see the gttsmap help file. NOTE: ONLY DOESAN UNBINNED ANALYSIS. NOTE2: Any files referenced in the model XMLfile must be referenced by absolute and not relative directories(ie. not ./ or ../)"usage: gttsmap_mp.py [-h] [--savetmp SAVETMP]nxpix nypix jobs evfile scfile expcube srcmdl IRFSoptimizer ftol toltype binsz coordsys xref yref projoutfile UNBINNED expmappositional arguments:nxpix              Number of pixels along x-axis. See gttsmap help for moreinformation.nypix              Number of pixels along y-axis. See gttsmap help for moreinformation.jobs               The number of concurrent jobs.evfile             Input event file. See gttsmap help for more information.scfile             The spacecraft data file. See gttsmap help for moreinformation.expcube            Input livetime cube. See gttsmap help for moreinformation.srcmdl 	     XML source model definition. See gttsmap help for moreinformation.  Any files in the xml (like thediffuse models) need to be referenced by absolutedirectories.IRFS               IRFs to use. See gttsmap help for more information.optimizer          The optimizer (e.g. NEWMINUIT). See gttsmap help for moreinformation.ftol               Fit tolerance. See gttsmap help for more information.toltype            Tolerance type (0 for RELATIVE and 1 for ABSOLUTE). Seegttsmap help for more information.binsz              Image scale (deg/pix). See gttsmap help for moreinformation.coordsys           CEL or GAL. See gttsmap help for more information.xref               x-coord of center (RA or l). See gttsmap help for moreinformation.yref               y-coord of center (DEC or b). See gttsmap help for moreinformation.proj               Coordinate projection. See gttsmap help for moreinformation.outfile            Output file name.analysis           UNBINNED. Only unbinned analysis supported.expmap             Input exposure map. See gttsmap help for moreinformation.optional arguments:-h, --help         show this help message and exit--savetmp SAVETMP  Save the temporary files (default is False).example:This example creates a TS Map called '3C279_tsmap.fits' with 100bins and using 6 threads.  Each bin is 0.5 degrees square.  It usesthe event file '3C279_filtered_gti.fits', the spacecraft file'SC.fits', the exposure map '3C279_expmap.fits', the livetime cube'3C279_ltcube.fits', the model file '3C279_model.xml' and theP7SOURCE_V6.  The optimization is done by the MINUIT optimizer at anabsolute tolerance of 1e-5.  The map is centered on 193.98,-5.82 andis created using the STG celestial coordinate system.> python gttsmap_mp.py 10 10 6 3C279_filtered_gti.fits SC.fits3C279_ltcube.fits 3C279_model.xml P7SOURCE_V6MINUIT 1e-05 1 0.5 CEL 193.98 -5.82 STG 3C279_tsmap.fits UNBINNED3C279_expmap.fits