code: def run_analysis(self, argv):
          
          args = self._parser.parse_args(argv)
          obs = BinnedAnalysis.BinnedObs(irfs=args.irfs,
                                         expCube=args.expcube,
                                         srcMaps=args.cmap,
                                         binnedExpMap=args.bexpmap)
  
          like = BinnedAnalysis.BinnedAnalysis(obs,
                                               optimizer='MINUIT',
                                               srcModel=GtSrcmapsCatalog.NULL_MODEL,
                                               wmap=None)
  
          source_factory = pyLike.SourceFactory(obs.observation)
          source_factory.readXml(args.srcmdl, BinnedAnalysis._funcFactory,
                                 False, True, True)
  
          srcNames = pyLike.StringVector()
          source_factory.fetchSrcNames(srcNames)
  
          min_idx = args.srcmin
          max_idx = args.srcmax
          if max_idx < 0:
              max_idx = srcNames.size()
  
          for i in xrange(min_idx, max_idx):
              if i == min_idx:
                  like.logLike.saveSourceMaps(args.outfile)
                  pyLike.CountsMapBase.copyAndUpdateDssKeywords(args.cmap,
                                                                args.outfile,
                                                                None,
                                                                args.irfs)
  
              srcName = srcNames[i]
              source = source_factory.releaseSource(srcName)
              like.logLike.addSource(source, False)
              like.logLike.saveSourceMap_partial(args.outfile, source)
              like.logLike.deleteSource(srcName)
  
          if args.gzip:
              os.system("gzip -9 %s" % args.outfile)
docs: Run this analysis