Ejemplo n.º 1
0
    def setUp(self):
        """Set up temperature and wind speed cubes for testing."""
        # Note: test_temperature_realizations_data_check produces ~0.5K
        # different results when the temperature forecast cube is float32
        # below. A bug?
        data = (np.tile(np.linspace(-45.0, 45.0, 9), 3).reshape(3, 3, 3) +
                273.15)
        data[0] -= 2
        data[1] += 2
        data[2] += 4
        data = data.astype(np.float32)
        self.current_temperature_forecast_cube = set_up_variable_cube(
            data, units="Kelvin", realizations=[0, 1, 2])

        self.historic_temperature_forecast_cube = (_create_historic_forecasts(
            self.current_temperature_forecast_cube))

        self.temperature_truth_cube = (_create_truth(
            self.current_temperature_forecast_cube))

        data = np.tile(np.linspace(0, 60, 9), 3).reshape(3, 3, 3)
        data[1] += 2
        data[2] += 4
        data = data.astype(np.float32)
        self.current_wind_speed_forecast_cube = set_up_variable_cube(
            data, name="wind_speed", units="m s-1", realizations=[0, 1, 2])

        self.historic_wind_speed_forecast_cube = (_create_historic_forecasts(
            self.current_wind_speed_forecast_cube))

        self.wind_speed_truth_cube = (_create_truth(
            self.current_wind_speed_forecast_cube))
Ejemplo n.º 2
0
    def setUp(self):
        """Set up multiple cubes for testing."""
        self.current_temperature_forecast_cube = (
            add_forecast_reference_time_and_forecast_period(
                set_up_temperature_cube()))

        self.historic_temperature_forecast_cube = (_create_historic_forecasts(
            self.current_temperature_forecast_cube))

        self.temperature_truth_cube = (_create_truth(
            self.current_temperature_forecast_cube))

        self.current_wind_speed_forecast_cube = (
            add_forecast_reference_time_and_forecast_period(
                set_up_wind_speed_cube()))

        self.historic_wind_speed_forecast_cube = (_create_historic_forecasts(
            self.current_wind_speed_forecast_cube))

        self.wind_speed_truth_cube = (_create_truth(
            self.current_wind_speed_forecast_cube))
Ejemplo n.º 3
0
    def setUp(self):
        """Set up temperature and wind speed cubes for testing."""
        # Note: test_temperature_realizations_data_check produces ~0.5K
        # different results when the temperature forecast cube is float32
        # below. A bug?
        self.current_temperature_forecast_cube = (
            add_forecast_reference_time_and_forecast_period(
                set_up_temperature_cube()))

        self.historic_temperature_forecast_cube = (_create_historic_forecasts(
            self.current_temperature_forecast_cube))

        self.temperature_truth_cube = (_create_truth(
            self.current_temperature_forecast_cube))

        self.current_wind_speed_forecast_cube = (
            add_forecast_reference_time_and_forecast_period(
                set_up_wind_speed_cube()))

        self.historic_wind_speed_forecast_cube = (_create_historic_forecasts(
            self.current_wind_speed_forecast_cube))

        self.wind_speed_truth_cube = (_create_truth(
            self.current_wind_speed_forecast_cube))