pysteps.verification.salscores.sal_location

pysteps.verification.salscores.sal_location

pysteps.verification.salscores.sal_location(prediction, observation, thr_factor=None, thr_quantile=None, tstorm_kwargs=None)

Compute the first parameter of location component for SAL based on [WPHF08].

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 [WHZ09]. 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 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.