Exemple #1
0
 def SrcMap(self):
     """Run gtsrcmap tool for binned analysis"""
     srcMaps['scfile'] = self.ft2
     srcMaps['expcube'] = self.Cubename
     srcMaps['cmap'] = self.ccube
     srcMaps['bexpmap'] = self.BinnedMapfile
     srcMaps['srcmdl'] = self.xmlfile
     srcMaps['irfs'] = self.irfs
     srcMaps['outfile'] = self.scrMap
     srcMaps['emapbnds'] = 'no'
     srcMaps['clobber'] = self.clobber
     srcMaps.run()
Exemple #2
0
 def SrcMap(self):
     """Run gtsrcmap tool for binned analysis"""
     srcMaps['scfile'] = self.ft2
     srcMaps['expcube'] = self.Cubename
     srcMaps['cmap'] = self.ccube
     srcMaps['bexpmap'] = self.BinnedMapfile
     srcMaps['srcmdl']=self.xmlfile
     srcMaps['irfs']= self.irfs
     srcMaps['outfile'] = self.scrMap
     srcMaps['emapbnds']='no'
     srcMaps['clobber'] = self.clobber
     srcMaps.run()
Exemple #3
0
def run_gtsrcmaps(square):

    '''This is the atomic function that actually runs in the seperate
    threads.  The input is an array with two elements, the first describes
    the energy binning and the second lists all of the progromatic
    options.  This function runs evtbin to generate a counts cube for the
    sub-energy range and then gtsrcmaps.  It returns the bin number and
    the output filename of the srcmaps file for the sub-energy range.'''


    idx = square[0][0][0]
    emin = square[0][0][1]*0.001
    emax = square[0][-1][2]*0.001
    enumbins = len(square[0])
    options = square[1]

    ccubehandle,ccubefilename = tempfile.mkstemp(suffix=".fits")
    evtbin['evfile'] = options['evfile']
    evtbin['outfile'] = ccubefilename
    evtbin['algorithm'] = 'CCUBE'
    evtbin['nxpix'] = options['nxpix']
    evtbin['nypix'] = options['nypix']
    evtbin['binsz'] = options['binsz']
    evtbin['coordsys'] = options['coordsys']
    evtbin['xref'] = options['xref']
    evtbin['yref'] = options['yref']
    evtbin['axisrot'] = options['axisrot']
    evtbin['proj'] = options['proj']
    evtbin['ebinalg'] = options['ebinalg']
    evtbin['emin'] = emin
    evtbin['emax'] = emax
    evtbin['enumbins'] = enumbins
    evtbin['scfile'] = options['scfile']
    evtbin.run(print_command=False)

    srcmaphandle,srcmapfilename = tempfile.mkstemp(suffix=".fits")
    srcMaps['scfile'] = options['scfile']
    srcMaps['expcube'] = options['expcube']
    srcMaps['cmap'] = ccubefilename
    srcMaps['srcmdl'] = options['srcmdl']
    srcMaps['bexpmap'] = options['bexpmap']
    srcMaps['outfile'] = srcmapfilename
    srcMaps['irfs'] = options['irfs']
    srcMaps['chatter'] = 2
    srcMaps['emapbnds'] = "no"
    srcMaps.run(print_command=False)

    return idx,srcmapfilename
Exemple #4
0
def run_gtsrcmaps(square):

    '''This is the atomic function that actually runs in the seperate
    threads.  The input is an array with two elements, the first describes
    the energy binning and the second lists all of the progromatic
    options.  This function runs evtbin to generate a counts cube for the
    sub-energy range and then gtsrcmaps.  It returns the bin number and
    the output filename of the srcmaps file for the sub-energy range.'''


    idx = square[0][0][0]
    emin = square[0][0][1]*0.001
    emax = square[0][-1][2]*0.001
    enumbins = len(square[0])
    options = square[1]

    ccubehandle,ccubefilename = tempfile.mkstemp(suffix=".fits")
    evtbin['evfile'] = options['evfile']
    evtbin['outfile'] = ccubefilename
    evtbin['algorithm'] = 'CCUBE'
    evtbin['nxpix'] = options['nxpix']
    evtbin['nypix'] = options['nypix']
    evtbin['binsz'] = options['binsz']
    evtbin['coordsys'] = options['coordsys']
    evtbin['xref'] = options['xref']
    evtbin['yref'] = options['yref']
    evtbin['axisrot'] = options['axisrot']
    evtbin['proj'] = options['proj']
    evtbin['ebinalg'] = options['ebinalg']
    evtbin['emin'] = emin
    evtbin['emax'] = emax
    evtbin['enumbins'] = enumbins
    evtbin['scfile'] = options['scfile']
    evtbin.run(print_command=False)

    srcmaphandle,srcmapfilename = tempfile.mkstemp(suffix=".fits")
    srcMaps['scfile'] = options['scfile']
    srcMaps['expcube'] = options['expcube']
    srcMaps['cmap'] = ccubefilename
    srcMaps['srcmdl'] = options['srcmdl']
    srcMaps['bexpmap'] = options['bexpmap']
    srcMaps['outfile'] = srcmapfilename
    srcMaps['irfs'] = options['irfs']
    srcMaps['chatter'] = 2
    srcMaps['emapbnds'] = "no"
    srcMaps.run(print_command=False)

    return idx,srcmapfilename
Exemple #5
0
    def SrcMap(self):
        """Run gtsrcmap tool for binned analysis"""
        srcMaps['scfile'] = self.ft2
        srcMaps['expcube'] = self.Cubename
        srcMaps['cmap'] = self.ccube
        srcMaps['bexpmap'] = self.BinnedMapfile
        srcMaps['srcmdl']=self.xmlfile
#        if  self.Configuration['event']['irfs'] != 'CALDB':
#            srcMaps['evtype']= self.Configuration['event']['evtype'] 
#        else :
#            srcMaps['evtype']= 'INDEF'
        srcMaps['irfs']= self.irfs
        srcMaps['outfile'] = self.scrMap
        srcMaps['emapbnds']='no'
        srcMaps['clobber'] = self.clobber
        srcMaps.run()
Exemple #6
0
 def SrcMap(self):
     """Run gtsrcmap tool for binned analysis"""
     srcMaps['scfile'] = self.ft2
     srcMaps['expcube'] = self.Cubename
     srcMaps['cmap'] = self.ccube
     srcMaps['bexpmap'] = self.BinnedMapfile
     srcMaps['srcmdl'] = self.xmlfile
     #        if  self.Configuration['event']['irfs'] != 'CALDB':
     #            srcMaps['evtype']= self.Configuration['event']['evtype']
     #        else :
     #            srcMaps['evtype']= 'INDEF'
     srcMaps['irfs'] = self.irfs
     srcMaps['outfile'] = self.scrMap
     srcMaps['emapbnds'] = 'no'
     srcMaps['clobber'] = self.clobber
     srcMaps.run()
Exemple #7
0
 def SrcMap(self):
     """Run gtsrcmap tool for binned analysis"""
     if (self.clobber == "no" and os.path.isfile(self.srcMap)):
         #print("File exists and clobber is False")
         return (0)
     srcMaps['scfile'] = self.ft2
     srcMaps['expcube'] = self.Cubename
     srcMaps['cmap'] = self.ccube
     srcMaps['bexpmap'] = self.BinnedMapfile
     srcMaps['srcmdl'] = self.xmlfile
     if self.irfs != 'CALDB':
         srcMaps['evtype'] = self.Configuration['event']['evtype']
     else:
         srcMaps['evtype'] = 'INDEF'
     srcMaps['irfs'] = self.irfs
     srcMaps['outfile'] = self.srcMap
     srcMaps['emapbnds'] = 'no'
     srcMaps['clobber'] = self.clobber
     srcMaps.run()
Exemple #8
0
 def SrcMap(self):
     """Run gtsrcmap tool for binned analysis"""
     if (self.clobber=="no" and os.path.isfile(self.srcMap)):
         #print("File exists and clobber is False")
         return(0)
     srcMaps['scfile'] = self.ft2
     srcMaps['expcube'] = self.Cubename
     srcMaps['cmap'] = self.ccube
     srcMaps['bexpmap'] = self.BinnedMapfile
     srcMaps['srcmdl']=self.xmlfile
     if  self.irfs != 'CALDB':
         srcMaps['evtype']= self.Configuration['event']['evtype']
     else :
         srcMaps['evtype']= 'INDEF'
     srcMaps['irfs']= self.irfs
     srcMaps['outfile'] = self.srcMap
     srcMaps['emapbnds']='no'
     srcMaps['clobber'] = self.clobber
     srcMaps.run()