Example #1
0
def plotCorrDiff(array1, array2, title, filepath):
    """
    A function to produce plots of correlation differences.

    Parameters:
    -----------
    array1 : observational dataset.  Output of corr()
    array2 : modelled dataset. Output of corr()
    """
    corrDiff_array = corrDiff(array1, array2)
    if corrDiff_array != None:
        Dict6 = mapCorr()
        myplot = plot(corrDiff_array,
                      Dict6,
                      labels=False,
                      grid=False,
                      oceans=False,
                      cbar=True)
        reload(maps_sub)
        from maps_sub import saveFig
        saveFig(myplot, title, filepath)
    else:
        array = np.zeros((27, 22))
        Dict6 = mapCorr()
        myplot = plot(array,
                      Dict6,
                      labels=False,
                      grid=False,
                      oceans=False,
                      cbar=True)
        reload(maps_sub)
        from maps_sub import saveFig
        saveFig(myplot, title, filepath)
    return
Example #2
0
def plotStrat(stratAv,precip_data,title,filepath):
    """
    A function to produce plots of stratified data.
    """
    var = ma.masked_invalid(stratAv)
    dict7 = mapComposite(precip_data)
    myplot = plot(var,dict7,labels=False,grid=False,oceans=False,cbar=False)
    reload(maps_sub)
    from maps_sub import saveFig
    saveFig(myplot,title,filepath)
    return
Example #3
0
def plotStratStandardised(data,precip_data,title,filepath):
    """
    A function to produce standardised plots of stratified rainfall data.
    """
    var = ma.masked_invalid(data)
    dict10 = mapDifference(precip_data)
    myplot = plot(var,dict10,labels=False,grid=False,oceans=False,cbar=False)
    reload(maps_sub)
    from maps_sub import saveFig
    saveFig(myplot,title,filepath)
    return
Example #4
0
def plotStratDiff(stratAv,precip_data,title,filepath):
    """
    A function to produce precipitation difference maps (between
    wet and dry phases of the ENSO and IPO).
    """
    var = ma.masked_invalid(stratAv)
    dict9 = mapDifference(precip_data)
    myplot = plot(var,dict9,labels=False,grid=False,oceans=False,cbar=True)
    reload(maps_sub)
    from maps_sub import saveFig
    saveFig(myplot,title,filepath)
    return
Example #5
0
def plotCorr(rainfall,index,title,filepath):
    """
    A function to produce plots of correlations.
    """
    var = corr(rainfall,index)
    var2 = ma.masked_invalid(var)
    Dict6 = mapCorr()
    myplot = plot(var2,Dict6,labels=False,grid=False,oceans=False,cbar=True)
    reload(maps_sub)
    from maps_sub import saveFig
    saveFig(myplot,title,filepath)
    return
Example #6
0
def plotCorrStratified(rainfall,index,title,filepath):
    """
    A function to produce plots of correlations between
    one index and stratified (according to a second index) precipitation data.
    """
    var = corr(rainfall,index)
    var2 = ma.masked_invalid(var)
    Dict6 = mapCorrStratified(var2)
    myplot = plot(var2,Dict6,labels=False,grid=False,oceans=False,cbar=True)
    reload(maps_sub)
    from maps_sub import saveFig
    saveFig(myplot,title,filepath)
    return
Example #7
0
def plotStrat(stratAv, precip_data, title, filepath):
    """
    A function to produce plots of stratified data.
    """
    var = ma.masked_invalid(stratAv)
    dict7 = mapComposite(precip_data)
    myplot = plot(var,
                  dict7,
                  labels=False,
                  grid=False,
                  oceans=False,
                  cbar=False)
    reload(maps_sub)
    from maps_sub import saveFig
    saveFig(myplot, title, filepath)
    return
Example #8
0
def plotStratStandardised(data, precip_data, title, filepath):
    """
    A function to produce standardised plots of stratified rainfall data.
    """
    var = ma.masked_invalid(data)
    dict10 = mapDifference(precip_data)
    myplot = plot(var,
                  dict10,
                  labels=False,
                  grid=False,
                  oceans=False,
                  cbar=False)
    reload(maps_sub)
    from maps_sub import saveFig
    saveFig(myplot, title, filepath)
    return
Example #9
0
def plotCorr(rainfall, index, title, filepath):
    """
    A function to produce plots of correlations.
    """
    var = corr(rainfall, index)
    var2 = ma.masked_invalid(var)
    Dict6 = mapCorr()
    myplot = plot(var2,
                  Dict6,
                  labels=False,
                  grid=False,
                  oceans=False,
                  cbar=True)
    reload(maps_sub)
    from maps_sub import saveFig
    saveFig(myplot, title, filepath)
    return
Example #10
0
def plotStratDiff(stratAv, precip_data, title, filepath):
    """
    A function to produce precipitation difference maps (between
    wet and dry phases of the ENSO and IPO).
    """
    var = ma.masked_invalid(stratAv)
    dict9 = mapDifference(precip_data)
    myplot = plot(var,
                  dict9,
                  labels=False,
                  grid=False,
                  oceans=False,
                  cbar=True)
    reload(maps_sub)
    from maps_sub import saveFig
    saveFig(myplot, title, filepath)
    return
Example #11
0
def plotCorrStratified(rainfall, index, title, filepath):
    """
    A function to produce plots of correlations between
    one index and stratified (according to a second index) precipitation data.
    """
    var = corr(rainfall, index)
    var2 = ma.masked_invalid(var)
    Dict6 = mapCorrStratified(var2)
    myplot = plot(var2,
                  Dict6,
                  labels=False,
                  grid=False,
                  oceans=False,
                  cbar=True)
    reload(maps_sub)
    from maps_sub import saveFig
    saveFig(myplot, title, filepath)
    return
Example #12
0
def plotCorrDiff(array1,array2,title,filepath):
    """
    A function to produce plots of correlation differences.

    Parameters:
    -----------
    array1 : observational dataset.  Output of corr()
    array2 : modelled dataset. Output of corr()
    """
    corrDiff_array = corrDiff(array1,array2)
    if corrDiff_array != None:
        Dict6 = mapCorr()
        myplot = plot(corrDiff_array,Dict6,labels=False,grid=False,oceans=False,cbar=True)
        reload(maps_sub)
        from maps_sub import saveFig
        saveFig(myplot,title,filepath)
    else:
        array = np.zeros((27,22))
        Dict6 = mapCorr()
        myplot = plot(array,Dict6,labels=False,grid=False,oceans=False,cbar=True)
        reload(maps_sub)
        from maps_sub import saveFig
        saveFig(myplot,title,filepath)
    return