Changeset 2979 for development
- Timestamp:
- May 25, 2006, 5:30:42 PM (19 years ago)
- Location:
- development/stochastic_study
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
development/stochastic_study/create_mesh.py
r2433 r2979 193 193 194 194 import project 195 m.export_mesh_file(project. mesh_filename)195 m.export_mesh_file(project.working_dir + project.mesh_filename) 196 196 -
development/stochastic_study/create_realisations.py
r2968 r2979 15 15 16 16 bathymetry_filename = project.bathymetry_filename 17 mesh_filename = project. mesh_filename17 mesh_filename = project.working_dir + project.mesh_filename 18 18 19 19 … … 80 80 %block_number 81 81 82 filename = project. basename + '_block%d.pck'\83 %block_number82 filename = project.working_dir + project.basename +\ 83 '_block%d.pck' %block_number 84 84 85 85 block_number += 1 -
development/stochastic_study/extract_timeseries.py
r2970 r2979 62 62 63 63 #Read model output 64 filename = project.basename + '_original.sww' 64 #filename = project.basename + '_original.sww' 65 filename = project.basename + '.sww' 65 66 66 67 f = cache(file_function, filename, -
development/stochastic_study/plot_spread.py
r2975 r2979 24 24 25 25 j = 0 # Count realisations 26 for filename in os.listdir( '.'):26 for filename in os.listdir(project.working_dir): 27 27 if filename.startswith(project.basename) and filename.endswith(gauge): 28 28 if j < data.shape[1]: -
development/stochastic_study/project.py
r2975 r2979 2 2 """ 3 3 4 # Working dir 5 working_dir = '/mnt/store/stochastic/' 6 import os 7 try: 8 os.stat(working_dir) 9 except: 10 working_dir = '.' + os.sep 11 4 12 # Inputs 5 13 boundary_filename = 'input_wave.tms' … … 12 20 13 21 # Gauges (3 timeseries (Ch 5-7-9)) 14 gauges = [[4.521, 1.196], [4.521, 1.696], [4.521, 2.196]] 22 gauges = [[4.521, 1.196], [4.521, 1.696], [4.521, 2.196]] 15 23 gauge_names = ['ch5', 'ch7', 'ch9'] 16 24 … … 19 27 20 28 # Stats (Suresh ?) 21 number_of_realisations = 929 number_of_realisations = 2 22 30 #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 32 std_dev = 0.0006 #Range is 26.035 cm 24 33 mean = 0.0 25 34 blocksize = 100 #How many realisations to fit at a time 26 35 27 36 number_of_bins = 10 28 29 30 31 32 33 34 35 -
development/stochastic_study/run_model.py
r2969 r2979 44 44 print 'Creating domain from', project.mesh_filename 45 45 46 domain = Domain(project. mesh_filename,46 domain = Domain(project.working_dir + project.mesh_filename, 47 47 use_cache=False, 48 48 verbose=True) … … 53 53 54 54 55 domain.set_datadir( '.')55 domain.set_datadir(project.working_dir) 56 56 domain.set_quantities_to_be_stored(['stage', 'xmomentum', 'ymomentum']) 57 57 … … 82 82 83 83 realisation = 0 84 for filename in os.listdir( '.'):84 for filename in os.listdir(project.working_dir): 85 85 if filename.startswith(project.basename) and filename.endswith('.pck'): 86 86 print 'Reading %s' %filename … … 121 121 # Now extract the 3 timeseries (Ch 5-7-9) and store them 122 122 # in three files for this realisation 123 f = file_function( domain.filename + '.sww',123 f = file_function(project.working_dir + domain.filename + '.sww', 124 124 quantities='stage', 125 125 interpolation_points=project.gauges, … … 127 127 128 128 129 simulation_name = domain.filename + '_realisation_%d' %realisation 129 simulation_name = project.working_dir + \ 130 domain.filename + '_realisation_%d' %realisation 130 131 131 132 for k, name in enumerate(project.gauge_names):
Note: See TracChangeset
for help on using the changeset viewer.