def merge_codes(a, b, sep='-'):
    """
    Merge network-station-location-channel codes of a pair of traces.
    """
    o = []
    for xa, xb in zip(a.nslc_id, b.nslc_id):
        if xa == xb:
            o.append(xa)
        else:
            o.append(sep.join((xa, xb)))
    return o
