def sal(
    prediction,
    observation,
    thr_factor=0.067,  # default to 1/15 as in the reference paper
    thr_quantile=0.95,
    tstorm_kwargs=None,
):
    """
    Compute the Structure-Amplitude-Location (SAL) spatial verification metric.

    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.
    thr_factor: float, optional
        Factor used to compute the detection threshold as in eq. 1 of :cite:`WHZ2009`.
        If not None, this is used to identify coherent objects enclosed by the
        threshold contour `thr_factor * thr_quantile(precip)`.
    thr_quantile: float, optional
        The wet quantile between 0 and 1 used to define the detection threshold.
        Required if `thr_factor` is not None.
    tstorm_kwargs: dict, optional
        Optional dictionary containing keyword arguments for the tstorm feature
        detection algorithm. If None, default values are used.
        See the documentation of :py:func:`pysteps.feature.tstorm.detection`.

    Returns
    -------
    sal: tuple of floats
        A 3-element tuple containing the structure, amplitude, location
        components of the SAL score.

    References
    ----------
    :cite:`WPHF2008`
    :cite:`WHZ2009`
    :cite:`Feldmann2021`

    Notes
    -----
    This implementation uses the thunderstorm detection algorithm by :cite:`Feldmann2021`
    for the identification of precipitation objects within the considered domain.

    See also
    --------
    :py:func:`pysteps.verification.salscores.sal_structure`,
    :py:func:`pysteps.verification.salscores.sal_amplitude`,
    :py:func:`pysteps.verification.salscores.sal_location`,
    :py:mod:`pysteps.feature.tstorm`
    """
    prediction = np.copy(prediction)
    observation = np.copy(observation)
    structure = sal_structure(
        prediction, observation, thr_factor, thr_quantile, tstorm_kwargs
    )
    amplitude = sal_amplitude(prediction, observation)
    location = sal_location(
        prediction, observation, thr_factor, thr_quantile, tstorm_kwargs
    )
    return structure, amplitude, location
Compute the Structure-Amplitude-Location (SAL) spatial verification metric.

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.
thr_factor: float, optional
Factor used to compute the detection threshold as in eq. 1 of :cite:`WHZ2009`.
If not None, this is used to identify coherent objects enclosed by the
threshold contour `thr_factor * thr_quantile(precip)`.
thr_quantile: float, optional
The wet quantile between 0 and 1 used to define the detection threshold.
Required if `thr_factor` is not None.
tstorm_kwargs: dict, optional
Optional dictionary containing keyword arguments for the tstorm feature
detection algorithm. If None, default values are used.
See the documentation of :py:func:`pysteps.feature.tstorm.detection`.

Returns
-------
sal: tuple of floats
A 3-element tuple containing the structure, amplitude, location
components of the SAL score.

References
----------
:cite:`WPHF2008`
:cite:`WHZ2009`
:cite:`Feldmann2021`

Notes
-----
This implementation uses the thunderstorm detection algorithm by :cite:`Feldmann2021`
for the identification of precipitation objects within the considered domain.

See also
--------
:py:func:`pysteps.verification.salscores.sal_structure`,
:py:func:`pysteps.verification.salscores.sal_amplitude`,
:py:func:`pysteps.verification.salscores.sal_location`,
:py:mod:`pysteps.feature.tstorm`
pysteps/verification/salscores.py