hera_sim.utils.reshape_vis

hera_sim.utils.reshape_vis(vis: ndarray, ant_1_array: ndarray, ant_2_array: ndarray, pol_array: ndarray, antenna_numbers: ndarray, n_times: int, n_freqs: int, n_ants: int, n_pols: int, invert: bool = False, use_numba: bool = True) ndarray[source]

Reshaping helper for mutual coupling sims.

The mutual coupling simulations take as input, and return, a data array with shape (Nblts, Nfreqs, Npols), but perform matrix multiplications on the data array reshaped to (Ntimes, Nfreqs, 2*Nants, 2*Nants). This function performs the reshaping between the matrix multiply shape and the input/output array shapes.

Parameters:
  • vis – Input data array.

  • ant_1_array – Array specifying the first antenna in each baseline.

  • ant_2_array – Array specifying the second antenna in each baseline.

  • pol_array – Array specifying the observed polarizations via polarization numbers.

  • antenna_numbers – Array specifying all of the antennas to include in the reshaped data.

  • n_times – Number of integrations in the data.

  • n_freqs – Number of frequency channels in the data.

  • n_ants – Number of antennas.

  • n_pols – Number of polarizations in the data.

  • invert – Whether to reshape to pyuvdata.UVData’s data array shape.

  • use_numba – Whether to use numba to speed up the reshaping.

Returns:

reshaped_vis – Input data reshaped to desired shape.