Changeset 2979


Ignore:
Timestamp:
May 25, 2006, 5:30:42 PM (18 years ago)
Author:
ole
Message:

Arbitrary working dir

Location:
development/stochastic_study
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • development/stochastic_study/create_mesh.py

    r2433 r2979  
    193193
    194194    import project
    195     m.export_mesh_file(project.mesh_filename)
     195    m.export_mesh_file(project.working_dir + project.mesh_filename)
    196196   
  • development/stochastic_study/create_realisations.py

    r2968 r2979  
    1515
    1616bathymetry_filename = project.bathymetry_filename
    17 mesh_filename = project.mesh_filename
     17mesh_filename = project.working_dir + project.mesh_filename
    1818
    1919
     
    8080              %block_number
    8181
    82         filename = project.basename + '_block%d.pck'\
    83                    %block_number
     82        filename = project.working_dir + project.basename +\
     83                   '_block%d.pck' %block_number
    8484
    8585        block_number += 1   
  • development/stochastic_study/extract_timeseries.py

    r2970 r2979  
    6262
    6363#Read model output
    64 filename = project.basename + '_original.sww'
     64#filename = project.basename + '_original.sww'
     65filename = project.basename + '.sww'
    6566
    6667f = cache(file_function, filename,
  • development/stochastic_study/plot_spread.py

    r2975 r2979  
    2424
    2525j = 0 # Count realisations
    26 for filename in os.listdir('.'):
     26for filename in os.listdir(project.working_dir):
    2727    if filename.startswith(project.basename) and filename.endswith(gauge):
    2828        if j < data.shape[1]:       
  • development/stochastic_study/project.py

    r2975 r2979  
    22"""
    33
     4# Working dir
     5working_dir = '/mnt/store/stochastic/'
     6import os
     7try:
     8    os.stat(working_dir)
     9except:
     10    working_dir = '.' + os.sep
     11   
    412# Inputs
    513boundary_filename = 'input_wave.tms'
     
    1220
    1321# Gauges (3 timeseries (Ch 5-7-9))
    14 gauges = [[4.521, 1.196],  [4.521, 1.696],  [4.521, 2.196]] 
     22gauges = [[4.521, 1.196],  [4.521, 1.696],  [4.521, 2.196]]
    1523gauge_names = ['ch5', 'ch7', 'ch9']
    1624
     
    1927
    2028# Stats (Suresh ?)
    21 number_of_realisations = 9
     29number_of_realisations = 2
    2230#std_dev = 0.0026  #Range is 26.035 cm
    23 std_dev = 0.0013  #Range is 26.035 cm
     31#std_dev = 0.0013  #Range is 26.035 cm
     32std_dev = 0.0006  #Range is 26.035 cm
    2433mean = 0.0
    2534blocksize = 100 #How many realisations to fit at a time
    2635
    2736number_of_bins = 10
    28 
    29 
    30 
    31    
    32 
    33 
    34 
    35 
  • development/stochastic_study/run_model.py

    r2969 r2979  
    4444print 'Creating domain from', project.mesh_filename
    4545
    46 domain = Domain(project.mesh_filename,
     46domain = Domain(project.working_dir + project.mesh_filename,
    4747                use_cache=False,
    4848                verbose=True)               
     
    5353
    5454
    55 domain.set_datadir('.')
     55domain.set_datadir(project.working_dir)
    5656domain.set_quantities_to_be_stored(['stage', 'xmomentum', 'ymomentum'])
    5757
     
    8282
    8383realisation = 0
    84 for filename in os.listdir('.'):
     84for filename in os.listdir(project.working_dir):
    8585    if filename.startswith(project.basename) and filename.endswith('.pck'):
    8686        print 'Reading %s' %filename
     
    121121            # Now extract the 3 timeseries (Ch 5-7-9) and store them
    122122            # in three files for this realisation
    123             f = file_function(domain.filename + '.sww',
     123            f = file_function(project.working_dir + domain.filename + '.sww',
    124124                              quantities='stage',
    125125                              interpolation_points=project.gauges,
     
    127127
    128128
    129             simulation_name = domain.filename + '_realisation_%d' %realisation
     129            simulation_name = project.working_dir + \
     130                              domain.filename + '_realisation_%d' %realisation
    130131
    131132            for k, name in enumerate(project.gauge_names):
Note: See TracChangeset for help on using the changeset viewer.