(output, accuracy)
return output_filtered
Function to remove from the output dictionnary entries containing shorelines 
    that were mapped on images with inaccurate georeferencing:
        - RMSE > accuracy for Landsat images
        - failed geometric test for Sentinel images (flagged with -1)

    Arguments:
    -----------
        output: dict
            contains the extracted shorelines and corresponding metadata
        accuracy: int
            minimum horizontal georeferencing accuracy (metres) for a shoreline to be accepted

    Returns:
    -----------
        output_filtered: dict
            contains the updated dictionnary
Function to remove from the output dictionnary entries containing shorelines 
    that were mapped on images with inaccurate georeferencing:
        - RMSE > accuracy for Landsat images
        - failed geometric test for Sentinel images (flagged with -1)
Function to remove from the output dictionnary entries containing shorelines that were mapped on images with inaccurate georeferencing : - RMSE > accuracy for Landsat images - failed geometric test for Sentinel images ( flagged with - 1 )
def remove_inaccurate_georef(output, accuracy):
    """
    Function to remove from the output dictionnary entries containing shorelines 
    that were mapped on images with inaccurate georeferencing:
        - RMSE > accuracy for Landsat images
        - failed geometric test for Sentinel images (flagged with -1)

    Arguments:
    -----------
        output: dict
            contains the extracted shorelines and corresponding metadata
        accuracy: int
            minimum horizontal georeferencing accuracy (metres) for a shoreline to be accepted

    Returns:
    -----------
        output_filtered: dict
            contains the updated dictionnary

    """

    # find indices of shorelines to be removed
    idx = np.where(~np.logical_or(np.array(output['geoaccuracy']) == -1,
                                  np.array(output['geoaccuracy']) >= accuracy))[0]
    # idx = np.where(~(np.array(output['geoaccuracy']) >= accuracy))[0]
    output_filtered = dict([])
    for key in output.keys():
        output_filtered[key] = [output[key][i] for i in idx]
    print('%d bad georef' % (len(output['geoaccuracy']) - len(idx)))
    return output_filtered
def remove_inaccurate_georef ( output , accuracy ) : # find indices of shorelines to be removed idx = np . where ( ~ np . logical_or ( np . array ( output [ 'geoaccuracy' ] ) == - 1 , np . array ( output [ 'geoaccuracy' ] ) >= accuracy ) ) [ 0 ] # idx = np.where(~(np.array(output['geoaccuracy']) >= accuracy))[0] output_filtered = dict ( [ ] ) for key in output . keys ( ) : output_filtered [ key ] = [ output [ key ] [ i ] for i in idx ] print ( '%d bad georef' % ( len ( output [ 'geoaccuracy' ] ) - len ( idx ) ) ) return output_filtered