    def __prepare_nowcast_for_zero_radar(self):
        """
        Handle the case when radar fields indicate zero precipitation. This method
        updates the cascade with NWP data, uses the NWP velocity field, and
        initializes the noise model based on the time step with the most rain.
        """
        # If zero_precip_radar, make sure that precip_cascade does not contain
        # only nans or infs. If so, fill it with the zero value.

        # Look for a timestep and member with rain so that we have a sensible decomposition
        done = False
        for t in self.__timesteps:
            if done:
                break
            for j in range(self.__precip_models.shape[0]):
                if not check_norain(
                    self.__precip_models[j, t],
                    self.__config.precip_threshold,
                    self.__config.norain_threshold,
                    self.__params.noise_kwargs["win_fun"],
                ):
                    if self.__state.precip_models_cascades is not None:
                        self.__state.precip_cascades[
                            ~np.isfinite(self.__state.precip_cascades)
                        ] = np.nanmin(
                            self.__state.precip_models_cascades[j, t]["cascade_levels"]
                        )
                        continue
                    precip_models_cascade_timestep = self.__params.decomposition_method(
                        self.__precip_models[j, t, :, :],
                        bp_filter=self.__params.bandpass_filter,
                        fft_method=self.__params.fft,
                        output_domain=self.__config.domain,
                        normalize=True,
                        compute_stats=True,
                        compact_output=True,
                    )["cascade_levels"]
                    self.__state.precip_cascades[
                        ~np.isfinite(self.__state.precip_cascades)
                    ] = np.nanmin(precip_models_cascade_timestep)
                    done = True
                    break

        # If zero_precip_radar is True, only use the velocity field of the NWP
        # forecast. I.e., velocity (radar) equals velocity_model at the first time
        # step.
        # Use the velocity from velocity_models at time step 0
        self.__velocity = self.__velocity_models[:, 0, :, :, :].astype(
            np.float64, copy=False
        )
        # Take the average over the first axis, which corresponds to n_models
        # (hence, the model average)
        self.__velocity = np.mean(self.__velocity, axis=0)

        # Initialize the noise method.
        # If zero_precip_radar is True, initialize noise based on the NWP field time
        # step where the fraction of rainy cells is highest (because other lead times
        # might be zero as well). Else, initialize the noise with the radar
        # rainfall data
        # Initialize noise based on the NWP field time step where the fraction of rainy cells is highest
        if self.__config.precip_threshold is None:
            self.__config.precip_threshold = np.nanmin(self.__precip_models)

        max_rain_pixels = -1
        max_rain_pixels_j = -1
        max_rain_pixels_t = -1
        for j in range(self.__precip_models.shape[0]):
            for t in self.__timesteps:
                rain_pixels = self.__precip_models[j][t][
                    self.__precip_models[j][t] > self.__config.precip_threshold
                ].size
                if rain_pixels > max_rain_pixels:
                    max_rain_pixels = rain_pixels
                    max_rain_pixels_j = j
                    max_rain_pixels_t = t
        self.__state.precip_noise_input = self.__precip_models[max_rain_pixels_j][
            max_rain_pixels_t
        ]
        self.__state.precip_noise_input = self.__state.precip_noise_input.astype(
            np.float64, copy=False
        )

        # Make sure precip_noise_input is three-dimensional
        if len(self.__state.precip_noise_input.shape) != 3:
            self.__state.precip_noise_input = self.__state.precip_noise_input[
                np.newaxis, :, :
            ]
Handle the case when radar fields indicate zero precipitation. This method
updates the cascade with NWP data, uses the NWP velocity field, and
initializes the noise model based on the time step with the most rain.
pysteps/blending/steps.py