Ignore:
Timestamp:
Aug 27, 2008, 10:04:24 AM (16 years ago)
Author:
duncan
Message:

Get the output directory going

File:
1 edited

Legend:

Unmodified
Added
Removed
  • anuga_validation/Hinwood_2008/calc_rmsd.py

    r5693 r5695  
    11"""
    2 
    3 All err results are going into the same dir, and it can't really be changed.
     2Functions used to calculate the root mean square deviation.
     3
     4Duncan Gray, GA - 2007
     5
    46"""
    57
     
    1315from csv import writer
    1416from time import localtime, strftime
     17from os.path import join
    1518
    1619# Related major packages
    1720from Numeric import zeros, Float, where, greater, less, compress, sqrt, sum
    18 
    1921from anuga.shallow_water.data_manager import csv2dict
    2022from anuga.utilities.numerical_tools import ensure_numeric, err, norm
    2123from anuga.utilities.interp import interp
    2224
     25# Scenario specific imports
     26import project
     27
    2328def 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    """
    2437   
    2538    SMALL_MIN = -1e10  # Not that small, but small enough
     
    4861        id = run_data['scenario_id']
    4962        outputdir_name = id + outputdir_tag
    50         file_sim = outputdir_name + '_' +  quantity + ".csv"
     63        file_sim = join(project.output_dir,outputdir_name + '_' +  \
     64                        quantity + ".csv")
    5165        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")
    5368       
    5469
     
    6075        time_sim = ensure_numeric(time_sim)
    6176        time_exp = ensure_numeric(time_exp)
    62        
    6377        condition = get_max_min_condition_array(run_data['wave_times'][0],
    6478                                                run_data['wave_times'][1],
     
    145159        id = scenario['scenario_id']
    146160        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")
    148163        file_errs.append(file_err)
    149164    return file_errs
     
    196211    #scenarios = [scenarios[0]] # !!!!!!!!!!!!!!!!!!!!!!
    197212
    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"
    199214    calc_norms = True
    200215    #calc_norms = False
Note: See TracChangeset for help on using the changeset viewer.