function to read information from a PEST-style structure file

    Parameters
    ----------
    f : (file handle)
        file handle open for reading

    Returns
    -------
    nugget : float
        the GeoStruct nugget
    transform : str
        the GeoStruct transformation
    variogram_info : dict
        dictionary of structure-level variogram information

def _read_structure_attributes(f):
    """ function to read information from a PEST-style structure file

    Parameters
    ----------
    f : (file handle)
        file handle open for reading

    Returns
    -------
    nugget : float
        the GeoStruct nugget
    transform : str
        the GeoStruct transformation
    variogram_info : dict
        dictionary of structure-level variogram information

    """

    line = ''
    variogram_info = {}
    while "end structure" not in line:
        line = f.readline()
        if line == '':
            raise Exception("EOF while reading structure")
        line = line.strip().lower().split()
        if line[0].startswith('#'):
            continue
        if line[0] == "nugget":
            nugget = float(line[1])
        elif line[0] == "transform":
            transform = line[1]
        elif line[0] == "numvariogram":
            numvariograms = int(line[1])
        elif line[0] == "variogram":
            variogram_info[line[1]] = float(line[2])
        elif line[0] == "end":
            break
        elif line[0] == "mean":
            warnings.warn("'mean' attribute not supported, skipping",PyemuWarning)
        else:
            raise Exception("unrecognized line in structure definition:{0}".\
                            format(line[0]))
    assert numvariograms == len(variogram_info)
    return nugget,transform,variogram_info