Changeset 5695


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

Get the output directory going

Location:
anuga_validation/Hinwood_2008
Files:
3 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
  • anuga_validation/Hinwood_2008/project.py

    r5694 r5695  
    11"""Common filenames and locations.
    22"""
     3
     4from os import access, F_OK, mkdir
     5
     6output_dir = 'output'
     7
     8if not access(output_dir,F_OK):
     9            mkdir (output_dir)
  • anuga_validation/Hinwood_2008/run_dam.py

    r5691 r5695  
    1313# Standard modules
    1414import time
    15 
     15from os.path import join
    1616
    1717# Related major packages
     
    2222
    2323# Scenario specific imports
     24import project
    2425import create_mesh
    2526from prepare_time_boundary import csv2tms
     
    6465    csv2tms(boundary_file_path, metadata_dic['xleft'][1])
    6566   
    66     mesh_filename =  basename + '.msh'
     67    mesh_filename =  join(project.output_dir,basename + '.msh')
    6768
    6869    #-------------------------------------------------------------------------
     
    8384   
    8485    domain.set_name(basename)
    85     domain.set_datadir('.')
     86    domain.set_datadir(project.output_dir)
    8687    domain.set_quantities_to_be_stored(['stage', 'xmomentum', 'ymomentum'])
    8788    domain.set_minimum_storable_height(0.0001)
     
    133134            points.append([gauge_x, 0.0])
    134135
    135         id =  ".csv"
    136         interpolate_sww2csv(basename +".sww",
     136        interpolate_sww2csv(join(project.output_dir,basename+".sww"),
    137137                            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"))
    142144 
    143145
     
    202204    friction=0.0
    203205    isTest=True
    204     #isTest=False
     206    isTest=False
    205207   
    206208    for run_data in scenarios:
Note: See TracChangeset for help on using the changeset viewer.