def pmm_init(bin_edges_1, cdf_1, bin_edges_2, cdf_2):
    """
    Initialize a probability matching method (PMM) object from binned
    cumulative distribution functions (CDF).

    Parameters
    ----------
    bin_edges_1: array_like
        Coordinates of the left bin edges of the source cdf.
    cdf_1: array_like
        Values of the source CDF at the bin edges.
    bin_edges_2: array_like
        Coordinates of the left bin edges of the target cdf.
    cdf_2: array_like
        Values of the target CDF at the bin edges.
    """
    pmm = {}

    pmm["bin_edges_1"] = bin_edges_1.copy()
    pmm["cdf_1"] = cdf_1.copy()
    pmm["bin_edges_2"] = bin_edges_2.copy()
    pmm["cdf_2"] = cdf_2.copy()
    pmm["cdf_interpolator"] = sip.interp1d(bin_edges_1, cdf_1, kind="linear")

    return pmm
Initialize a probability matching method (PMM) object from binned
cumulative distribution functions (CDF).

Parameters
----------
bin_edges_1: array_like
Coordinates of the left bin edges of the source cdf.
cdf_1: array_like
Values of the source CDF at the bin edges.
bin_edges_2: array_like
Coordinates of the left bin edges of the target cdf.
cdf_2: array_like
Values of the target CDF at the bin edges.
pysteps/postprocessing/probmatching.py