(output)
return output_all
Function to merge the output dictionnary, which has one key per satellite mission
    into a dictionnary containing all the shorelines and dates ordered chronologically.
    
    Arguments:
    -----------
    output: dict
        contains the extracted shorelines and corresponding dates, organised by 
        satellite mission
    
    Returns:    
    -----------
    output_all: dict
        contains the extracted shorelines in a single list sorted by date
Function to merge the output dictionnary, which has one key per satellite mission
    into a dictionnary containing all the shorelines and dates ordered chronologically.
    
    Arguments:
    -----------
    output: dict
        contains the extracted shorelines and corresponding dates, organised by 
        satellite mission
    
    Returns:    
    -----------
    output_all: dict
        contains the extracted shorelines in a single list sorted by date
Function to merge the output dictionnary which has one key per satellite mission into a dictionnary containing all the shorelines and dates ordered chronologically . Arguments : ----------- output : dict contains the extracted shorelines and corresponding dates organised by satellite mission Returns : ----------- output_all : dict contains the extracted shorelines in a single list sorted by date
def merge_output(output):
    """
    Function to merge the output dictionnary, which has one key per satellite mission
    into a dictionnary containing all the shorelines and dates ordered chronologically.
    
    Arguments:
    -----------
    output: dict
        contains the extracted shorelines and corresponding dates, organised by 
        satellite mission
    
    Returns:    
    -----------
    output_all: dict
        contains the extracted shorelines in a single list sorted by date
    
    """     
    
    # initialize output dict
    output_all = dict([])
    satnames = list(output.keys())
    for key in output[satnames[0]].keys():
        output_all[key] = []
    # create extra key for the satellite name
    output_all['satname'] = []
    # fill the output dict
    for satname in list(output.keys()):
        for key in output[satnames[0]].keys():
            output_all[key] = output_all[key] + output[satname][key]
        output_all['satname'] = output_all['satname'] + [_ for _ in np.tile(satname,
                  len(output[satname]['dates']))]
    # sort chronologically
    idx_sorted = sorted(range(len(output_all['dates'])), key=output_all['dates'].__getitem__)
    for key in output_all.keys():
        output_all[key] = [output_all[key][i] for i in idx_sorted]

    return output_all
def merge_output ( output ) : # initialize output dict output_all = dict ( [ ] ) satnames = list ( output . keys ( ) ) for key in output [ satnames [ 0 ] ] . keys ( ) : output_all [ key ] = [ ] # create extra key for the satellite name output_all [ 'satname' ] = [ ] # fill the output dict for satname in list ( output . keys ( ) ) : for key in output [ satnames [ 0 ] ] . keys ( ) : output_all [ key ] = output_all [ key ] + output [ satname ] [ key ] output_all [ 'satname' ] = output_all [ 'satname' ] + [ _ for _ in np . tile ( satname , len ( output [ satname ] [ 'dates' ] ) ) ] # sort chronologically idx_sorted = sorted ( range ( len ( output_all [ 'dates' ] ) ) , key = output_all [ 'dates' ] . __getitem__ ) for key in output_all . keys ( ) : output_all [ key ] = [ output_all [ key ] [ i ] for i in idx_sorted ] return output_all