pysteps.verification.salscores.sal_structure

pysteps.verification.salscores.sal_structure

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

Compute the structure component for SAL based on [WPHF08].

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
structure: float

The structure component with value between -2 to 2 and 0 denotes perfect forecast in terms of structure. The returned value is NaN if no objects are detected in neither the prediction nor the observation.