Changeset 1047
- Timestamp:
- Mar 9, 2005, 4:37:29 PM (20 years ago)
- Location:
- inundation/ga/storm_surge/pmesh/load_mesh
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
inundation/ga/storm_surge/pmesh/load_mesh/loadASCII.py
r1021 r1047 51 51 52 52 from string import find, rfind 53 from Numeric import array, Float, Int16, Character,reshape, concatenate53 from Numeric import array, Float, Int16, Int32, Character,reshape, concatenate 54 54 from os.path import splitext 55 55 … … 197 197 stringtag = line.strip() 198 198 segmenttags.append(stringtag) 199 200 try: 201 geo_reference = Geo_reference(ASCIIFile=fd) 202 except AttributeError, e: 203 #geo_ref not compulsory 204 geo_reference = None 205 199 206 meshDict = {} 200 207 meshDict['vertices'] = points … … 206 213 meshDict['segment_tags'] = segmenttags 207 214 meshDict['vertex_attribute_titles'] = vertTitle 215 meshDict['geo_reference'] = geo_reference 208 216 return meshDict 209 217 … … 385 393 return numbers 386 394 395 #FIXME change this name 387 396 def write_ASCII_triangulation(fd, 388 397 gen_dict): … … 475 484 + str(segment_tags[i]) + "\n") 476 485 486 # geo_reference info 487 if gen_dict.has_key('geo_reference') and not gen_dict['geo_reference'] is None: 488 gen_dict['geo_reference'].write_ASCII(fd) 477 489 478 490 def export_mesh_file(ofile,mesh_dict): … … 607 619 from Scientific.IO.NetCDF import NetCDFFile 608 620 609 IntType = Int 16621 IntType = Int32 610 622 611 623 # -
inundation/ga/storm_surge/pmesh/load_mesh/test_loadASCII.py
r1026 r1047 229 229 array(loadedDict['vertex_attribute_titles']), 230 230 'test_export_mesh_file failed. Test 8') 231 self.failUnless(array(meshDict['geo_reference']) == 232 array(loadedDict['geo_reference']), 233 'test_export_mesh_file failed. Test 9') 231 234 232 235 os.remove(fileName)
Note: See TracChangeset
for help on using the changeset viewer.