code: def _srcprob_app(self,xmlfile=None, overwrite=False, **kwargs):
          
  
          loglevel = kwargs.get('loglevel', self.loglevel)
  
          self.logger.log(loglevel, 'Computing src probability for component %s.',
                          self.name)
  
          # set the srcmdl
          srcmdl_file = self.files['srcmdl']
          if xmlfile is not None:
              srcmdl_file = self.get_model_path(xmlfile)
  
          # set the outfile
          # it's defined here and not in self.files dict
          # so that it is copied with the stage_output module
          # even if savefits is False
          outfile = os.path.join(self.workdir, 
                      'ft1_srcprob{0[file_suffix]:s}.fits'.format(self.config))
  
          kw = dict(evfile=self.files['ft1'],
              scfile=self.data_files['scfile'],
              outfile= outfile,
              irfs = self.config['gtlike']['irfs'],
              srcmdl = srcmdl_file)
          self.logger.debug(kw)
  
          # run gtapp for the srcprob
          if os.path.isfile(outfile) and not overwrite:
              self.logger.info('Skipping gtsrcprob')
          else:
              run_gtapp('gtsrcprob', self.logger, kw, loglevel=loglevel)
docs: Run srcprob for an analysis component as an application