hera_sim.simulate.Simulator.run_sim¶
- Simulator.run_sim(sim_file=None, **sim_params)[source]¶
Run an entire simulation.
- Parameters:
sim_file – Path to a configuration file specifying simulation parameters. Required if
sim_params
is not provided.**sim_params – Once-nested dictionary mapping simulation components to models, with each model mapping to a dictionary of parameter-value pairs. Required if
sim_file
is not provided.
- Returns:
components – List of simulation components that were generated with the parameter
ret_vis
set toTrue
, returned in the order that they were simulated. This is only returned if there is at least one simulation component withret_vis
set toTrue
in its configuration file/dictionary.
Examples
Suppose we have the following configuration dictionary:
sim_params = { "pntsrc_foreground": {"seed": "once", "nsrcs": 500}, "gains": {"seed": "once", "dly_rng": [-20, 20], "ret_vis": True}, "reflections": {"seed": "once", "dly_jitter": 10}, }
Invoking this method with
**sim_params
as its argument will simulate visibilities appropriate for a sky with 500 point sources, generate bandpass gains for each antenna and apply the effect to the foreground data, then generate cable reflections with a Gaussian jitter in the reflection delays with a standard deviation of 10 ns and apply the effect to the data. The return value will be a list with one entry: a dictionary mapping antenna numbers to their associated bandpass gains.The same effect can be achieved by writing a YAML file that is loaded into a dictionary formatted as above. See the
Simulator
tutorial for a more in-depth explanation of how to use this method.