quickAnalysis (version 0.1.4rc)
index

Perform event selections and exposure calculations for Fermi LAT data.
 
This module prepares Fermi LAT data for a likelihood anlaysis.  The
user supplies a text file with a list of data runs (one per line) and
a spacecraft file.  These should be called <basename>.list and
<basename>_SC.fits respectively where <basename> is a user defined
prefix.  There are two ways to run this module: from within python or
from the command line.  The simplest way to run it is from the command
line.
 
First, generate a default config file:
 
quickAnalysis (-i|--initialize)
 
Then edit the config file to match your specific analysis by filling
out the various options.  Next, run the command again:
 
quickAnalysis -a (-n |--basename==)<basename>
 
where <basename> is the prefix you've chosen to use; usually the name
of your source of interest but not necissarily so.
 
If you want to run this from within python, you'll need to first
create a quickAnalysis object and then you can use the various
functions below.  See the documentation for the individual functions
for more details.
 
This module logs all of the steps to a file called
<basename>_quickAnalysis.log as well as to the screen.

 
Modules
       
ConfigParser
logging
math
os
sys

 
Classes
       
quickAnalysis

 
class quickAnalysis
    This is the base class.  If you want to use this, you first
need to create an object from this method:
 
>>> qA = quickAnalysis('example_name', configFile = True)
 
will create an object called qA with the <basename> of
'example_name' and will read in all of the options from the config
file.  You can create an example config frile via the writeConfig
function or via the command line with the -c option.  You can also
pass all of the variables via the intial object initialiation
function (see below).  Once you've created this object, you can
just execute the runAll function to execute all of the steps, or
use the functions individually as needed.
 
  Methods defined here:
__init__(self, base='MySource', configFile=False, analysisConfig={'binsize': 0.10000000000000001, 'dec': 0, 'emax': 300000, 'emin': 100, 'ra': 0, 'rad': 10, 'tmax': 'INDEF', 'tmin': 'INDEF', 'zmax': 100}, commonConfig={'base': 'MySource', 'binned': False, 'eventclass': 2, 'irfs': 'P7SOURCE_V6', 'verbosity': 0})
generateXMLmodel(self)
Calls the quickUtils function to make an XML model of your
region based on the 2FGL. make2FGLXml.py needs to be in your
python path.  This needs to have the galactic and isotropic
diffuse models in your working directory as well as the 2FGL
catalog in FITS format.  See the corresponding function in
quickUtils for more details.
runAll(self, run=True)
Does a full event selection and exposure calculation.  This
is the function called when this module is run from the
command line.  You need to have two files to start with:
<basename>.list and <basename>_SC.fits.  The first one is just
a text file with a list of the raw data files (one per line)
and the other is the spacecraft file.  <basename> is a user
defined prefix (usually the source name but not necissarily).
Returns an exception if any of the files are not found.
runCCUBE(self, run=True, nbins=30)
Generates a counts cube.  The dimensions of which are the
largest square subtended by the ROI.  Note that if the ROI is
exceptionally small or the bin size exceptionally large, the
square might not be the largest posible since the npix
calculation floors the calculated value.  The number of energy
bins is logarithmic and is defined by the nbins variable.
runCMAP(self, run=True)
Generates a counts map.  The dimensions of which are the
largest square subtended by the ROI.  Note that if the ROI is
exceptionally small or the bin size exceptionally large, the
square might not be the largest posible since the npix
calculation floors the calculated value.
runExpCube(self, run=True, nbins=30)
Generates a binned exposure map that is 20 degrees larger
than the ROI.  The binned exposure map needs to take into
account the exposure on sources outside of the ROI.  20
degrees is the size of the PSF at low energies plus an extra
10 degrees for security.  The energy binning is logarithmic
and the number of energy bins is defined by the nbins
variable.
runExpMap(self, run=True)
Generates an exposure map that is 10 degrees larger than
the ROI and has 120 pixels in each direction.
runGTI(self, run=True, filterString='(DATA_QUAL>0)&&(LAT_CONFIG==1)', roi='yes')
Executes gtmktime with the given filter
runLTCube(self, run=True, zmax=180)
Generates a livetime cube
runModel(self, run=True)
Wrapper for the same function in quickUtils
runSelect(self, run=True, convtype=-1)
Runs gtselect on the data using the initialization
parameters. User selected parameters include the conversion
type and the eventclass.
runSrcMaps(self, run=True)
Generates a source map for your region.  Checks to make
sure that there's an XML model to be had and if not, creates
one from the 2FGL.
writeConfig(self)
Writes all of the initialization variables to the config
file called <basename>.cfg.

 
Functions
       
cli()
Command-line interface.  Call this without any options for usage notes.

 
Data
        TsMap = <GtApp.GtApp object>
__author__ = 'Jeremy S. Perkins (FSSC)'
__version__ = '0.1.4rc'
addCubes = <GtApp.GtApp object>
counts_map = <GtApp.GtApp object>
diffResps = <GtApp.GtApp object>
evtbin = <GtApp.GtApp object>
expCube = <GtApp.GtApp object>
expMap = <GtApp.GtApp object>
filter = <GtApp.GtApp object>
gtexpcube2 = <GtApp.GtApp object>
like = <GtApp.GtApp object>
maketime = <GtApp.GtApp object>
model_map = <GtApp.GtApp object>
obsSim = <GtApp.GtApp object>
rspgen = <GtApp.GtApp object>
srcMaps = <GtApp.GtApp object>

 
Author
        Jeremy S. Perkins (FSSC)