source: anuga_work/production/australia_ph2/plot_comparisons/plot_xmin.py @ 7622

Last change on this file since 7622 was 7622, checked in by griffin, 14 years ago

Added extra plotting scripts for arrival time and velocity comparisons

File size: 1.2 KB
Line 
1"""
2Program to plot the evaluate and plot Harig et al (2008)'s criteria for
3maximum triangle size
4
5
6Creator: Jonathan Griffin
7Created: 7 October 2009
8"""
9import os
10import sys
11from os.path import join
12
13import matplotlib
14matplotlib.use('Agg')
15import pylab
16from pylab import *
17import numpy
18
19path = r'/nas/gemd/georisk_models/inundation/data/australia_ph2/documents/250m comparisons'
20
21
22figure_name = 'xmin.png'   
23
24figure_folder = join(path, 'figures')
25figure_path = join(figure_folder, figure_name)
26
27# Constants
28ct = 20.0
29ch = 30.0
30
31# Water depths to eveluate function at
32h = [100,90,80,70,60,50,40,30,20,10,0]
33slope = [0.001,0.005,0.01,0.05, 0.1, 0.5]
34slope_dict = {0.001: 'r',0.005:'b',0.01:'r',0.05:'g', 0.1:'b', 0.5:'y'}
35
36   
37
38# Gravity
39g = 9.81
40
41#pylab.semilogy()
42pylab.xlabel('Depth (m)')
43pylab.ylabel('xmin (m)')
44for 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
59pylab.savefig(figure_path)
Note: See TracBrowser for help on using the repository browser.