#!/usr/bin/env python # coding: utf-8 # In[11]: # imports get_ipython().run_line_magic('matplotlib', 'inline') import matplotlib.pyplot as plt import numpy as np from __future__ import division # In[12]: M2_amp_obs_SoG = 0.902 # In[13]: pha_diff = {'ene': 86, 'wHoll': 87, 'llap': 87, 'wslip': 87, 'TS4': 86, 'smooth': 58, 'downto2': 82, 'downto5': 83, 'weaklog': 89, 'd10': 85, 'u20': 86, 'topog1': 80, 'base': 91, 'stronglog': 101, 'secondlog': 96, 'sticky': 90, 'deep' : 55, 'deep_fric': 83, 'GmO': 75, 'GmO_TS5': 81, 'GmO_TS6': 81, 'GmO_TS7': 77, 'GmO_TS8': 74, 'GmO_TS9': 75, 'GmO_TS10': 76, 'a1': 77, 'a2': 76, 'M17_a1': 94, 'M17_a2': 92, 'M17_a3': 88, 'M17_a4': 81, 'M17_a5': 77, 'M17_a6': 75, 'M17_a7': 73, 'M17_a9': 68, 'M17_a10': 73, 'M17_a11': 81, 'M17_a12': 75, 'M17_a13': 79, 'M17_a14': 77} amp = {'ene': 0.25, 'wHoll': 0.255, 'llap': 0.29, 'wslip': 0.27, 'TS4': 0.26, 'smooth': 0.18, 'downto2': 0.24, 'downto5': 0.24, 'weaklog': 0.3, 'd10': 0.255, 'u20': 0.26, 'topog1': 0.28, 'base': 0.33, 'stronglog': 0.49, 'secondlog': 0.39, 'sticky': 0.40, 'deep': 0.19, 'deep_fric': 0.34, 'GmO': 0.36, 'GmO_TS5': 0.40, 'GmO_TS6': 0.40, 'GmO_TS7': 0.37, 'GmO_TS8': 0.34, 'GmO_TS9': 0.35, 'GmO_TS10': 0.36, 'a1': 0.37, 'a2': 0.36, 'M17_a1': 0.47, 'M17_a2': 0.45, 'M17_a3': 0.41, 'M17_a4': 0.36, 'M17_a5': 0.34, 'M17_a6': 0.31, 'M17_a7': 0.31, 'M17_a9': 0.30, 'M17_a10': 0.32, 'M17_a11': 0.37, 'M17_a12': 0.33, 'M17_a13': 0.36, 'M17_a14': 0.35} # In[14]: bathymetry2 = ('llap', 'downto5', 'downto2', 'stronglog', 'weaklog', 'wslip', 'secondlog', 'base') # In[15]: count = 0 fig, ax = plt.subplots(1,1,figsize=(18, 4.5)) for key in pha_diff: count += 1 if count <= 7: symbol = 'o' elif count <=14: symbol = '^' elif count <=21: symbol = '>' else: symbol = '<' ax.plot(pha_diff[key], amp[key], symbol, label=key) ax.plot(75,0.37,'gs', label='Obs', markersize=10) ax.plot(pha_diff['a2'], amp['a2'], 'mo', markersize=8, label='Proper Bottom') ax.plot(92,0.33,'*',label='corr15') ax.set_xlim((33,105)) ax.legend(loc='upper left') ax.set_ylabel('Amplitude at Victoria (m)') ax.set_xlabel('Phase difference Victoria to Pt Atkinson (deg)') # In[16]: print (pha_diff['GmO'] + pha_diff['downto2'] - pha_diff['TS4'], 75, pha_diff['GmO_TS6'] ) print (amp['GmO'] + amp['downto2'] - amp['TS4'], 0.37, amp['GmO_TS6'] ) # In[17]: fig, ax = plt.subplots(1,1,figsize=(9,9)) for key in bathymetry2: ax.plot(pha_diff[key], amp[key]/M2_amp_obs_SoG, symbol, label=key, markersize=10) ax.plot(75,0.37/M2_amp_obs_SoG,'s',label='Obs', markersize=20) ax.plot(92,0.33/M2_amp_obs_SoG,'o',label='Nowcast v1.0', markersize=15) ax.set_xlim((55,105)) ax.tick_params(axis='x', labelsize=16) ax.tick_params(axis='y', labelsize=16) ax.legend(loc='upper left', fontsize=16) ax.set_ylabel('Amplitude Ratio at Victoria to Pt Atkinson', fontsize=16) ax.set_xlabel('Phase difference Victoria to Pt Atkinson (deg)', fontsize=16) # In[18]: fig, ax = plt.subplots(1,1,figsize=(9,9)) for key in bathymetry2: ax.plot(pha_diff[key], amp[key]/M2_amp_obs_SoG, '>b', markersize=10) for key in ('smooth', 'sticky'): ax.plot(pha_diff[key], amp[key]/M2_amp_obs_SoG, '>m', markersize=10) for key in ('deep', 'deep_fric' ): ax.plot(pha_diff[key], amp[key]/M2_amp_obs_SoG, '>y', markersize=10) ax.plot(pha_diff['GmO'], amp["GmO"]/M2_amp_obs_SoG, 'ro', markersize=15, label = 'New Bathymetry') ax.plot(pha_diff['a1'], amp['a1']/M2_amp_obs_SoG, 'm*', markersize=10, label='Proper Bottom') ax.plot(pha_diff['a2'], amp['a2']/M2_amp_obs_SoG, 'mo', markersize=10, label='Proper Bottom 2') ax.plot(75,0.37/M2_amp_obs_SoG,'sg',label='Obs', markersize=20) #ax.plot(92,0.33/M2_amp_obs_SoG,'or',label='Nowcast v1.0', markersize=15) ax.set_xlim((53,105)) ax.tick_params(axis='x', labelsize=16) ax.tick_params(axis='y', labelsize=16) ax.legend(loc='upper left', fontsize=16) ax.set_ylabel('Amplitude Ratio at Victoria to Pt Atkinson', fontsize=16) ax.set_xlabel('Phase difference Victoria to Pt Atkinson (deg)', fontsize=16) # In[19]: fig, ax = plt.subplots(1,1,figsize=(9,9)) for key in ['GmO', 'GmO_TS5', 'GmO_TS6', 'GmO_TS7', 'GmO_TS8', 'GmO_TS9', 'GmO_TS10']: ax.plot(pha_diff[key], amp[key]/M2_amp_obs_SoG, '>', markersize=10, label=key) ax.plot(75,0.37/M2_amp_obs_SoG,'sg',label='Obs', markersize=20) ax.plot(pha_diff['a1'], amp['a1']/M2_amp_obs_SoG, 'm*', markersize=10, label='Proper Bottom') ax.plot(pha_diff['a2'], amp['a2']/M2_amp_obs_SoG, 'mo', markersize=10, label='Proper Bottom 2') ax.set_xlim((74,82)) ax.tick_params(axis='x', labelsize=16) ax.tick_params(axis='y', labelsize=16) ax.legend(loc='lower right', fontsize=16) ax.set_ylabel('Amplitude Ratio at Victoria to Pt Atkinson', fontsize=16) ax.set_xlabel('Phase difference Victoria to Pt Atkinson (deg)', fontsize=16) # In[20]: 6/40.*52 # In[ ]: