def sal_amplitude(prediction, observation):
    """
    Compute the amplitude component for SAL based on :cite:`WPHF2008`.

    This component is the normalized difference of the domain-averaged precipitation
    in observation and forecast.

    Parameters
    ----------
    prediction: array-like
        Array of shape (m,n) with prediction data. NaNs are ignored.
    observation: array-like
        Array of shape (m,n)  with observation data. NaNs are ignored.

    Returns
    -------
    amplitude: float
        Amplitude parameter with value between -2 to 2 and 0 denotes perfect forecast in
        terms of amplitude. The returned value is NaN if no objects are detected in
        neither the prediction nor the observation.

    See also
    --------
    :py:func:`pysteps.verification.salscores.sal`,
    :py:func:`pysteps.verification.salscores.sal_structure`,
    :py:func:`pysteps.verification.salscores.sal_location`
    """
    mean_obs = np.nanmean(observation)
    mean_pred = np.nanmean(prediction)
    return (mean_pred - mean_obs) / (0.5 * (mean_pred + mean_obs))
Compute the amplitude component for SAL based on :cite:`WPHF2008`.

This component is the normalized difference of the domain-averaged precipitation
in observation and forecast.

Parameters
----------
prediction: array-like
Array of shape (m,n) with prediction data. NaNs are ignored.
observation: array-like
Array of shape (m,n)  with observation data. NaNs are ignored.

Returns
-------
amplitude: float
Amplitude parameter with value between -2 to 2 and 0 denotes perfect forecast in
terms of amplitude. The returned value is NaN if no objects are detected in
neither the prediction nor the observation.

See also
--------
:py:func:`pysteps.verification.salscores.sal`,
:py:func:`pysteps.verification.salscores.sal_structure`,
:py:func:`pysteps.verification.salscores.sal_location`
pysteps/verification/salscores.py