def sal_location(
    prediction, observation, thr_factor=None, thr_quantile=None, tstorm_kwargs=None
):
    """
    Compute the first parameter of location component for SAL based on
    :cite:`WPHF2008`.

    This parameter indicates the normalized distance between the center of mass 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.
    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
    -------
    location: float
        The location component with value between 0 to 2 and 0 denotes perfect forecast
        in terms of location. The returned value is NaN if no objects are detected in
        either the prediction or the observation.

    See also
    --------
    :py:func:`pysteps.verification.salscores.sal`,
    :py:func:`pysteps.verification.salscores.sal_structure`,
    :py:func:`pysteps.verification.salscores.sal_amplitude`,
    :py:mod:`pysteps.feature.tstorm`
    """
    return _sal_l1_param(prediction, observation) + _sal_l2_param(
        prediction, observation, thr_factor, thr_quantile, tstorm_kwargs
    )
Compute the first parameter of location component for SAL based on
:cite:`WPHF2008`.

This parameter indicates the normalized distance between the center of mass 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.
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
-------
location: float
The location component with value between 0 to 2 and 0 denotes perfect forecast
in terms of location. The returned value is NaN if no objects are detected in
either the prediction or the observation.

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