def rankhist_init(num_ens_members, X_min=None):
    """
    Initialize a rank histogram object.

    Parameters
    ----------
    num_ens_members: int
        Number ensemble members in the forecasts to accumulate into the rank
        histogram.
    X_min: {float,None}
        Threshold for minimum intensity. Forecast-observation pairs, where all
        ensemble members and verifying observations are below X_min, are not
        counted in the rank histogram.
        If set to None, thresholding is not used.

    Returns
    -------
    out: dict
        The rank histogram object.
    """
    rankhist = {}

    rankhist["num_ens_members"] = num_ens_members
    rankhist["n"] = np.zeros(num_ens_members + 1, dtype=int)
    rankhist["X_min"] = X_min

    return rankhist
Initialize a rank histogram object.

Parameters
----------
num_ens_members: int
Number ensemble members in the forecasts to accumulate into the rank
histogram.
X_min: {float,None}
Threshold for minimum intensity. Forecast-observation pairs, where all
ensemble members and verifying observations are below X_min, are not
counted in the rank histogram.
If set to None, thresholding is not used.

Returns
-------
out: dict
The rank histogram object.
pysteps/verification/ensscores.py