def loadTotalRMSDat(rmsFile):
    """Return a dictionary from the RMS.dat total RMS text file
    """
    rmsDict={}
    fh=open(rmsFile)
    fmt=fh.readline().strip()
    #print fmt
    #assumes format: calMode S/N deltaJ PolPur rms0 rms1 rms2
    for line in fh.readlines():
        rmsList=line.strip().split(' ')
        rmsDict[(float(rmsList[1]),float(rmsList[2]),float(rmsList[3]),rmsList[0])]=map(float,rmsList[4:])
    return rmsDict