source: anuga_work/production/dampier_2006/check_data.py @ 6498

Last change on this file since 6498 was 4357, checked in by nick, 18 years ago

update to dampier

File size: 1.7 KB
Line 
1
2
3from os import sep, getcwd, access, F_OK, mkdir, getenv
4from anuga.abstract_2d_finite_volumes.util import get_data_from_file
5import os
6from Numeric import zeros, array, allclose
7
8#makes the csv files from the evolved model
9
10home = getenv('INUNDATIONHOME') #Sandpit's parent dir   
11#user = get_user_name()
12data = 'data'
13state = 'western_australia'
14scenario_name = 'dampier'
15scenario = 'dampier_tsunami_scenario_2006'
16#scenario = 'test_dampier'
17an = 'anuga'
18bo = 'boundaries'
19
20#run_time = '20070305_055256_run'
21#run_time = '20070305_134855_run'
22run_time = '20070321_164505_run'
23
24topo = 'topographies'
25out = 'outputs'
26urs = 'urs'
27gridded = '1_10000'
28
29gauge_boundary_filename = 'gauges_time_series_first.csv'
30gauge_evolved_filename = 'gauges_time_series_first.csv'
31
32boundary_dir_filename = os.path.join(home,data,state,scenario,an,bo,gauge_boundary_filename)
33
34evolved_dir_filename= os.path.join(home,data,state,scenario,an,out,run_time,gauge_evolved_filename)
35
36
37print'evolved_dir_filename',evolved_dir_filename
38e_time, e_stage, e_momentum, e_speed, e_elevation = get_data_from_file(evolved_dir_filename)
39
40print'boundary_dir_filename',boundary_dir_filename
41b_time, b_stage, b_momentum, b_speed, b_elevation = get_data_from_file(boundary_dir_filename)
42
43 
44# compares the 2 models
45j=0
46b_sample = []
47for i in range(len(b_time)):
48    if j<(len(e_time)) and b_time[i] == e_time[j]:
49        b_sample.append(float(b_stage[i]))
50        print 'time e equal b:', b_time[i], b_stage[i],i, j, b_sample[j], e_stage[j],(len(e_time)-1)
51        j = j +1
52
53
54assert allclose (b_sample, e_stage, 2, 0.1) 
55print "test successful" 
56
57
58
59
60                             
Note: See TracBrowser for help on using the repository browser.