Changeset 1073


Ignore:
Timestamp:
Mar 14, 2005, 11:14:25 AM (20 years ago)
Author:
duncan
Message:

change how geo-ref stuff is handled in .tsh files

Location:
inundation/ga/storm_surge/pmesh
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • inundation/ga/storm_surge/pmesh/load_mesh/loadASCII.py

    r1071 r1073  
    199199        segmenttags.append(stringtag)
    200200
    201     try:
    202         geo_reference = Geo_reference(ASCIIFile=fd)
    203     except:
    204         #geo_ref not compulsory
    205         geo_reference = None
    206201           
    207202    meshDict = {}
     
    214209    meshDict['segment_tags'] = segmenttags
    215210    meshDict['vertex_attribute_titles'] = vertTitle
    216     meshDict['geo_reference'] = geo_reference
     211   
    217212    return meshDict
    218213   
     
    241236    ######### loading the point info
    242237    line = fd.readline()
    243     #print line
     238    #print 'read_outline - line',line
    244239    fragments = line.split()
    245240    #for fragment in fragments:
     
    357352        except IndexError, e:
    358353            regionmaxareas.append(None)
     354
     355    try:
     356        geo_reference = Geo_reference(ASCIIFile=fd)
     357    except:
     358        #geo_ref not compulsory
     359        geo_reference = None
    359360       
    360361    meshDict = {}
     
    367368    meshDict['region_tags'] = regionattributes
    368369    meshDict['region_max_areas'] = regionmaxareas
     370    meshDict['geo_reference'] = geo_reference
     371   
    369372    #print "meshDict",meshDict
    370373    return meshDict
     
    485488                 + str(segment_tags[i]) + "\n")
    486489
    487     # geo_reference info
    488     if gen_dict.has_key('geo_reference') and not gen_dict['geo_reference'] is None:
    489         gen_dict['geo_reference'].write_ASCII(fd)
    490490
    491491def export_mesh_file(ofile,mesh_dict):
     
    611611        fd.write(str(i) + " " + area + "\n")
    612612
     613    # geo_reference info
     614    if dict.has_key('geo_reference') and not dict['geo_reference'] is None:
     615        dict['geo_reference'].write_ASCII(fd)
    613616
    614617def write_msh_file(filename, mesh):
  • inundation/ga/storm_surge/pmesh/meshHarness.py

    r1034 r1073  
    720720     
    721721        r1 = Region(0.3, 0.3,tag = "1.3")
    722         geo = Geo_reference(8.9,8.9,65)
     722        geo = Geo_reference(65,8.9,8.9)
    723723        m = Mesh(userVertices=[a,d,f,e],
    724724                 userSegments=[s1,s2,s3,s4],
Note: See TracChangeset for help on using the changeset viewer.