def ALMAGetMaxBl(asdm):
    """
    Return maximum baseline length (km)
    
    * asdm  = ASDM object
    """
     # Get max baseline length
    maxBl = 0.0
    sta = asdm.Station  # Get list
    nants = len(sta)
    for i in range(0,nants):
        for j in range(i+1,nants):
            dx = sta[i]['position'][0] - sta[j]['position'][0]
            dy = sta[i]['position'][1] - sta[j]['position'][1]
            dz = sta[i]['position'][2] - sta[j]['position'][2]
            bl = (dx*dx + dy*dy + dz*dz)**0.5
            if (bl>maxBl) and (bl<100.0e3):  # Trap gonzo values
                maxBl = bl
    return maxBl * 1.0e-3