code: def simulate_roi(self, name=None, clear=True, randomize=True):
          
          cm = self.counts_map()
          data = cm.data
          m = self.model_counts_map(name) 
  
          if clear:
              data.fill(0.0)
  
          if randomize:
              if m.data.min()<0.:
                  self.logger.warning('At least on negative value found in model map.'
                                      ' Changing it/them to 0')
                  indexcond = np.where( m.data <0. )
                  m.data[indexcond]=np.zeros(len(m.data[indexcond]))
                  
              data += np.random.poisson(m.data).astype(float)
          else:
              data += m.data
  
          if hasattr(self.like.logLike, 'setCountsMap'):
              self.like.logLike.setCountsMap(np.ravel(data))
  
          srcmap_utils.update_source_maps(self.files['srcmap'],
                                          {'PRIMARY': data},
                                          logger=self.logger)
          cm.write(self.files['ccubemc'], overwrite=True, conv='fgst-ccube')
docs: Simulate the whole ROI or inject a simulation of one or
          more model components into the data.
  
          Parameters
          ----------
          name : str
             Name of the model component to be simulated.  If None then
             the whole ROI will be simulated.
  
          clear : bool
             Zero the current counts map before injecting the simulation.
  
          randomize : bool
             Fill with each pixel with random values drawn from a
             poisson distribution.  If false then fill each pixel with
             the counts expectation value.