source: trunk/anuga_core/benchmarks/benchmark_sww2dem.py @ 7813

Last change on this file since 7813 was 7813, checked in by hudson, 14 years ago

Benchmark uses new filename convetions for file conversion.

File size: 742 bytes
RevLine 
[7697]1"""Benchmark for sww2dem
2
3Creates and exports a dem from an sww file.
4"""
5
[7810]6from anuga.file_conversion.sww2dem import sww2dem
[7697]7from create_test_sww import create_test_sww
8import os.path
[7698]9import cProfile
[7708]10import time
[7697]11
12
[7708]13sww_name = 'test.sww'
14
[7698]15def sww2dem_test():
16        # do export to DEM
[7697]17
[7813]18        sww2dem(sww_name,
19                        name_out='sww2dem_out.asc',
[7698]20                        quantity='stage',
[7708]21                        cellsize=0.25,     
[7698]22                        easting_min=0,
23                        easting_max=100,
24                        northing_min=0,
25                        northing_max=100,       
26                        reduction=max, 
[7813]27                        verbose=True)
[7810]28 
[7708]29               
30# use existing file
31if not os.path.isfile(sww_name):
32        create_test_sww(sww_name)
33
[7810]34
[7708]35start_time = time.time()       
[7810]36#cProfile.run('sww2dem_test()')
37sww2dem_test()
[7708]38stop_time = time.time()
[7810]39print ('sww2dem took %.1fs\n\n\n' % (stop_time - start_time))
Note: See TracBrowser for help on using the repository browser.