class_docstr: Class to generate simulated Source Estimates.
  
  Parameters
  ----------
  src : instance of SourceSpaces
      Source space.
  tstep : float
      Time step between successive samples in data. Default is 0.001 s.
  duration : float | None
      Time interval during which the simulation takes place in seconds.
      If None, it is computed using existing events and waveform lengths.
  first_samp : int
      First sample from which the simulation takes place, as an integer.
      Comparable to the :term:`first_samp` property of `~mne.io.Raw` objects.
      Default is 0.
  
  Attributes
  ----------
  duration : float
      The duration of the simulation in seconds.
  n_times : int
      The number of time samples of the simulation.
class_docstr_tok: ["Class","to","generate","simulated","Source","Estimates",".","Parameters","--","--","--","--","--","src",":","instance","of","SourceSpaces","Source","space",".","tstep",":","float","Time","step","between","successive","samples","in","data",".","Default","is","0.001","s.","duration",":","float","|","None","Time","interval","during","which","the","simulation","takes","place","in","seconds",".","If","None",",","it","is","computed","using","existing","events","and","waveform","lengths",".","first_samp",":","int","First","sample","from","which","the","simulation","takes","place",",","as","an","integer",".","Comparable","to","the",":","term",":","`","first_samp","`","property","of","`","~mne.io.Raw","`","objects",".","Default","is","0",".","Attributes","--","--","--","--","--","duration",":","float","The","duration","of","the","simulation","in","seconds",".","n_times",":","int","The","number","of","time","samples","of","the","simulation","."]
code: def __init__(self, src, tstep=1e-3, duration=None, first_samp=0):
      if duration is not None and duration < tstep:
          raise ValueError("duration must be None or >= tstep.")
      self.first_samp = _ensure_int(first_samp, "first_samp")
      self._src = src
      self._tstep = tstep
      self._labels = []
      self._waveforms = []
      self._events = np.empty((0, 3), dtype=int)
      self._duration = duration  # if not None, sets # samples
      self._last_samples = []
      self._chk_duration = 1000
  
file_path: mne-python/mne/simulation/source.py
imports: import numpy
  from ..fixes import rng_uniform
  from ..label import Label
  from ..source_estimate import SourceEstimate, VolSourceEstimate
  from ..source_space._source_space import _ensure_src
  from ..surface import _compute_nearest
  from ..utils import _check_option, _ensure_events, _ensure_int, check_random_state, fill_doc, warn
label_desc: Use image node_id 1 to create a new SourceSimulator object  with example: obj = SourceSimulator(src, tstep, duration, first_samp)