source: production/karratha_2005/run_karratha.py @ 1786

Last change on this file since 1786 was 1786, checked in by ole, 18 years ago

Got karratha skeleton to work

File size: 1.5 KB
Line 
1"""Convert from Arcview ASCII DEMs via native netcdf dem format
2to native pts netcdf format for use with least_squares fits
3"""
4
5import os
6import time
7
8
9from pyvolution.shallow_water import Domain, Reflective_boundary
10from pyvolution.data_manager import convert_dem_from_ascii2netcdf, dem2pts
11from pyvolution.pmesh2domain import pmesh_to_domain_instance
12from caching import cache
13import project
14
15#Convert ASC 2 DEM 2 PTS using source data and store result in source data
16
17demname = project.demname
18
19
20cache(convert_dem_from_ascii2netcdf, demname, {'verbose': True},
21      dependencies = [demname + '.asc'],
22      verbose = True)
23
24cache(dem2pts, demname, {'verbose': True},
25      dependencies = [demname + '.dem'],     
26      verbose = True)
27
28
29mesh = project.meshname + '.msh'
30domain = cache(pmesh_to_domain_instance, (mesh, Domain),
31               dependencies = [mesh],                     
32               verbose = True)               
33
34
35domain.set_name(project.basename)
36domain.set_datadir(project.outputdir)
37domain.store = True
38
39print "Number of triangles = ", len(domain)
40print 'The extent is ', domain.get_extent()
41
42#IC
43domain.set_quantity('stage', 0)
44domain.set_quantity('elevation',
45                    filename = demname + '.pts',
46                    use_cache = True,
47                    verbose = True)
48
49#BC
50Br = Reflective_boundary(domain)
51domain.set_boundary( {'wall': Br} )
52
53
54#Run
55for t in domain.evolve(yieldstep = 1, finaltime = 1):
56    domain.write_time()
Note: See TracBrowser for help on using the repository browser.