    def __apply_precipitation_mask(self, precip_forecast, j, state, params):
        """
        Apply the precipitation mask to prevent new precipitation from generating
        in areas where it was not observed.
        """
        precip_forecast_min = precip_forecast.min()

        if params["mask_method"] == "incremental":
            precip_forecast = (
                precip_forecast_min
                + (precip_forecast - precip_forecast_min) * state["mask_prec"][j]
            )
            mask_prec_ = precip_forecast > precip_forecast_min
        else:
            mask_prec_ = state["mask_prec"]

        # Set to min value outside the mask
        precip_forecast[~mask_prec_] = precip_forecast_min

        return precip_forecast
Apply the precipitation mask to prevent new precipitation from generating
in areas where it was not observed.
pysteps/nowcasts/steps.py