def pmm_compute(pmm, x):
    """
    For a given PMM object and x-coordinate, compute the probability matched
    value (i.e. the x-coordinate for which the target CDF has the same value as
    the source CDF).

    Parameters
    ----------
    pmm: dict
        A PMM object returned by pmm_init.
    x: float
        The coordinate for which to compute the probability matched value.
    """
    mask = np.logical_and(x >= pmm["bin_edges_1"][0], x <= pmm["bin_edges_1"][-1])
    p = pmm["cdf_interpolator"](x[mask])

    result = np.ones(len(mask)) * np.nan
    result[mask] = _invfunc(p, pmm["bin_edges_2"], pmm["cdf_2"])

    return result
For a given PMM object and x-coordinate, compute the probability matched
value (i.e. the x-coordinate for which the target CDF has the same value as
the source CDF).

Parameters
----------
pmm: dict
A PMM object returned by pmm_init.
x: float
The coordinate for which to compute the probability matched value.
pysteps/postprocessing/probmatching.py