def yield_fg_model_array(nants, nfreqs, fg_model_comps, fg_coeffs, corr_inds):
    'Compute tensor foreground model.\n\n    Parameters\n    ----------\n    nants: int\n        number of antennas in data to model.\n    freqs: int\n        number of frequencies in data to model.\n    fg_model_comps: list\n        list of fg modeling tf.Tensor objects\n        representing foreground modeling vectors.\n        Each tensor is (nvecs, ngrps, nbls, nfreqs)\n    fg_coeffs: list\n        list of fg modeling tf.Tensor objects\n        representing foreground modeling coefficients.\n        Each tensor is (nvecs, ngrps, 1, 1)\n    corr_inds: list\n        list of list of lists of 2-tuples. Hierarchy of lists is\n        chunk\n            group\n                baseline - (int 2-tuple)\n\n    Returns\n    -------\n    model: tf.Tensor object\n        nants x nants x nfreqs model of the visibility data\n    '
    model = np.zeros((nants, nants, nfreqs))
    nchunks = len(fg_model_comps)
    for cnum in range(nchunks):
        ngrps = fg_model_comps[cnum].shape[1]
        gchunk = tf.reduce_sum((fg_coeffs[cnum] * fg_model_comps[cnum]), axis=0).numpy()
        for gnum in range(ngrps):
            for (blnum, (i, j)) in enumerate(corr_inds[cnum][gnum]):
                model[(i, j)] = gchunk[(gnum, blnum)]
    return model
Compute tensor foreground model.

Parameters
----------
nants: int
    number of antennas in data to model.
freqs: int
    number of frequencies in data to model.
fg_model_comps: list
    list of fg modeling tf.Tensor objects
    representing foreground modeling vectors.
    Each tensor is (nvecs, ngrps, nbls, nfreqs)
fg_coeffs: list
    list of fg modeling tf.Tensor objects
    representing foreground modeling coefficients.
    Each tensor is (nvecs, ngrps, 1, 1)
corr_inds: list
    list of list of lists of 2-tuples. Hierarchy of lists is
    chunk
        group
            baseline - (int 2-tuple)

Returns
-------
model: tf.Tensor object
    nants x nants x nfreqs model of the visibility data
def yield_fg_model_array(nants, nfreqs, fg_model_comps, fg_coeffs, corr_inds):
    'Compute tensor foreground model.\n\n    Parameters\n    ----------\n    nants: int\n        number of antennas in data to model.\n    freqs: int\n        number of frequencies in data to model.\n    fg_model_comps: list\n        list of fg modeling tf.Tensor objects\n        representing foreground modeling vectors.\n        Each tensor is (nvecs, ngrps, nbls, nfreqs)\n    fg_coeffs: list\n        list of fg modeling tf.Tensor objects\n        representing foreground modeling coefficients.\n        Each tensor is (nvecs, ngrps, 1, 1)\n    corr_inds: list\n        list of list of lists of 2-tuples. Hierarchy of lists is\n        chunk\n            group\n                baseline - (int 2-tuple)\n\n    Returns\n    -------\n    model: tf.Tensor object\n        nants x nants x nfreqs model of the visibility data\n    '
    model = np.zeros((nants, nants, nfreqs))
    nchunks = len(fg_model_comps)
    for cnum in range(nchunks):
        ngrps = fg_model_comps[cnum].shape[1]
        gchunk = tf.reduce_sum((fg_coeffs[cnum] * fg_model_comps[cnum]), axis=0).numpy()
        for gnum in range(ngrps):
            for (blnum, (i, j)) in enumerate(corr_inds[cnum][gnum]):
                model[(i, j)] = gchunk[(gnum, blnum)]
    return model