HERA-Team / hera_sim

Simple simulation code for HERA-like redundant interferometric arrays
Other
16 stars 8 forks source link

Different check of `beam_ids` for `UVSim` object #253

Open piyanatk opened 1 year ago

piyanatk commented 1 year ago

When passing a config with a baseline selection keyword to a UVSim run, it will error-exit if not all antennas are present in the selection of baseline because the length of beam_ids does not match the number of antennas in the data, e.g.

Traceback (most recent call last):
  File "/users/piyanat/miniconda3/envs/viscpu/bin/hera-sim-vis.py", line 374, in <module>
    main(args, profiler, simulator)
  File "/users/piyanat/miniconda3/envs/viscpu/bin/hera-sim-vis.py", line 92, in main
    data_model = ModelData.from_config(
  File "/users/piyanat/miniconda3/envs/viscpu/lib/python3.10/site-packages/hera_sim/visibilities/simulators.py", line 202, in from_config
    return ModelData(
  File "/users/piyanat/miniconda3/envs/viscpu/lib/python3.10/site-packages/hera_sim/visibilities/simulators.py", line 87, in __init__
    self._validate_beam_ids(self.beam_ids, self.beams)
  File "/users/piyanat/miniconda3/envs/viscpu/lib/python3.10/site-packages/hera_sim/visibilities/simulators.py", line 176, in _validate_beam_ids
    raise ValueError(
ValueError: Length of beam_ids (12) must match the number of ants (10).

Select keywords should work with the UVSim wrapper, but currently limited by checking through the various ._validate methods, which are currently written with viscpu in mind.