hera_sim.visibilities.simulators.VisibilitySimulator

class hera_sim.visibilities.simulators.VisibilitySimulator[source]

Base class for all hera_sim-compatible visibility simulators.

To define a new simulator, make a subclass. The subclass should overwrite available class-attributes as necessary, and specify a __version__ of the simulator code itself.

The simulate() abstract method must be overwritten in the subclass, to perform the actual simulation. The validate() method may also be overwritten to validate the given UVData input for the particular simulator.

The subclass may define any number of simulator-specific parameters as part of its init method.

Finally, to enable constructing the simulator in command-line applications, a from_yaml() method is provided. This will load a YAML file’s contents as a dictionary, and then instantiate the subclass with the parameters in that dict. To enable some control over this process, the subclass can overwrite the _from_yaml_dict() private method, which takes in the dictionary read from the YAML file, and transforms any necessary parameters before constructing the class. For example, if the class required a set of data from a file, the YAML might contain the filename itself, and in _from_yaml_dict(), the file would be read and the data itself passed to the constructor.

Methods

compress_data_model(data_model)

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

estimate_memory(data_model)

Estimate the memory usage of the simulator in GB.

from_yaml(yaml_config)

Generate the simulator from a YAML file or dictionary.

restore_data_model(data_model)

Restore data from the model removed by compress_data_model().

simulate(data_model)

Simulate the visibilities.

validate(data_model)

Check that the data model complies with the assumptions of the simulator.

Attributes

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.