Changeset 2972 for development
- Timestamp:
- May 25, 2006, 3:42:31 PM (19 years ago)
- Location:
- development/stochastic_study
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
development/stochastic_study/plot_spread.py
r2967 r2972 2 2 """ 3 3 4 # Standard modules 4 5 import sys, os 6 7 # Related major packages 8 from Numeric import zeros, Float, allclose, arange 5 9 from caching import cache 10 11 # Application specific imports 12 from utilities.numerical_tools import histogram, create_bins 6 13 import project 7 14 15 # Initialise 8 16 gauge_name = project.gauge_names[0] 9 from Numeric import zeros, Float, allclose10 11 12 17 number_of_realisations = project.number_of_realisations 13 18 14 19 time = zeros(project.number_of_timesteps, Float) 15 20 data = zeros((project.number_of_timesteps, number_of_realisations), Float) 21 22 23 # Read in all realisations-timeseries 16 24 17 25 j = 0 # Count realisations … … 37 45 38 46 ion() 39 hold(True)47 #hold(True) 40 48 hold(False) 41 49 42 #for i in range(project.number_of_timesteps): 43 # print i, data[i,:] 44 # plot(data[i,:], 'k.') 45 # raw_input('Next') 46 50 # Simple plot of timeseries for different realisations 47 51 for j in range(number_of_realisations): 48 print j, data[:,j]52 #print j, data[:,j] 49 53 plot(data[:,j], 'k-') 50 54 51 55 raw_input('Next') 56 xlabel('time(s)') 57 ylabel('stage (m)') 58 title('Realisation %d of %d' %(j, number_of_realisations)) 59 60 61 62 # Plot histogram of stage values for each timestep 63 for i in range(project.number_of_timesteps): 64 # Plot histogram 65 66 w = data[i,:] 67 68 bins = create_bins(w, project.number_of_bins) 69 print 'bins', bins 70 hist = histogram(w, bins) 71 print 'hist', hist 72 73 #plot(w, 'k.') 74 plot(hist, 'k.') 75 xlabel('stage (m)') 76 ylabel('count') 77 title('Timestep %d of %d (t=%.2f)'\ 78 %(i, project.number_of_timesteps, time[i])) 79 raw_input('Next') 80 81 52 82 #title('Gauge %s' %name) 53 83 #xlabel('time(s)') … … 55 85 #legend(('Observed', 'Modelled'), shadow=True, loc='upper left') 56 86 #savefig(name, dpi = 300) 87 88 89 90 57 91 58 92 -
development/stochastic_study/project.py
r2966 r2972 19 19 20 20 # Stats (Suresh ?) 21 number_of_realisations = 421 number_of_realisations = 1 22 22 #std_dev = 0.0026 #Range is 26.035 cm 23 23 std_dev = 0.0013 #Range is 26.035 cm … … 25 25 blocksize = 100 #How many realisations to fit at a time 26 26 27 27 number_of_bins = 10 28 28 29 29
Note: See TracChangeset
for help on using the changeset viewer.