    def __check_inputs(self):
        """
        Validate the inputs to ensure consistency and correct shapes.
        """
        if self.__precip.ndim != 3:
            raise ValueError("precip must be a three-dimensional array")
        if self.__precip.shape[0] < self.__config.ar_order + 1:
            raise ValueError(
                f"precip.shape[0] must be at least ar_order+1, "
                f"but found {self.__precip.shape[0]}"
            )
        if self.__velocity.ndim != 3:
            raise ValueError("velocity must be a three-dimensional array")
        if self.__precip.shape[1:3] != self.__velocity.shape[1:3]:
            raise ValueError(
                f"Dimension mismatch between precip and velocity: "
                f"shape(precip)={self.__precip.shape}, shape(velocity)={self.__velocity.shape}"
            )
        if (
            isinstance(self.__time_steps, list)
            and not sorted(self.__time_steps) == self.__time_steps
        ):
            raise ValueError("timesteps must be in ascending order")
        if np.any(~np.isfinite(self.__velocity)):
            raise ValueError("velocity contains non-finite values")
        if self.__config.mask_method not in ["obs", "sprog", "incremental", None]:
            raise ValueError(
                f"Unknown mask method '{self.__config.mask_method}'. "
                "Must be 'obs', 'sprog', 'incremental', or None."
            )
        if self.__config.precip_threshold is None:
            if self.__config.conditional:
                raise ValueError("conditional=True but precip_thr is not specified.")
            if self.__config.mask_method is not None:
                raise ValueError("mask_method is set but precip_thr is not specified.")
            if self.__config.probmatching_method == "mean":
                raise ValueError(
                    "probmatching_method='mean' but precip_thr is not specified."
                )
            if (
                self.__config.noise_method is not None
                and self.__config.noise_stddev_adj == "auto"
            ):
                raise ValueError(
                    "noise_stddev_adj='auto' but precip_thr is not specified."
                )
        if self.__config.noise_stddev_adj not in ["auto", "fixed", None]:
            raise ValueError(
                f"Unknown noise_stddev_adj method '{self.__config.noise_stddev_adj}'. "
                "Must be 'auto', 'fixed', or None."
            )
        if self.__config.kmperpixel is None:
            if self.__config.velocity_perturbation_method is not None:
                raise ValueError("vel_pert_method is set but kmperpixel=None")
            if self.__config.mask_method == "incremental":
                raise ValueError("mask_method='incremental' but kmperpixel=None")
        if self.__config.timestep is None:
            if self.__config.velocity_perturbation_method is not None:
                raise ValueError("vel_pert_method is set but timestep=None")
            if self.__config.mask_method == "incremental":
                raise ValueError("mask_method='incremental' but timestep=None")

        # Handle None values for various kwargs
        if self.__config.extrapolation_kwargs is None:
            self.__state.extrapolation_kwargs = dict()
        else:
            self.__state.extrapolation_kwargs = deepcopy(
                self.__config.extrapolation_kwargs
            )

        if self.__config.filter_kwargs is None:
            self.__params.filter_kwargs = dict()
        else:
            self.__params.filter_kwargs = deepcopy(self.__config.filter_kwargs)

        if self.__config.noise_kwargs is None:
            self.__params.noise_kwargs = {"win_fun": "tukey"}
        else:
            self.__params.noise_kwargs = deepcopy(self.__config.noise_kwargs)

        if self.__config.velocity_perturbation_kwargs is None:
            self.__params.velocity_perturbation_kwargs = dict()
        else:
            self.__params.velocity_perturbation_kwargs = deepcopy(
                self.__config.velocity_perturbation_kwargs
            )

        if self.__config.mask_kwargs is None:
            self.__params.mask_kwargs = dict()
        else:
            self.__params.mask_kwargs = deepcopy(self.__config.mask_kwargs)

        print("Inputs validated and initialized successfully.")
Validate the inputs to ensure consistency and correct shapes.
pysteps/nowcasts/steps.py