In [1]:
%pylab inline

In [2]:
import sys, os
top_dir = '/Users/rjl/student_workshop2'
codes_dir = os.path.join(top_dir, 'Codes')
sys.path.append(codes_dir)

In [3]:
CCmap = imread('/Users/rjl/student_workshop2/maps/CCmap-small.png')
extent = (235.79781, 235.82087, 41.739671,41.762726)   #small region

In [6]:
def plot_CCmap():
    fig = figure(figsize=(6,6))
    ax = axes()
    imshow(CCmap,extent=extent)
    CClatitude = 41.75  # to rescale longitude
    ax.set_aspect(1. / cos(pi*CClatitude/180.)) 
    ax.ticklabel_format(format='plain',useOffset=False)
plot_CCmap()

In [7]:
fixed_grid_file = os.path.join(top_dir, 'Datafiles/fixedgrid_xyB_small.npy')
d=load(fixed_grid_file)
x=d[:,0]
y=d[:,1]
B=d[:,2]

In [15]:
topo = reshape(B, (250,250), order='F')
X = reshape(x, (250,250), order='F')
Y = reshape(y, (250,250), order='F')
contour(X,Y,topo,[0.], colors='r')

In [11]:
plot_CCmap()
contour(X,Y,topo,[0.], colors='r')
clines = linspace(2,20,10)
contour(X,Y,topo,clines, colors='w')

In [13]:
realizations_dir = os.path.join(top_dir, 'Realizations')
event = 'AASZe01r01'
event_dir = os.path.join(realizations_dir, event)
hmax_file = os.path.join(event_dir, 'tide+077', 'h_eta_small.npy')
hmax = load(hmax_file)
Hmax = hmax.reshape((250,250),order='F')

In [14]:
plot_CCmap()
clines = [0.01, 0.5, 1., 1.5, 2., 2.5, 3]
contourf(X,Y,Hmax,clines,alpha = 0.6)
colorbar()

In [27]:
fig = figure(figsize=(6,6))
ax = axes()

H_clines = [0.01, 0.5, 1., 1.5, 2., 2.5, 3]
contourf(X,Y,Hmax,H_clines)
colorbar()

contour(X,Y,topo,[0.], colors='r')
topo_clines = linspace(2,20,10)
contour(X,Y,topo,topo_clines, colors='k')

CClatitude = 41.75  # to rescale longitude
ax.set_aspect(1. / cos(pi*CClatitude/180.)) 
ax.ticklabel_format(format='plain',useOffset=False)

In [ ]: