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, 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)
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)