    def __find_nowcast_NWP_combination(self, t):
        """
        Determine which (NWP) models will be combined with which nowcast ensemble members.
        With the way it is implemented at this moment: n_ens_members of the output equals
        the maximum number of (ensemble) members in the input (either the nowcasts or NWP).
        """
        self.__state.velocity_models_timestep = self.__velocity_models[
            :, t, :, :, :
        ].astype(np.float64, copy=False)
        # Make sure the number of model members is not larger than or equal to n_ens_members
        n_model_members = self.__state.precip_models_cascades_timestep.shape[0]
        if n_model_members > self.__config.n_ens_members:
            raise ValueError(
                "The number of NWP model members is larger than the given number of ensemble members. n_model_members <= n_ens_members."
            )

        # Check if NWP models/members should be used individually, or if all of
        # them are blended together per nowcast ensemble member.
        if self.__config.blend_nwp_members:
            self.__state.mapping_list_NWP_member_to_ensemble_member = None

        else:
            # Start with determining the maximum and mimimum number of members/models
            # in both input products
            n_ens_members_max = max(self.__config.n_ens_members, n_model_members)
            n_ens_members_min = min(self.__config.n_ens_members, n_model_members)
            # Also make a list of the model index numbers. These indices are needed
            # for indexing the right climatological skill file when pysteps calculates
            # the blended forecast in parallel.
            if n_model_members > 1:
                self.__state.mapping_list_NWP_member_to_ensemble_member = np.arange(
                    n_model_members
                )
            else:
                self.__state.mapping_list_NWP_member_to_ensemble_member = [0]

            # Now, repeat the nowcast ensemble members or the nwp models/members until
            # it has the same amount of members as n_ens_members_max. For instance, if
            # you have 10 ensemble nowcasts members and 3 NWP members, the output will
            # be an ensemble of 10 members. Hence, the three NWP members are blended
            # with the first three members of the nowcast (member one with member one,
            # two with two, etc.), subsequently, the same NWP members are blended with
            # the next three members (NWP member one with member 4, NWP member 2 with
            # member 5, etc.), until 10 is reached.
            if n_ens_members_min != n_ens_members_max:
                if n_model_members == 1:
                    self.__state.precip_models_cascades_timestep = np.repeat(
                        self.__state.precip_models_cascades_timestep,
                        n_ens_members_max,
                        axis=0,
                    )
                    self.__state.mean_models_timestep = np.repeat(
                        self.__state.mean_models_timestep, n_ens_members_max, axis=0
                    )
                    self.__state.std_models_timestep = np.repeat(
                        self.__state.std_models_timestep, n_ens_members_max, axis=0
                    )
                    self.__state.velocity_models_timestep = np.repeat(
                        self.__state.velocity_models_timestep, n_ens_members_max, axis=0
                    )
                    # For the prob. matching
                    self.__state.precip_models_timestep = np.repeat(
                        self.__state.precip_models_timestep, n_ens_members_max, axis=0
                    )
                    # Finally, for the model indices
                    self.__state.mapping_list_NWP_member_to_ensemble_member = np.repeat(
                        self.__state.mapping_list_NWP_member_to_ensemble_member,
                        n_ens_members_max,
                        axis=0,
                    )

                elif n_model_members == n_ens_members_min:
                    repeats = [
                        (n_ens_members_max + i) // n_ens_members_min
                        for i in range(n_ens_members_min)
                    ]
                    self.__state.precip_models_cascades_timestep = np.repeat(
                        self.__state.precip_models_cascades_timestep,
                        repeats,
                        axis=0,
                    )
                    self.__state.mean_models_timestep = np.repeat(
                        self.__state.mean_models_timestep, repeats, axis=0
                    )
                    self.__state.std_models_timestep = np.repeat(
                        self.__state.std_models_timestep, repeats, axis=0
                    )
                    self.__state.velocity_models_timestep = np.repeat(
                        self.__state.velocity_models_timestep, repeats, axis=0
                    )
                    # For the prob. matching
                    self.__state.precip_models_timestep = np.repeat(
                        self.__state.precip_models_timestep, repeats, axis=0
                    )
                    # Finally, for the model indices
                    self.__state.mapping_list_NWP_member_to_ensemble_member = np.repeat(
                        self.__state.mapping_list_NWP_member_to_ensemble_member,
                        repeats,
                        axis=0,
                    )
Determine which (NWP) models will be combined with which nowcast ensemble members.
With the way it is implemented at this moment: n_ens_members of the output equals
the maximum number of (ensemble) members in the input (either the nowcasts or NWP).
pysteps/blending/steps.py