def corrCalc(his, fut, wavenumber, lev, lons):
    """
    Calculate correlations for each ensemble member to understand the spread
    in linear interference for each wave during the set month
    """
    if wavenumber == 'all':
        hisw = his[0]
        futw = fut[0]
        lon = lons[0]
    elif wavenumber == '1':
        hisw = his[1]
        futw = fut[1]
        lon = lons[1]
    elif wavenumber == '2':
        hisw = his[2]
        futw = fut[2]
        lon = lons[2]
    else:
        print(ValueError('WRONG WAVE NUMBER!'))

    corrs = np.empty((futw.shape[0]))
    for i in range(futw.shape[0]):
        corrs[i] = UT.calc_spatialCorrHeight(hisw, futw[i], lev, lon[i], 'yes')

    return corrs
Beispiel #2
0
###########################################################################
###########################################################################
#### Plot climatological waves
plt.rc('text',usetex=True)
plt.rc('font',**{'family':'sans-serif','sans-serif':['Avant Garde']}) 

### Set limits for contours and colorbars
zscale = np.array([1000,700,500,300,200,
                    100,50,30,10])

fig = plt.figure()
for i in range(3):
    ax1 = plt.subplot(3,1,i+1)
    
    ### Calculate correlations
    corr = UT.calc_spatialCorrHeight(historicalforced[i],futureforced[i],
                                lev,lonss[i],'yes')
    
    lonq,levq = np.meshgrid(lonss[i],lev)
    
    ax1.spines['top'].set_color('dimgrey')
    ax1.spines['right'].set_color('dimgrey')
    ax1.spines['bottom'].set_color('dimgrey')
    ax1.spines['left'].set_color('dimgrey')
    ax1.spines['left'].set_linewidth(2)
    ax1.spines['bottom'].set_linewidth(2)
    ax1.spines['right'].set_linewidth(2)
    ax1.spines['top'].set_linewidth(2)
    ax1.tick_params(axis='y',direction='out',which='major',pad=3,
                    width=2,color='dimgrey')
    ax1.tick_params(axis='x',direction='out',which='major',pad=3,
                    width=2,color='dimgrey')