Splitting data

The hera_stats.split module contains a range of convenience functions for splitting data in various ways.

hera_stats.split.blps_by_antnum(blps, split='norepeat')[source]

Split a list of redundant groups of baseline-pairs into two, depending on whether there are repeated antennas in the baseline pair (norepeat), or whether there are auto baselines in the pair (noautos).

Parameters:
  • blps (list of list of blpairs) – List of redundant groups of baseline-pairs. The blps can be either tuples of tuples, or blpair integers.
  • split (str, optional) – Type of split to perform on each baseline group. Available options are:
    • ‘norepeat’:
      Split into one group where antennas are used at most once per blpair, and another where they are used more than once.
    • ‘noautos’:
      Split into one group with auto-blpairs and one group with non-autos (but antennas can be used more than once per blpair).
Returns:

blps_a, blps_b

List of redundant groups of baseline-pairs.

  • For ‘norepeat’, group A contains the blps without repeated antennas, while group B contains the blps with repeated antennas.
  • For ‘noautos’, group A contains the blps without auto-baselines, while group B contains the blps with auto-baselines.

Return type:

list of list of blpairs

hera_stats.split.hour_angle(uvp, bins_list, specify_bins=False, bls=None)[source]

Splits UVPSpec based on the galactic hour-angle at the time of measurement.

Parameters:
  • uvp (list or UVPSpec) – List or single hera_pspec.UVPSpec object, containing data to use.
  • bins_list (list) – One entry for each bin layout, default is that it must be an integer, where min and max values for hourangle values will automatically be set as limits. If specify_bins is True, then the inpud must be a list of ndarrays.
  • specify_bins (boolean) – If true, allows bins_list to be specified as a list of the bins themselves. Default: False
  • bls (list of tuples, optional) – The baselines to use in in omitting antenna. If None, uses all baselines. Default: None.
Returns:

uvpl – The resulting data, one list per jackknife.

Return type:

list of UVPSpec pairs

hera_stats.split.lst_blocks(uvp, blocks=2, lst_range=(0.0, 6.28))[source]

Split a UVPSpec object into multiple objects, each containing spectra within different contiguous LST ranges. There is no guarantee that each block will contain the same number of spectra or samples.

N.B. This function uses the lst_avg_array property of an input UVPSpec object to split the LSTs (and not the LSTs of the individual visibilities that went into creating each delay spectrum).

Parameters:
  • uvp (UVPSpec) – Object containing delay spectra.
  • blocks (int, optional) – How many blocks to return. Default: 2.
  • lst_range (tuple, optional) – Tuple containing the minimum and maximum LST to retain. This is the range that will be split up into blocks. Default: (0., 2*pi)
Returns:

  • uvp_list (list of UVPSpec) – List of UVPSpec objects, one for each LST range. Empty blocks will appear as None in the list.
  • lst_bins (array_like) – Array of LST bin edges. This has dimension (blocks+1,).

hera_stats.split.lst_stripes(uvp, stripes=2, width=1, lst_range=(0.0, 6.28))[source]

Split a UVPSpec object into multiple UVPSpec objects, each containing spectra within alternating stripes of LST.

N.B. Gaps in LST are ignored; this function stripes based on the ordered list of available LSTs in uvp only.

N.B. This function uses the lst_avg_array property of the input UVPSpec object to split the LSTs (and not the LSTs of the individual visibilities that went into creating each delay spectrum).

Parameters:
  • uvp (UVPSpec) – Object containing delay spectra.
  • stripes (int, optional) – How many stripes to return. Default: 2.
  • width (int, optional) – Width of each stripe, in number of LST bins. Default: 1.
  • lst_range (tuple, optional) – Tuple containing the minimum and maximum LST to retain. This is the range that will be split up into blocks. Default: (0., 2*pi)
Returns:

uvp_list – List of UVPSpec objects, one for each LST range.

Return type:

list of UVPSpec

hera_stats.split.omit_ants(uvp, ant_nums=None, bls=None)[source]

Splits UVPSpecs into groups, omitting one antenna from each.

uvp: UVPSpec or list
Single UVPSpec or list of UVPSpecs to use in splitting.
ant_nums: list, optional
A list containing integers, each entry will generate one UVPSpec which does not contain the antenna specified.
bls: list of tuples, optional
The baselines to use in in omitting antenna. If None, uses all baselines. Default: None.
Returns:uvp_list – A list containing one list of UVPSpecs, with one for every ant_num specified.
Return type:list of UVPSpecs