hera_sim.visibilities.matvis.MatVis

class hera_sim.visibilities.matvis.MatVis(precision: int = 2, use_gpu: bool = False, mpi_comm=None, check_antenna_conjugation: bool = True, **kwargs)[source]

matvis visibility simulator.

This is a fast, matrix-based visibility simulator.

Parameters:
  • polarized (bool, optional) – Whether to calculate polarized visibilities or not. By default does polarization iff multiple polarizations exist in the UVData object. The behaviour of the simulator is that if requesting polarized output and only a subset of the simulated pols are available in the UVdata object, the code will issue a warning but otherwise continue happily, throwing away the simulated pols it can’t store in the UVdata object. Conversely, if polarization is not requested and multiple polarizations are present on the UVData object, it will error unless allow_empty_pols is set to True (in which case it will warn but continue). The “unpolarized” output of matvis is expected to be XX polarization, which corresponds to whatever the UVData object considers to be the x-direction (default East).

  • precision (int, optional) – Which precision level to use for floats and complex numbers. Allowed values: - 1: float32, complex64 - 2: float64, complex128

  • use_gpu (bool, optional) – Whether to use the GPU version of matvis or not. Default: False.

  • mpi_comm (MPI communicator) – MPI communicator, for parallelization.

  • ref_time – A reference time for computing adjustments to the co-ordinate transforms using astropy. For best fidelity, set this to a mid-point of your observation times. If specified as a string, this must either use the ‘isot’ format and ‘utc’ scale, or be one of “mean”, “min” or “max”. If any of the latter, the value ll be calculated from the input data directly.

  • check_antenna_conjugation – Whether to check the antenna conjugation. Default is True. This is a fairly heavy operation if there are many antennas and/or many times, and can be safely ignored if the data_model was created from a config file.

  • **kwargs – Passed through to VisibilitySimulator.

Methods

compress_data_model(data_model)

Temporarily delete/remove data from the model to reduce memory usage.

estimate_memory(data_model)

Estimates the memory usage of the model.

from_yaml(yaml_config)

Generate the simulator from a YAML file or dictionary.

get_feed(uvdata)

Get the feed to use from the beam, given the UVData object.

restore_data_model(data_model)

Restore data from the model removed by compress_data_model().

simulate(data_model)

Calls :func:matvis to perform the visibility calculation.

validate(data_model)

Checks for correct input format.

Attributes

conjugation_convention

diffuse_ability

Whether this particular simulator has the ability to simulate diffuse maps directly.

point_source_ability

Whether this particular simulator has the ability to simulate point sources directly.

time_ordering