hera_sim.simulate.Simulator.add

Simulator.add(component: str | type[hera_sim.components.SimulationComponent] | SimulationComponent, *, add_vis: bool = True, ret_vis: bool = False, seed: str | int | None = None, vis_filter: Sequence | None = None, component_name: str | None = None, **kwargs) ndarray | dict[int, numpy.ndarray] | None[source]

Simulate an effect then apply and/or return the result.

Parameters:
  • component – Effect to be simulated. This can either be an alias of the effect, or the class (or instance thereof) that simulates the effect.

  • add_vis – Whether to apply the effect to the simulated data. Default is True.

  • ret_vis – Whether to return the simulated effect. Nothing is returned by default.

  • seed – How to seed the random number generator. Can either directly provide a seed as an integer, or use one of the supported keywords. See tutorial for using the Simulator for supported seeding modes. Default is to use a seed based on the current random state.

  • vis_filter – Iterable specifying which antennas/polarizations for which the effect should be simulated. See tutorial for using the Simulator for details of supported formats and functionality.

  • component_name – Name to use when recording the parameters used for simulating the effect. Default is to use the name of the class used to simulate the effect.

  • **kwargs – Optional keyword arguments for the provided component.

Returns:

effect – The simulated effect; only returned if ret_vis is set to True. If the simulated effect is multiplicative, then a dictionary mapping antenna numbers to the per-antenna effect (as a np.ndarray) is returned. Otherwise, the effect for the entire array is returned with the same structure as the pyuvdata.UVData.data_array that the data is stored in.