# Path: lib/eofs/tools/standard.py
# def correlation_map(pcs, field):
#     """Correlation maps for a set of PCs and a spatial-temporal field.
# 
#     Given an array where the columns are PCs (e.g., as output from
#     `~eofs.standard.Eof.pcs`) and an array containing spatial-temporal
#     data where the first dimension represents time, one correlation map
#     per PC is computed.
# 
#     The field must have the same temporal dimension as the PCs. Any
#     number of spatial dimensions (including zero) are allowed in the
#     field and there can be any number of PCs.
# 
#     **Arguments:**
# 
#     *pcs*
#         PCs as the columns of an array.
# 
#     *field*
#         Spatial-temporal field with time as the first dimension.
# 
#     **Returns:**
# 
#     *correlation_maps*
#         An array with the correlation maps along the first dimension.
# 
#     **Example:**
# 
#     Compute correlation maps for each PC::
# 
#         pcs = solver.pcs(pcscaling=1)
#         correlation_maps = correlation_maps(pcs, field)
# 
#     """
#     # Check PCs and fields for validity, flatten the arrays ready for the
#     # computation and remove the mean along the leading dimension.
#     pcs_cent, field_cent, out_shape = _check_flat_center(pcs, field)
#     # Compute the standard deviation of the PCs and the fields along the time
#     # dimension (the leading dimension).
#     pcs_std = pcs_cent.std(axis=0)
#     field_std = field_cent.std(axis=0)
#     # Set the divisor.
#     div = np.float64(pcs_cent.shape[0])
#     # Compute the correlation map.
#     cor = ma.dot(field_cent.T, pcs_cent).T / div
#     cor = ma.masked_invalid(cor)
#     cor /= ma.outer(pcs_std, field_std)
#     # Return the correlation with the appropriate shape.
#     return cor.reshape(out_shape)
# 
# def covariance_map(pcs, field, ddof=1):
#     """Covariance maps for a set of PCs and a spatial-temporal field.
# 
#     Given an array where the columns are PCs (e.g., as output from
#     `eofs.standard.Eof.pcs`) and an array containing spatial-temporal
#     data where the first dimension represents time, one covariance map
#     per PC is computed.
# 
#     The field must have the same temporal dimension as the PCs. Any
#     number of spatial dimensions (including zero) are allowed in the
#     field and there can be any number of PCs.
# 
#     **Arguments:**
# 
#     *pcs*
#         PCs as the columns of an array.
# 
#     *field*
#         Spatial-temporal field with time as the first dimension.
# 
#     **Optional arguments:**
# 
#     *ddof*
#         'Delta degrees of freedom'. The divisor used to normalize
#         the covariance matrix is *N - ddof* where *N* is the
#         number of samples. Defaults to *1*.
# 
#     **Returns:**
# 
#     *covariance_maps*
#         An array with the covariance maps along the first dimension.
# 
#     **Example:**
# 
#     Compute covariance maps for each PC::
# 
#         pcs = solver.pcs(pcscaling=1)
#         covariance_maps = covariance_maps(pcs, field)
# 
#     """
#     # Check PCs and fields for validity, flatten the arrays ready for the
#     # computation and remove the mean along the leading dimension.
#     pcs_cent, field_cent, out_shape = _check_flat_center(pcs, field)
#     # Set the divisor according to the specified delta-degrees of freedom.
#     div = np.float64(pcs_cent.shape[0] - ddof)
#     # Compute the covariance map, making sure it has the appropriate shape.
#     cov = (ma.dot(field_cent.T, pcs_cent).T / div).reshape(out_shape)
#     cov = ma.masked_invalid(cov)
#     return cov


import collections
import warnings
import numpy as np
import numpy.ma as ma
    import dask.array
from .tools.standard import correlation_map, covariance_map

            These are not related to the EOFs computed from the
            correlation matrix.

        **Optional argument:**

        *neofs*
            Number of EOFs to return. Defaults to all EOFs. If the
            number of EOFs requested is more than the number that are
            available, then all available EOFs will be returned.

        **Returns:**

        *eofs*
            An array with the ordered EOFs along the first dimension.

        **Examples:**

        All EOFs::

            eofs = solver.eofsAsCorrelation()

        The leading EOF::

            eof1 = solver.eofsAsCorrelation(neofs=1)

        """
        # Retrieve the specified number of PCs.
        pcs = self.pcs(npcs=neofs, pcscaling=1)
        # Compute the correlation of the PCs with the input field.

# Path: lib/eofs/tools/standard.py
# def correlation_map(pcs, field):
#     """Correlation maps for a set of PCs and a spatial-temporal field.
# 
#     Given an array where the columns are PCs (e.g., as output from
#     `~eofs.standard.Eof.pcs`) and an array containing spatial-temporal
#     data where the first dimension represents time, one correlation map
#     per PC is computed.
# 
#     The field must have the same temporal dimension as the PCs. Any
#     number of spatial dimensions (including zero) are allowed in the
#     field and there can be any number of PCs.
# 
#     **Arguments:**
# 
#     *pcs*
#         PCs as the columns of an array.
# 
#     *field*
#         Spatial-temporal field with time as the first dimension.
# 
#     **Returns:**
# 
#     *correlation_maps*
#         An array with the correlation maps along the first dimension.
# 
#     **Example:**
# 
#     Compute correlation maps for each PC::
# 
#         pcs = solver.pcs(pcscaling=1)
#         correlation_maps = correlation_maps(pcs, field)
# 
#     """
#     # Check PCs and fields for validity, flatten the arrays ready for the
#     # computation and remove the mean along the leading dimension.
#     pcs_cent, field_cent, out_shape = _check_flat_center(pcs, field)
#     # Compute the standard deviation of the PCs and the fields along the time
#     # dimension (the leading dimension).
#     pcs_std = pcs_cent.std(axis=0)
#     field_std = field_cent.std(axis=0)
#     # Set the divisor.
#     div = np.float64(pcs_cent.shape[0])
#     # Compute the correlation map.
#     cor = ma.dot(field_cent.T, pcs_cent).T / div
#     cor = ma.masked_invalid(cor)
#     cor /= ma.outer(pcs_std, field_std)
#     # Return the correlation with the appropriate shape.
#     return cor.reshape(out_shape)
# 
# def covariance_map(pcs, field, ddof=1):
#     """Covariance maps for a set of PCs and a spatial-temporal field.
# 
#     Given an array where the columns are PCs (e.g., as output from
#     `eofs.standard.Eof.pcs`) and an array containing spatial-temporal
#     data where the first dimension represents time, one covariance map
#     per PC is computed.
# 
#     The field must have the same temporal dimension as the PCs. Any
#     number of spatial dimensions (including zero) are allowed in the
#     field and there can be any number of PCs.
# 
#     **Arguments:**
# 
#     *pcs*
#         PCs as the columns of an array.
# 
#     *field*
#         Spatial-temporal field with time as the first dimension.
# 
#     **Optional arguments:**
# 
#     *ddof*
#         'Delta degrees of freedom'. The divisor used to normalize
#         the covariance matrix is *N - ddof* where *N* is the
#         number of samples. Defaults to *1*.
# 
#     **Returns:**
# 
#     *covariance_maps*
#         An array with the covariance maps along the first dimension.
# 
#     **Example:**
# 
#     Compute covariance maps for each PC::
# 
#         pcs = solver.pcs(pcscaling=1)
#         covariance_maps = covariance_maps(pcs, field)
# 
#     """
#     # Check PCs and fields for validity, flatten the arrays ready for the
#     # computation and remove the mean along the leading dimension.
#     pcs_cent, field_cent, out_shape = _check_flat_center(pcs, field)
#     # Set the divisor according to the specified delta-degrees of freedom.
#     div = np.float64(pcs_cent.shape[0] - ddof)
#     # Compute the covariance map, making sure it has the appropriate shape.
#     cov = (ma.dot(field_cent.T, pcs_cent).T / div).reshape(out_shape)
#     cov = ma.masked_invalid(cov)
#     return cov


# Path: lib/eofs/standard.py
import collections
import warnings
import numpy as np
import numpy.ma as ma
    import dask.array
from .tools.standard import correlation_map, covariance_map


            These are not related to the EOFs computed from the
            correlation matrix.

        **Optional argument:**

        *neofs*
            Number of EOFs to return. Defaults to all EOFs. If the
            number of EOFs requested is more than the number that are
            available, then all available EOFs will be returned.

        **Returns:**

        *eofs*
            An array with the ordered EOFs along the first dimension.

        **Examples:**

        All EOFs::

            eofs = solver.eofsAsCorrelation()

        The leading EOF::

            eof1 = solver.eofsAsCorrelation(neofs=1)

        """
        # Retrieve the specified number of PCs.
        pcs = self.pcs(npcs=neofs, pcscaling=1)
        # Compute the correlation of the PCs with the input field.

        c = correlation_map(