def plt_gr(fign):

	t = psi.time<=200

	T = psi.time[t].copy()	

	# Fitting the growth curve
	popt, pcov = curve_fit(exponential, T, crest_growth.psi, p0=(1, 1e-6, 1))
	curve = exponential(T, *popt)


	fig = plt.figure(num=fign,figsize=(8,5),facecolor='w')
	ax = plt.gca()


	ax.plot(T,crest_growth.psi/1000,'bo',mfc='b',markersize=10,label=ur'Crest $\psi$')
	ax.plot(T,curve/1000,'k--',lw=4.5,label=ur'Exponential Fit')

	ax.set_xlim(10.,200)
	ax.set_xticks(range(10,200,15))	
	ax.tick_params(labelsize=22)
	rstyle(ax)

	ax.set_ylabel(ur"$\psi(y=900) \times 10^{3}$ (m$^{2}$ s$^{-1}$)",fontsize=25,fontweight='demibold')
	ax.set_xlabel(ur'Time (days)',fontsize=30,fontweight='demibold')
	ax.set_title(ur'Growth Rate $\sim$ %1.2f $\times 10^{-2}$ day$^{-1}$'%(popt[1]*100.),fontsize=25,fontweight='demibold')

	ax.legend(numpoints=1,loc=0,prop={'size':25},frameon=False)

	plt.draw()
	plt.show(block=False)

	return fig 
def plt_energy(fign):

	fig = plt.figure(num=fign,figsize=(8,5),facecolor='w')
	ax = plt.gca()


	ax.plot(energy.time,energy.potential,'k',lw=3.5,label='EPE')
	ax.plot(energy.time,energy.kinetic_layer1,'r',lw=3.5,label='Layer 1 - EKE')
	ax.plot(energy.time,energy.kinetic_layer2,'b',lw=3.5,label='Layer 2 - EKE')


	ax.set_ylim(0,20)
	ax.set_xlim(0,1210)
	ax.set_yticks(np.arange(0,22.5,2.5))
	ax.tick_params(labelsize=22)
	rstyle(ax)

	ax.set_ylabel('Nondimensionalized energy',fontsize=25,fontweight='demibold')
	ax.set_xlabel(ur'Time (days)',fontsize=30,fontweight='demibold')

	ax.legend(numpoints=1,loc=0,prop={'size':18},frameon=False)

	# plt.draw()
	# plt.show(block=False)

	return fig 
def plt_annual_WBCt(fign):


	fig = plt.figure(num=fign,figsize=(8,5),facecolor='w')
	ax = plt.gca()


	argo = np.ones(soest_gs.latitude.shape[0])*np.nan
	wind = np.ones(scow_gs.latitude.shape[0])*np.nan


	d = py.find(soest_gs.depth == 1200)[0]
	for i in xrange(argo.shape[0]):
		gs = soestgs_annual_Ipsi[d,i,:]
		good  = py.find(~np.isnan(gs))

		if len(good) > 0:
			argo[i] = gs[good[0]]

		del gs, good


	for i in xrange(wind.shape[0]):
		gs = scowgs_annual_psi[i,:]
		good  = py.find(~np.isnan(gs))

		if len(good) > 0:		
			wind[i] = gs[good[0]]

		del gs, good

	ax.plot(soest_gs.latitude,argo,'b',lw=3.5,label='ARGO')
	ax.plot(scow_gs.latitude,wind,'r',lw=3.5,label='Sverdrup - Ekman')

	ax.legend(numpoints=1,loc=0,prop={'size':20},frameon=False)
	ax.plot([-60,0],[0,0],'k--',lw=3.5)

	ax.set_ylim(-40,40)
	ax.set_xlim(-5,-50)

	ax.set_yticks(range(-40,50,10))
	ax.set_xticks(range(-50,0,5))
	ax.tick_params(labelsize=18)
	rstyle(ax)

	labels = [ur'5$^{\circ}$S',ur'10$^{\circ}$S',ur'15$^{\circ}$S',ur'20$^{\circ}$S',
	ur'25$^{\circ}$S',ur'30$^{\circ}$S',ur'35$^{\circ}$S',ur'40$^{\circ}$S',ur'45$^{\circ}$S',
	ur'50$^{\circ}$S']

	labels.reverse()

	ax.set_xticklabels(labels)

	ax.set_ylabel('Transport at X$_{w}$ (Sv)',fontsize=30,fontweight='demibold')
	ax.set_xlabel(ur'Latitude',fontsize=30,fontweight='demibold')

	plt.draw()
	plt.show(block=False)

	return fig
Example #4
0
def plt_energy(fign):

    fig = plt.figure(num=fign, figsize=(8, 5), facecolor='w')
    ax = plt.gca()

    ax.plot(energy.time, energy.potential, 'k', lw=3.5, label='EPE')
    ax.plot(energy.time,
            energy.kinetic_layer1,
            'r',
            lw=3.5,
            label='Layer 1 - EKE')
    ax.plot(energy.time,
            energy.kinetic_layer2,
            'b',
            lw=3.5,
            label='Layer 2 - EKE')

    ax.set_ylim(0, 20)
    ax.set_xlim(0, 1210)
    ax.set_yticks(np.arange(0, 22.5, 2.5))
    ax.tick_params(labelsize=22)
    rstyle(ax)

    ax.set_ylabel('Nondimensionalized energy',
                  fontsize=25,
                  fontweight='demibold')
    ax.set_xlabel(ur'Time (days)', fontsize=30, fontweight='demibold')

    ax.legend(numpoints=1, loc=0, prop={'size': 18}, frameon=False)

    # plt.draw()
    # plt.show(block=False)

    return fig
def plt_psi_profile(fign):

    # Line properties
    colors = ['b', 'r', 'g', 'k', 'orange', 'm']
    linestyles = ['solid', 'dashed', 'dashdot', 'dotted', 'dashed', 'solid']
    linewidths = [3, 3.5, 3.5, 3.5, 3.5, 3.5, 3]

    lat = np.arange(-15.625, -45.625, -5)

    fig = plt.figure(num=fign, figsize=(5, 8), facecolor='w')
    ax = plt.gca()

    for i in xrange(lat.shape[0]):
        isoest = np.abs(soest_gs.latitude - lat[i]).argmin()

        psi = soestgs_annual_psi[:, isoest, :]
        j = py.find(~np.isnan(psi[0, :]))[0]
        psi = psi[:, j]

        ax.plot(psi * 100,
                soest_gs.depth,
                color=colors[i],
                linestyle=linestyles[i],
                lw=linewidths[i],
                label=ur'%1.1f$^{\circ}$ S' %
                (np.abs(soest_gs.latitude[isoest])))

        ax.plot([0, 0], [0, 2000], 'k', lw=5, zorder=1)

        del psi

    ax.set_ylim(2000, 0)
    ax.set_xlim(-4, 10)

    ax.set_yticks(range(0, 2200, 200))
    ax.set_xticks(np.arange(-4, 12, 2))
    ax.tick_params(labelsize=22)
    rstyle(ax)

    ax.set_ylabel('Depth (m)', fontsize=30, fontweight='demibold')
    ax.set_xlabel(
        ur'ARGO-derived $\bar{\psi}_{geostrophic} \times 10^{4}$ (m$^{2}$ s$^{-1}$)',
        fontsize=18,
        fontweight='demibold')

    ax.legend(numpoints=1, loc=0, prop={'size': 18}, frameon=False)

    # plt.draw()
    # plt.show(block=False)

    return fig
def plt_psi_profile(fign):

	# Line properties
	colors = ['b','r','g','k','orange','m']
	linestyles = ['solid','dashed','dashdot',
	'dotted','dashed','solid']
	linewidths = [3,3.5,3.5,3.5,3.5,3.5,3]

	lat = np.arange(-15.625,-45.625,-5)


	fig = plt.figure(num=fign,figsize=(5,8),facecolor='w')
	ax = plt.gca()


	for i in xrange(lat.shape[0]):
		isoest = np.abs(soest_gs.latitude - lat[i]).argmin()

		psi = soestgs_annual_psi[:,isoest,:]
		j = py.find(~np.isnan(psi[0,:]))[0]
		psi = psi[:,j]

		ax.plot(psi*100,soest_gs.depth,color=colors[i],linestyle=linestyles[i],
			lw = linewidths[i],label=ur'%1.1f$^{\circ}$ S'%(np.abs(soest_gs.latitude[isoest])))

		ax.plot([0,0],[0,2000],'k',lw=5,zorder=1)

		del psi


	ax.set_ylim(2000,0)
	ax.set_xlim(-4,10)

	ax.set_yticks(range(0,2200,200))
	ax.set_xticks(np.arange(-4,12,2))
	ax.tick_params(labelsize=22)
	rstyle(ax)

	ax.set_ylabel('Depth (m)',fontsize=30,fontweight='demibold')
	ax.set_xlabel(ur'ARGO-derived $\bar{\psi}_{geostrophic} \times 10^{4}$ (m$^{2}$ s$^{-1}$)',fontsize=18,fontweight='demibold')

	ax.legend(numpoints=1,loc=0,prop={'size':18},frameon=False)

	# plt.draw()
	# plt.show(block=False)

	return fig 
Example #7
0
def plt_gr(fign):

    t = psi.time <= 200

    T = psi.time[t].copy()

    # Fitting the growth curve
    popt, pcov = curve_fit(exponential, T, crest_growth.psi, p0=(1, 1e-6, 1))
    curve = exponential(T, *popt)

    fig = plt.figure(num=fign, figsize=(8, 5), facecolor='w')
    ax = plt.gca()

    ax.plot(T,
            crest_growth.psi / 1000,
            'bo',
            mfc='b',
            markersize=10,
            label=ur'Crest $\psi$')
    ax.plot(T, curve / 1000, 'k--', lw=4.5, label=ur'Exponential Fit')

    ax.set_xlim(10., 200)
    ax.set_xticks(range(10, 200, 15))
    ax.tick_params(labelsize=22)
    rstyle(ax)

    ax.set_ylabel(ur"$\psi(y=900) \times 10^{3}$ (m$^{2}$ s$^{-1}$)",
                  fontsize=25,
                  fontweight='demibold')
    ax.set_xlabel(ur'Time (days)', fontsize=30, fontweight='demibold')
    ax.set_title(ur'Growth Rate $\sim$ %1.2f $\times 10^{-2}$ day$^{-1}$' %
                 (popt[1] * 100.),
                 fontsize=25,
                 fontweight='demibold')

    ax.legend(numpoints=1, loc=0, prop={'size': 25}, frameon=False)

    plt.draw()
    plt.show(block=False)

    return fig
def plt_annual_WBCt(fign):

    fig = plt.figure(num=fign, figsize=(8, 5), facecolor='w')
    ax = plt.gca()

    argo = np.ones(soest_gs.latitude.shape[0]) * np.nan
    wind = np.ones(scow_gs.latitude.shape[0]) * np.nan

    d = py.find(soest_gs.depth == 1200)[0]
    for i in xrange(argo.shape[0]):
        gs = soestgs_annual_Ipsi[d, i, :]
        good = py.find(~np.isnan(gs))

        if len(good) > 0:
            argo[i] = gs[good[0]]

        del gs, good

    for i in xrange(wind.shape[0]):
        gs = scowgs_annual_psi[i, :]
        good = py.find(~np.isnan(gs))

        if len(good) > 0:
            wind[i] = gs[good[0]]

        del gs, good

    ax.plot(soest_gs.latitude, argo, 'b', lw=3.5, label='ARGO')
    ax.plot(scow_gs.latitude, wind, 'r', lw=3.5, label='Sverdrup - Ekman')

    ax.legend(numpoints=1, loc=0, prop={'size': 20}, frameon=False)
    ax.plot([-60, 0], [0, 0], 'k--', lw=3.5)

    ax.set_ylim(-40, 40)
    ax.set_xlim(-5, -50)

    ax.set_yticks(range(-40, 50, 10))
    ax.set_xticks(range(-50, 0, 5))
    ax.tick_params(labelsize=18)
    rstyle(ax)

    labels = [
        ur'5$^{\circ}$S', ur'10$^{\circ}$S', ur'15$^{\circ}$S',
        ur'20$^{\circ}$S', ur'25$^{\circ}$S', ur'30$^{\circ}$S',
        ur'35$^{\circ}$S', ur'40$^{\circ}$S', ur'45$^{\circ}$S',
        ur'50$^{\circ}$S'
    ]

    labels.reverse()

    ax.set_xticklabels(labels)

    ax.set_ylabel('Transport at X$_{w}$ (Sv)',
                  fontsize=30,
                  fontweight='demibold')
    ax.set_xlabel(ur'Latitude', fontsize=30, fontweight='demibold')

    plt.draw()
    plt.show(block=False)

    return fig