Shuffling data¶
The hera_stats.shuffle
module contains functions to randomly shuffle data. This includes a function to construct new visibilities by shuffling samples from a set of visibilities within the same redundant baseline group (shuffle_data_redgrp
).
-
hera_stats.shuffle.
shuffle_data_redgrp
(uvd, redgrps)[source]¶ Construct a new set of visibilities by randomly shuffling samples between baselines in a redundant group.
Different random shuffles are performed at each frequency, time, and polarization. This creates a new set of visibilities that are made up of samples from a random combination of redundant baselines, but that do not mix or shuffle times, frequencies or polarizations.
The samples are shuffled _without_ replacement, so each sample is only ever used once.
- Example:
Original visibility (fixed time and pol, for freq. channels 1, 2, 3…):
bl_a = [a1, a2, a3, a4, …] bl_b = [b1, b2, b3, b4, …] bl_c = [c1, c2, c3, c4, …]Shuffled visibility (for example):
new_a = [b1, a2, c3, b4, …] new_b = [c1, c2, a3, a4, …] new_c = [a1, b2, b3, c4, …]
Parameters: - uvd (UVData object) – Input visibilities.
- redgrps (list of lists of bls) – List of redundant baseline groups.
Returns: uvd_new – Copy of uvd with baseline-shuffled visibilities.
Return type: UVData object