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)
  
          if args.no_psf:
              performConvolution = False
          else:
              performConvolution = True
  
          config = BinnedAnalysis.BinnedConfig(performConvolution=performConvolution)
          like = BinnedAnalysis.BinnedAnalysis(obs,
                                               optimizer='MINUIT',
                                               srcModel=GtSrcmapsDiffuse.NULL_MODEL,
                                               wmap=None,
                                               config=config)
  
          source_factory = pyLike.SourceFactory(obs.observation)
          source_factory.readXml(args.srcmdl, BinnedAnalysis._funcFactory,
                                 False, True, True)
  
          source = source_factory.releaseSource(args.source)
  
          try:
              diffuse_source = pyLike.DiffuseSource.cast(source)
          except TypeError:
              diffuse_source = None
  
          if diffuse_source is not None:
              try:
                  diffuse_source.mapBaseObject().projmap().setExtrapolation(False)
              except RuntimeError:
                  pass
  
          like.logLike.saveSourceMap_partial(args.outfile, source, args.kmin, args.kmax)
  
          if args.gzip:
              os.system("gzip -9 %s" % args.outfile)
docs: Run this analysis