code: def run_analysis(self, argv):
          
          args = self._parser.parse_args(argv)
  
          obs = BinnedAnalysis.BinnedObs(irfs=args.irfs,
                                         expCube=args.expcube,
                                         srcMaps=args.srcmaps,
                                         binnedExpMap=args.bexpmap)
  
          like = BinnedAnalysis.BinnedAnalysis(obs,
                                               optimizer='MINUIT',
                                               srcModel=GtMergeSrcmaps.NULL_MODEL,
                                               wmap=None)
  
          like.logLike.set_use_single_fixed_map(False)
  
          print("Reading xml model from %s" % args.srcmdl)
          source_factory = pyLike.SourceFactory(obs.observation)
          source_factory.readXml(args.srcmdl, BinnedAnalysis._funcFactory, False, True, True)
          strv = pyLike.StringVector()
          source_factory.fetchSrcNames(strv)
          source_names = [strv[i] for i in range(strv.size())]
  
          missing_sources = []
          srcs_to_merge = []
          for source_name in source_names:
              try:
                  source = source_factory.releaseSource(source_name)
                  # EAC, add the source directly to the model
                  like.logLike.addSource(source)
                  srcs_to_merge.append(source_name)
              except KeyError:
                  missing_sources.append(source_name)
  
          comp = like.mergeSources(args.merged, source_names, 'ConstantValue')
          like.logLike.getSourceMap(comp.getName())
  
          print("Merged %i sources into %s" % (len(srcs_to_merge), comp.getName()))
          if missing_sources:
              print("Missed sources: ", missing_sources)
  
          print("Writing output source map file %s" % args.outfile)
          like.logLike.saveSourceMaps(args.outfile, False, False)
          if args.gzip:
              os.system("gzip -9 %s" % args.outfile)
  
          print("Writing output xml file %s" % args.outxml)
          like.writeXml(args.outxml)
docs: Run this analysis