source: anuga_work/production/west_tas_2008/convert2eastnorth.py @ 7855

Last change on this file since 7855 was 5245, checked in by sexton, 17 years ago

(1) update of production processes document (2) test for generating points for URS output (3) update of graduate proposal

File size: 1.4 KB
Line 
1"""
2Convert DB's data from lat/long to easting/northing
3
4"""
5
6def alter_file(filename,filenameout):
7
8    from anuga.coordinate_transforms.redfearn import redfearn
9   
10    fid = open(filename)
11    lines = fid.readlines()
12    fid.close()
13   
14    fid_out = open(filenameout, 'w')
15    s = '%s,%s\n' %('easting','northing')
16    fid_out.write(s)
17    for line in lines[1:]:
18       fields = line.split(',')
19       x = float(fields[1])
20       y = float(fields[0])
21       zone, easting, northing = redfearn(x,y)
22       s = '%f,%f\n' %(easting,northing)
23       fid_out.write(s)
24
25    fid_out.close() 
26
27    return
28
29import project_smf
30
31#filename = project_smf.polygondir + 'domain.txt'
32#filename = project_smf.polygondir + 'local.txt'
33#filename = project_smf.polygondir + 'region.txt'
34#filename = project_smf.datadir + 'Sorell_Basin_150m_DD_Interp.txt'
35#filename = project_smf.datadir + 'S_Tasman_Rise_150m_DD_Interp.txt'
36filename = project_smf.polygondir + 'origin.txt'
37#filename_out = project_smf.polygondir + 'domain.csv'
38#filename_out = project_smf.polygondir + 'local.csv'
39#filename_out = project_smf.polygondir + 'region.csv'
40#filename_out = project_smf.datadir + 'Sorell_Basin_150m_EN_Interp.txt'
41#filename_out = project_smf.datadir + 'S_Tasman_Rise_150m_EN_Interp.txt'
42filename_out = project_smf.polygondir + 'origin_EN.csv'
43alter_file(filename,filename_out)
Note: See TracBrowser for help on using the repository browser.