code: def to_struct_file(self, f):
          
          if isinstance(f, str):
              f = open(f,'w')
          f.write("STRUCTURE {0}\n".format(self.name))
          f.write("  NUGGET {0}\n".format(self.nugget))
          f.write("  NUMVARIOGRAM {0}\n".format(len(self.variograms)))
          for v in self.variograms:
              f.write("  VARIOGRAM {0} {1}\n".format(v.name,v.contribution))
          f.write("  TRANSFORM {0}\n".format(self.transform))
          f.write("END STRUCTURE\n\n")
          for v in self.variograms:
              v.to_struct_file(f)
docs: write a PEST-style structure file
  
          Parameters
          ----------
          f : (str or file handle)
              file to write the GeoStruct information to