示例#1
0
 def _createObservation(self, srcMaps, expCube, irfs):
     self._respFuncs = pyLike.ResponseFunctions()
     self._respFuncs.load_with_event_types(irfs, "", self.srcMaps, "")
     self._expMap = pyLike.ExposureMap()
     self._scData = pyLike.ScData()
     self._roiCuts = pyLike.RoiCuts()
     self._roiCuts.readCuts(srcMaps, "", False)
     self._expCube = pyLike.ExposureCube()
     self._expCube.readExposureCube(expCube)
     self._expCube.setEfficiencyFactor(self._respFuncs.efficiencyFactor())
     self._eventCont = pyLike.EventContainer(self._respFuncs, self._roiCuts,
                                             self._scData)
     # EAC: Use AppHelpers to get the right type of BinnedExposure map
     self._bexpmap = pyLike.AppHelpers_readBinnedExposure(self.binnedExpMap)
     if self.phased_expmap is not None:
         self._phased_expmap = pyLike.WcsMap2(self.phased_expmap)
         self.observation = pyLike.Observation(self._respFuncs,
                                               self._scData, self._roiCuts,
                                               self._expCube, self._expMap,
                                               self._eventCont,
                                               self._bexpmap,
                                               self._phased_expmap)
     else:
         self.observation = pyLike.Observation(self._respFuncs,
                                               self._scData, self._roiCuts,
                                               self._expCube, self._expMap,
                                               self._eventCont,
                                               self._bexpmap)
     self._meanPsf = pyLike.MeanPsf(self.countsMap.refDir(),
                                    self.countsMap.energies(),
                                    self.observation)
     self.observation.setMeanPsf(self._meanPsf)
    def __init__(self, new_event_file, other_obs):
        self.sctable = other_obs.sctable

        self.checkCuts = False

        self.expMap = other_obs.expMap
        self.expCube = other_obs.expCube
        self.irfs = other_obs.irfs
        ft2 = other_obs.scFiles[0]

        self._inputs = '\n'.join(
            ('Event file(s): ' + str(new_event_file),
             'Spacecraft file(s): ' + str(ft2),
             'Exposure map: ' + str(self.expMap),
             'Exposure cube: ' + str(self.expCube), 'IRFs: ' + str(self.irfs)))

        self._respFuncs = other_obs._respFuncs

        self._expMap = other_obs._expMap

        self._scData = other_obs._scData

        self._roiCuts = other_obs._roiCuts

        self._expCube = other_obs._expCube

        self._eventCont = pyLike.EventContainer(self._respFuncs, self._roiCuts,
                                                self._scData)
        self.observation = pyLike.Observation(self._respFuncs, self._scData,
                                              self._roiCuts, self._expCube,
                                              self._expMap, self._eventCont)
        self._readData(ft2, new_event_file)
示例#3
0
 def __init__(self,
              eventFile=None,
              scFile=None,
              expMap=None,
              expCube=None,
              irfs='TEST',
              checkCuts=True):
     self.checkCuts = checkCuts
     if eventFile is None and scFile is None:
         eventFile, scFile, expMap, expCube, irfs = self._obsDialog()
     if checkCuts:
         self._checkCuts(eventFile, expMap, expCube)
     self._inputs = eventFile, scFile, expMap, irfs
     self._respFuncs = pyLike.ResponseFunctions()
     self._respFuncs.load(irfs)
     self._expMap = pyLike.ExposureMap()
     if expMap is not None and expMap is not "":
         self._expMap.readExposureFile(expMap)
     self._scData = pyLike.ScData()
     self._roiCuts = pyLike.RoiCuts()
     self._expCube = pyLike.ExposureCube()
     if expCube is not None and expCube is not "":
         self._expCube.readExposureCube(expCube)
     self._eventCont = pyLike.EventContainer(self._respFuncs, self._roiCuts,
                                             self._scData)
     self.observation = pyLike.Observation(self._respFuncs, self._scData,
                                           self._roiCuts, self._expCube,
                                           self._expMap, self._eventCont)
     self._readData(scFile, eventFile)
示例#4
0
 def __init__(self,
              eventFile=None,
              scFile=None,
              expMap=None,
              expCube=None,
              irfs=None,
              checkCuts=True,
              sctable='SC_DATA'):
     self.sctable = sctable
     self.checkCuts = checkCuts
     if eventFile is None and scFile is None:
         eventFile, scFile, expMap, expCube, irfs = self._obsDialog()
     if checkCuts:
         self._checkCuts(eventFile, expMap, expCube)
     self.expMap = expMap
     self.expCube = expCube
     if irfs is None or irfs == 'CALDB':
         evfiles = self._fileList(eventFile)
         my_cuts = pyLike.Cuts(evfiles[0], "EVENTS", False, True, True)
         self.irfs = my_cuts.CALDB_implied_irfs()
     else:
         self.irfs = irfs
     self._inputs = '\n'.join(
         ('Event file(s): ' + str(eventFile),
          'Spacecraft file(s): ' + str(scFile),
          'Exposure map: ' + str(expMap), 'Exposure cube: ' + str(expCube),
          'IRFs: ' + str(irfs)))
     self._respFuncs = pyLike.ResponseFunctions()
     evfiles = self._fileList(eventFile)
     self._respFuncs.load_with_event_types(self.irfs, "", evfiles[0],
                                           "EVENTS")
     self._expMap = pyLike.ExposureMap()
     if expMap is not None and expMap != "":
         self._expMap.readExposureFile(expMap)
     self._scData = pyLike.ScData()
     self._roiCuts = pyLike.RoiCuts()
     self._expCube = pyLike.ExposureCube()
     if expCube is not None and expCube != "":
         self._expCube.readExposureCube(expCube)
     self._expCube.setEfficiencyFactor(self._respFuncs.efficiencyFactor())
     self._eventCont = pyLike.EventContainer(self._respFuncs, self._roiCuts,
                                             self._scData)
     self.observation = pyLike.Observation(self._respFuncs, self._scData,
                                           self._roiCuts, self._expCube,
                                           self._expMap, self._eventCont)
     self._readData(scFile, eventFile)