def clim_regr_values(n_cascade_levels, outdir_path, n_model=0, skill_kwargs=None):
    """Obtains the climatological correlation values and regression parameters
    from a file called NWP_weights_window.bin in the outdir_path. If this file
    is not present yet, the values from :cite:`BPS2004` are used.


    Parameters
    ----------
    n_cascade_levels : int
        The number of cascade levels to use.
    outdir_path: string
      Path to folder where the historical skill are stored. Defaults to
      path_workdir from rcparams.
    n_model: int, optional
        The index number of the (NWP) model when the climatological skill of
        multiple (NWP) models is stored. For calculations with one model, or
        when n_model is not provided, n_model = 0.
    skill_kwargs : dict, optional
        Dictionary containing e.g. the outdir_path, nmodels and window_length
        parameters.

    Returns
    -------
    clim_cor_values : array-like
        Array of shape [n_cascade_levels] containing the
        climatological values of the lag 1 and lag 2 auto-correlation
        coefficients, obtained by calling a method implemented in
        pysteps.blending.skill_scores.get_clim_skill_scores.
    regr_pars : array-like
        Array of shape [2, n_cascade_levels] containing the regression
        parameters. These are fixed values that should be hard-coded in this
        function. Unless changed by the user, the standard values from
        `BPS2004` are used.

    Notes
    -----
    The literature climatological values assume 8 cascade levels. In case
    less or more cascade levels are used, the script will handle this by taking
    the first n values or extending the array with a small value. This is not
    ideal, but will be fixed once the clim_regr_file is made. Hence, this
    requires a warm-up period of the model.
    In addition, the regression parameter values (eq. 24 in BPS2004) are hard-
    coded and can only be optimized by the user after (re)fitting of the
    equation.

    """

    if skill_kwargs is None:
        skill_kwargs = {"n_models": 1}

    # First, obtain climatological skill values
    try:
        clim_cor_values = clim.calc_clim_skill(
            outdir_path=outdir_path, n_cascade_levels=n_cascade_levels, **skill_kwargs
        )
    except FileNotFoundError:
        # The climatological skill values file does not exist yet, so we'll
        # use the default values from BPS2004.
        clim_cor_values = clim.get_default_skill(
            n_cascade_levels=n_cascade_levels, n_models=skill_kwargs["n_models"]
        )

    clim_cor_values = clim_cor_values[n_model, :]

    # Check if clim_cor_values has only one model, otherwise it has
    # returned the skill values for multiple models
    if clim_cor_values.ndim != 1:
        raise IndexError(
            "The climatological cor. values of multiple models were returned, but only one model should be specified. Make sure to pass the argument nmodels in the function"
        )

    # Also check whether the number of cascade_levels is correct
    if clim_cor_values.shape[0] > n_cascade_levels:
        clim_cor_values = clim_cor_values[0:n_cascade_levels]
    elif clim_cor_values.shape[0] < n_cascade_levels:
        # Get the number of cascade levels that is missing
        n_extra_lev = n_cascade_levels - clim_cor_values.shape[0]
        # Append the array with correlation values of 10e-4
        clim_cor_values = np.append(clim_cor_values, np.repeat(1e-4, n_extra_lev))

    # Get the regression parameters (L in eq. 24 in BPS2004) - Hard coded,
    # change to own values when present.
    regr_pars = np.array(
        [
            [130.0, 165.0, 120.0, 55.0, 50.0, 15.0, 15.0, 10.0],
            [155.0, 220.0, 200.0, 75.0, 10e4, 10e4, 10e4, 10e4],
        ]
    )

    # Check whether the number of cascade_levels is correct
    if regr_pars.shape[1] > n_cascade_levels:
        regr_pars = regr_pars[:, 0:n_cascade_levels]
    elif regr_pars.shape[1] < n_cascade_levels:
        # Get the number of cascade levels that is missing
        n_extra_lev = n_cascade_levels - regr_pars.shape[1]
        # Append the array with correlation values of 10e-4
        regr_pars = np.append(
            regr_pars,
            [np.repeat(10.0, n_extra_lev), np.repeat(10e4, n_extra_lev)],
            axis=1,
        )

    return clim_cor_values, regr_pars
Obtains the climatological correlation values and regression parameters
from a file called NWP_weights_window.bin in the outdir_path. If this file
is not present yet, the values from :cite:`BPS2004` are used.


Parameters
----------
n_cascade_levels : int
The number of cascade levels to use.
outdir_path: string
Path to folder where the historical skill are stored. Defaults to
path_workdir from rcparams.
n_model: int, optional
The index number of the (NWP) model when the climatological skill of
multiple (NWP) models is stored. For calculations with one model, or
when n_model is not provided, n_model = 0.
skill_kwargs : dict, optional
Dictionary containing e.g. the outdir_path, nmodels and window_length
parameters.

Returns
-------
clim_cor_values : array-like
Array of shape [n_cascade_levels] containing the
climatological values of the lag 1 and lag 2 auto-correlation
coefficients, obtained by calling a method implemented in
pysteps.blending.skill_scores.get_clim_skill_scores.
regr_pars : array-like
Array of shape [2, n_cascade_levels] containing the regression
parameters. These are fixed values that should be hard-coded in this
function. Unless changed by the user, the standard values from
`BPS2004` are used.

Notes
-----
The literature climatological values assume 8 cascade levels. In case
less or more cascade levels are used, the script will handle this by taking
the first n values or extending the array with a small value. This is not
ideal, but will be fixed once the clim_regr_file is made. Hence, this
requires a warm-up period of the model.
In addition, the regression parameter values (eq. 24 in BPS2004) are hard-
coded and can only be optimized by the user after (re)fitting of the
equation.
pysteps/blending/skill_scores.py