def ring_mask_no_photometry(star, width, xt, yt, dt, i_deg, phi_deg):

    ring_radii = np.arange(0, 100, 0.001)
    ring_valid = np.zeros_like(ring_radii)

    star_x, star_y = np.shape(star)

    xc = (star_x - 1) / 2.
    yc = (star_y - 1) / 2.

    sgr = np.mgrid[:star_y, :star_x]

    tsize = width / (star_x - 1)

    sgr[0] -= yc
    sgr[1] -= xc
    sgr = sgr * tsize

    masked = sgr[:, (star > 0)]
    # masked now is a flat array containing 2N elements
    # first N has the y positions
    # second N has the x positions

    for x in xt:
        # for each photometric time point in x, calculate the
        # max r and min r subtended by the star

        # pass those points to the routine to return r for all those points
        agr2 = np.copy(masked)
        agr2[0] += yt
        agr2[1] += (x - dt)

        rell = ellipse(agr2, i_deg, phi_deg)

        # get min r and max r in the area covered by the star at that
        # time
        minr = np.min(rell)
        maxr = np.max(rell)

        # mark that range of radii as valid
        ring_valid[(ring_radii > minr)*(ring_radii < maxr)] = 1.0

    # work up from zero r, find the boundaries for each bad masked ring
    drv = ring_valid[1:] - ring_valid[:-1]

    ringstart = ring_radii[(drv < -0.5)]
    ringends = ring_radii[(drv > 0.5)]

    # these two conditions make sure that the bad ring boundaries are
    # correctly offset
    # if the first ring_valid is zero. then the
    # pixels are bad from r=0 up to the first ring
    if ring_valid[0] == 0:
        ringstart = np.insert(ringstart, 0, 0.0)
    if ring_valid[-1] == 0:
        ringends = np.append(ringends, ring_radii[-1])

    return(ringstart, ringends)
McNemar test of homogeneity.
dataset/ETHPy150Open mkenworthy/exorings/exorings.py/ring_mask_no_photometry--crossover with--dataset/ETHPy150Open statsmodels/statsmodels/statsmodels/stats/contingency_tables.py/mcnemar