def readOffsetFile(name):
    """
    Read offset file with three floating point numbers representing x, y, and z
    offsets on separate lines.
    """
    offsets = []
    with open(name, 'r') as f:
        for line in f:
            if line.startswith('#'):
                continue
            offsets.append(float(line))

    if len(offsets) != 3:
        raise RuntimeError('Offset file must contain 3 floating point values')

    return offsets