Last change
on this file since 7622 was
7622,
checked in by griffin, 13 years ago
|
Added extra plotting scripts for arrival time and velocity comparisons
|
File size:
1.2 KB
|
Line | |
---|
1 | """ |
---|
2 | Program to plot the evaluate and plot Harig et al (2008)'s criteria for |
---|
3 | maximum triangle size |
---|
4 | |
---|
5 | |
---|
6 | Creator: Jonathan Griffin |
---|
7 | Created: 7 October 2009 |
---|
8 | """ |
---|
9 | import os |
---|
10 | import sys |
---|
11 | from os.path import join |
---|
12 | |
---|
13 | import matplotlib |
---|
14 | matplotlib.use('Agg') |
---|
15 | import pylab |
---|
16 | from pylab import * |
---|
17 | import numpy |
---|
18 | |
---|
19 | path = r'/nas/gemd/georisk_models/inundation/data/australia_ph2/documents/250m comparisons' |
---|
20 | |
---|
21 | |
---|
22 | figure_name = 'xmin.png' |
---|
23 | |
---|
24 | figure_folder = join(path, 'figures') |
---|
25 | figure_path = join(figure_folder, figure_name) |
---|
26 | |
---|
27 | # Constants |
---|
28 | ct = 20.0 |
---|
29 | ch = 30.0 |
---|
30 | |
---|
31 | # Water depths to eveluate function at |
---|
32 | h = [100,90,80,70,60,50,40,30,20,10,0] |
---|
33 | slope = [0.001,0.005,0.01,0.05, 0.1, 0.5] |
---|
34 | slope_dict = {0.001: 'r',0.005:'b',0.01:'r',0.05:'g', 0.1:'b', 0.5:'y'} |
---|
35 | |
---|
36 | |
---|
37 | |
---|
38 | # Gravity |
---|
39 | g = 9.81 |
---|
40 | |
---|
41 | #pylab.semilogy() |
---|
42 | pylab.xlabel('Depth (m)') |
---|
43 | pylab.ylabel('xmin (m)') |
---|
44 | for sl in slope: |
---|
45 | xmin = [] |
---|
46 | for depth in h: |
---|
47 | a = ct*numpy.sqrt(g*depth) |
---|
48 | print 'a', a |
---|
49 | b = ch*(1.0/sl) |
---|
50 | print 'b', b |
---|
51 | minval = numpy.min([a,b]) |
---|
52 | print 'minval', minval |
---|
53 | xmin.append(minval) |
---|
54 | print 'xmin', xmin |
---|
55 | pylab.plot(h, xmin, color = slope_dict[sl]) |
---|
56 | print xmin |
---|
57 | |
---|
58 | |
---|
59 | pylab.savefig(figure_path) |
---|
Note: See
TracBrowser
for help on using the repository browser.