
GetCorPatterns <- function(ano, lon, lat, PCs, nPCs = 4, nrow = NULL, ncol = NULL, show = FALSE){
    nlat <- length(lat)
    nlon <- length(lon)
    
    proj.cor <- array(NA, c(nPCs, nlat, nlon))

    ## Project the PCS:
    for(t in 1:nPCs) proj.cor[t,,] <- apply(ano, c(2,3), function(x) cor(x, PCs[,t], use = "na.or.complete"))
    
    brks.corr <- seq(-1, 1, 0.1)
    if(show) PlotLayout(PlotEquiMap, c(2,3), var = proj.cor, lat = lat, lon = lon, filled.continents = FALSE, bar_scale = .5, brks = brks.corr, nrow = nrow, ncol = ncol, titles=paste0("EOF #", 1:nPCs))

    if(show) invisible(proj.cor) else return(proj.cor)
}

