code: def lightcurve(self, name, **kwargs):
          
  
          name = self.roi.get_source_by_name(name).name
  
          # Create schema for method configuration
          schema = ConfigSchema(self.defaults['lightcurve'],
                                optimizer=self.defaults['optimizer'])
          schema.add_option('prefix', '')
          config = utils.create_dict(self.config['lightcurve'],
                                     optimizer=self.config['optimizer'])
          config = schema.create_config(config, **kwargs)
  
          self.logger.info('Computing Lightcurve for %s' % name)
  
          o = self._make_lc(name, **config)
          filename = utils.format_filename(self.workdir, 'lightcurve',
                                           prefix=[config['prefix'],
                                                   name.lower().replace(' ', '_')])
  
          o['file'] = None
          if config['write_fits']:
              o['file'] = os.path.basename(filename) + '.fits'
              self._make_lc_fits(o, filename + '.fits', **config)
  
          if config['write_npy']:
              np.save(filename + '.npy', o)
  
          self.logger.info('Finished Lightcurve')
  
          return o
docs: Generate a lightcurve for the named source. The function will
          complete the basic analysis steps for each bin and perform a
          likelihood fit for each bin. Extracted values (along with
          errors) are Integral Flux, spectral model, Spectral index, TS
          value, pred. # of photons. Note: successful calculation of 
          TS:subscript:`var` requires at least one free background 
          parameter and a previously optimized ROI model.
  
          Parameters
          ---------
          name: str
              source name
  
          {options}
  
          Returns
          ---------
          LightCurve : dict
             Dictionary containing output of the LC analysis