Changeset 5695
- Timestamp:
- Aug 27, 2008, 10:04:24 AM (17 years ago)
- Location:
- anuga_validation/Hinwood_2008
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
anuga_validation/Hinwood_2008/calc_rmsd.py
r5693 r5695 1 1 """ 2 3 All err results are going into the same dir, and it can't really be changed. 2 Functions used to calculate the root mean square deviation. 3 4 Duncan Gray, GA - 2007 5 4 6 """ 5 7 … … 13 15 from csv import writer 14 16 from time import localtime, strftime 17 from os.path import join 15 18 16 19 # Related major packages 17 20 from Numeric import zeros, Float, where, greater, less, compress, sqrt, sum 18 19 21 from anuga.shallow_water.data_manager import csv2dict 20 22 from anuga.utilities.numerical_tools import ensure_numeric, err, norm 21 23 from anuga.utilities.interp import interp 22 24 25 # Scenario specific imports 26 import project 27 23 28 def get_max_min_condition_array(min, max, vector): 29 """ 30 Given a vector of values, and minimum and maximum values, return a 31 vector of 0/1's that can be used to cut arrays so only the times 32 in the min max range are used. 33 34 precondition: The vector values are ascending. 35 36 """ 24 37 25 38 SMALL_MIN = -1e10 # Not that small, but small enough … … 48 61 id = run_data['scenario_id'] 49 62 outputdir_name = id + outputdir_tag 50 file_sim = outputdir_name + '_' + quantity + ".csv" 63 file_sim = join(project.output_dir,outputdir_name + '_' + \ 64 quantity + ".csv") 51 65 file_exp = id + '_exp_' + quantity + '.csv' 52 file_err = outputdir_name + "_" + quantity + "_err.csv" 66 file_err = join(project.output_dir,outputdir_name + "_" + \ 67 quantity + "_err.csv") 53 68 54 69 … … 60 75 time_sim = ensure_numeric(time_sim) 61 76 time_exp = ensure_numeric(time_exp) 62 63 77 condition = get_max_min_condition_array(run_data['wave_times'][0], 64 78 run_data['wave_times'][1], … … 145 159 id = scenario['scenario_id'] 146 160 outputdir_name = id + outputdir_tag 147 file_err = outputdir_name + "_" + quantity + "_err.csv" 161 file_err = join(project.output_dir,outputdir_name + "_" + \ 162 quantity + "_err.csv") 148 163 file_errs.append(file_err) 149 164 return file_errs … … 196 211 #scenarios = [scenarios[0]] # !!!!!!!!!!!!!!!!!!!!!! 197 212 198 outputdir_tag = "_nolmts_wdth_0.1_z_0.0_ys_0. 01_mta_0.01"213 outputdir_tag = "_nolmts_wdth_0.1_z_0.0_ys_0.5_mta_0.01_A" 199 214 calc_norms = True 200 215 #calc_norms = False -
anuga_validation/Hinwood_2008/project.py
r5694 r5695 1 1 """Common filenames and locations. 2 2 """ 3 4 from os import access, F_OK, mkdir 5 6 output_dir = 'output' 7 8 if not access(output_dir,F_OK): 9 mkdir (output_dir) -
anuga_validation/Hinwood_2008/run_dam.py
r5691 r5695 13 13 # Standard modules 14 14 import time 15 15 from os.path import join 16 16 17 17 # Related major packages … … 22 22 23 23 # Scenario specific imports 24 import project 24 25 import create_mesh 25 26 from prepare_time_boundary import csv2tms … … 64 65 csv2tms(boundary_file_path, metadata_dic['xleft'][1]) 65 66 66 mesh_filename = basename + '.msh'67 mesh_filename = join(project.output_dir,basename + '.msh') 67 68 68 69 #------------------------------------------------------------------------- … … 83 84 84 85 domain.set_name(basename) 85 domain.set_datadir( '.')86 domain.set_datadir(project.output_dir) 86 87 domain.set_quantities_to_be_stored(['stage', 'xmomentum', 'ymomentum']) 87 88 domain.set_minimum_storable_height(0.0001) … … 133 134 points.append([gauge_x, 0.0]) 134 135 135 id = ".csv" 136 interpolate_sww2csv(basename +".sww", 136 interpolate_sww2csv(join(project.output_dir,basename+".sww"), 137 137 points, 138 basename + "_depth" + id, 139 basename + "_velocity_x" + id, 140 basename + "_velocity_y" + id, 141 basename + "_stage" + id) 138 join(project.output_dir,basename + "_depth.csv"), 139 join(project.output_dir,basename + \ 140 "_velocit_x.csv"), 141 join(project.output_dir, basename + \ 142 "_velocity_y.csv"), 143 join(project.output_dir,basename + "_stage.csv")) 142 144 143 145 … … 202 204 friction=0.0 203 205 isTest=True 204 #isTest=False206 isTest=False 205 207 206 208 for run_data in scenarios:
Note: See TracChangeset
for help on using the changeset viewer.