Converts 3D arrays of the form [lon,lat,time] -not strictly in this order-, to 2D matrices of the form [time, grid-point], in this order. Mainly for PCA analysis.
A 3-dimensional array with longitude, latitude and time dimensions
The function is intended to convert grids to a convenient format for PCA-related analyses. The columns are ordered in X and Y ascending order, with coordinate Y varying faster. Thus, column coordinates would be given by the expression: expand.grid(gridData$xyCoords$y, gridData$xyCoords$x)[2:1]. This is the most convenient format in order to naturally fill a matrix with the adequate number of columns (longitudes) and rows (latitudes) given the vectorized value of the output at a given time (or after time-averaging via rowMeans). The function is insensitive to the dimension ordering of the input data array
A 2-dimensional matrix with time in rows and grid-points in columns.
M. de Felice, J Bedia
mat2Dto3Darray, which performs the inverse operation
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.