def state(self, output=sys.stdout): close = False try: output = open(output, 'w') close = False except: pass output.write("from BinnedAnalysis import *\n") output.write(("obs = BinnedObs(srcMaps=%s, expCube=%s, " + "binnedExpMap=%s, irfs='%s')\n") % (_quotefn(self.srcMaps), _quotefn(self.expCube), _quotefn(self.binnedExpMap), self.irfs)) if close: output.close()
def state(self, output=sys.stdout): close = False try: output = open(output, 'w') close = True except: pass output.write("from UnbinnedAnalysis import *\n") output.write(("obs = UnbinnedObs(%s, %s, expMap=%s, expCube=%s, " + "irfs='%s')\n") % (`self.eventFiles`, `self.scFiles`, _quotefn(self.expMap), _quotefn(self.expCube), self.irfs)) if close: output.close()
def state(self, output=sys.stdout): close = False try: output = open(output, 'w') close = False except: pass self.binnedData.state(output) output.write(("like = BinnedAnalysis(obs, srcModel=%s, " + "optimizer='%s')\n") % (_quotefn(self.srcModel), self.optimizer)) if close: output.close()