def _sal_l2_param(prediction, observation, thr_factor, thr_quantile, tstorm_kwargs):
    """
    Calculate the second parameter of location component for SAL based on :cite:`WPHF2008`.

    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
        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
        The wet quantile between 0 and 1 used to define the detection threshold.
        Required if `thr_factor` is not None.
    tstorm_kwargs: dict
        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_2: float
        The secibd parameter of location component with value between 0 to 1.
    """
    maximum_distance = sqrt(
        ((observation.shape[0]) ** 2) + ((observation.shape[1]) ** 2)
    )
    obs_r = _sal_weighted_distance(observation, thr_factor, thr_quantile, tstorm_kwargs)
    forc_r = _sal_weighted_distance(prediction, thr_factor, thr_quantile, tstorm_kwargs)

    location_2 = 2 * ((abs(obs_r - forc_r)) / maximum_distance)
    return float(location_2)
Calculate the second parameter of location component for SAL based on :cite:`WPHF2008`.

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
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
The wet quantile between 0 and 1 used to define the detection threshold.
Required if `thr_factor` is not None.
tstorm_kwargs: dict
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_2: float
The secibd parameter of location component with value between 0 to 1.
pysteps/verification/salscores.py