source: anuga_work/production/tonga/convertTopoFormat.py @ 7818

Last change on this file since 7818 was 5194, checked in by herve, 16 years ago

run scripts for tonga

File size: 507 bytes
Line 
1import os
2import sys
3
4os.chdir('Y:/data/sw_pacific/tonga/anuga/topographies')
5
6polyline_file=open('topography_tongatapu.txt','r')
7lines=polyline_file.readlines()
8polyline_file.close()
9
10filetoedit= open('topography_tongatapu1.txt','w')
11q= 'easting,northing,elevation\n'
12filetoedit.write(q)
13for line in lines [0:]:
14    field = line.split('\t')
15    x= float(field[0])
16    y=float(field[1])
17    z=float(field[2])
18    s= '%f,%f,%f\n' %(x,y,z)
19    filetoedit.write(s)
20   
21filetoedit.close()
Note: See TracBrowser for help on using the repository browser.