Last change
on this file since 8451 was
7877,
checked in by hudson, 14 years ago
|
Moved all development files into trunk.
|
File size:
715 bytes
|
Line | |
---|
1 | """Benchmark for sww2dem |
---|
2 | |
---|
3 | Creates and exports a dem from an sww file. |
---|
4 | """ |
---|
5 | |
---|
6 | import anuga |
---|
7 | import os.path |
---|
8 | import cProfile |
---|
9 | import time |
---|
10 | |
---|
11 | from create_test_sww import create_test_sww |
---|
12 | |
---|
13 | sww_name = 'test.sww' |
---|
14 | |
---|
15 | def sww2dem_test(): |
---|
16 | # do export to DEM |
---|
17 | |
---|
18 | anuga.sww2dem(sww_name, |
---|
19 | name_out='sww2dem_out.asc', |
---|
20 | quantity='xmomentum', |
---|
21 | cellsize=0.25, |
---|
22 | easting_min=0, |
---|
23 | easting_max=100, |
---|
24 | northing_min=0, |
---|
25 | northing_max=100, |
---|
26 | reduction=max, |
---|
27 | verbose=True) |
---|
28 | |
---|
29 | |
---|
30 | # use existing file |
---|
31 | if not os.path.isfile(sww_name): |
---|
32 | create_test_sww(sww_name) |
---|
33 | |
---|
34 | |
---|
35 | start_time = time.time() |
---|
36 | #cProfile.run('sww2dem_test()') |
---|
37 | sww2dem_test() |
---|
38 | stop_time = time.time() |
---|
39 | print ('sww2dem took %.1fs\n\n\n' % (stop_time - start_time)) |
---|
Note: See
TracBrowser
for help on using the repository browser.