def ref_mode(mode):
    """
    Defines reference pixels for different imaging modes.
    
    Parameters:
        
        mode - string containing imaging mode.
        
    Returns:
    
        xref, yref - Floating point reference pixel coordinates
    
    """
    
    xref, yref = 692.5, 511.5
    xref_slit, yref_slit = 325.13, 299.7
    xref_slitless, yref_slitless = 37.5, 300.
    
    BRIGHTSKY_x, BRIGHTSKY_y = 711.5, 305.5
    SUB256_x, SUB256_y = 539.5, 177.5
    SUB128_x, SUB128_y =  69.5, 951.5
    SUB64_x, SUB64_y =  37.5, 809.5
        
    if "SLITLESS" in mode:
        xref = xref_slitless
        yref = yref_slitless

    elif "SLIT" in mode:
        xref = xref_slit
        yref = yref_slit

    elif "BRIGHTSKY" in mode:
        xref = BRIGHTSKY_x
        yref = BRIGHTSKY_y

    elif "256" in mode:
        xref = SUB256_x
        yref = SUB256_y
        
    elif "128" in mode:
        xref = SUB128_x
        yref = SUB128_y

    elif "64" in mode:
        xref = SUB64_x
        yref = SUB64_y

    else:
        xref = xref
        yref = yref
    
    return xref, yref