Changeset 5695 for anuga_validation/Hinwood_2008/calc_rmsd.py
- Timestamp:
- Aug 27, 2008, 10:04:24 AM (16 years ago)
- File:
-
- 1 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
Note: See TracChangeset
for help on using the changeset viewer.