def get_filename_pair(filename):
    """
    Given the name of a VASF data file (*.rsd) or parameter file (*.rsp) return
    a tuple of (parameters_filename, data_filename). It doesn't matter if the
    filename is a fully qualified path or not.
    - assumes extensions are all caps or all lower

    """
    param_filename = data_filename = filename[:-1]
    if filename[-1:].isupper():
        data_filename += 'D'
        param_filename += 'P'
    else:
        data_filename += 'd'
        param_filename += 'p'

    return (param_filename, data_filename)