def find_edges(fluxes, num_edge_chan):
    """
    Seek from the edges to find where the data starts for this set of fluxes.
    This accounts for an optional number of channels in the data which have no
    data recorded.
    :param fluxes: The array of fluxes to be checked.
    :param num_edge_chan: The number of edge channels with data to be skipped
    :return: The index of the first and last cell to have data.
    """

    l_edge = 0
    r_edge = len(fluxes)-1

    while l_edge < len(fluxes)-1 and fluxes[l_edge] == 0:
        l_edge += 1

    while r_edge > 0 and fluxes[r_edge] == 0:
        r_edge -= 1

    return l_edge + num_edge_chan, r_edge - num_edge_chan