hera_sim.simulate.Simulator.get

Simulator.get(component: str | type[hera_sim.components.SimulationComponent] | SimulationComponent, key: int | str | tuple[int, int] | tuple[int, int, str] | None = None) ndarray | dict[int, numpy.ndarray][source]

Retrieve an effect that was previously simulated.

Parameters:
  • component – Effect that is to be retrieved. See add() for more details.

  • key

    Key for retrieving simulated effect. Possible choices are as follows:

    An integer may specify either a single antenna (for per-antenna effects) or be a pyuvdata-style baseline integer. A string specifying a polarization can be used to retrieve the effect for every baseline for the specified polarization. A length-2 tuple of integers can be used to retrieve the effect for that baseline for all polarizations. A length-3 tuple specifies a particular baseline and polarization for which to retrieve the effect.

    Not specifying a key results in the effect being returned for all baselines (or antennas, if the effect is per-antenna) and polarizations.

Returns:

effect – The simulated effect appropriate for the provided key. Return type depends on the effect being simulated and the provided key. See the tutorial Jupyter notebook for the Simulator for example usage.

Notes

This will only produce the correct output if the simulated effect is independent of the data itself. If the simulated effect contains a randomly-generated component, then the random seed must have been set when the effect was initially simulated.