diff --git a/CHANGELOG.md b/CHANGELOG.md index 1174b3f..f33a333 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Changed + +- Pass down number of ensembles from configurations to `ProbabilisticAdvection`. This gives a roughly 3x speedup in the no ensembles case [!12](https://github.com/dmidk/sunflow/pull/12), @JoachimKoenigslieb + ## [v1.1.0] ### Added diff --git a/sunflow/forecast.py b/sunflow/forecast.py index 27eadf3..3abe325 100644 --- a/sunflow/forecast.py +++ b/sunflow/forecast.py @@ -62,9 +62,7 @@ def preprocess_data( def simple_advection_forecast( - ratio_data: np.ndarray, - motion_field: np.ndarray, - n_steps: int, + ratio_data: np.ndarray, motion_field: np.ndarray, n_steps: int, ens_members: int ) -> np.ndarray: """Run a deterministic advection forecast on solar irradiance ratios. @@ -90,6 +88,7 @@ def simple_advection_forecast( alpha=0.0, # No Gaussian noise on motion field norm beta=0.0, # No von Mises noise on motion field angle return_motion_field=False, + ens_members=ens_members, ) # Run probabilistic advection using the correct method name forecast = pa.maps_forecast(n_steps, ratio_data, motion_field) diff --git a/sunflow/main.py b/sunflow/main.py index e7402b2..5ac6f63 100644 --- a/sunflow/main.py +++ b/sunflow/main.py @@ -273,7 +273,10 @@ def run_nowcast( # Simple forecast (ratio forecast) ratio_forecast = simple_advection_forecast( - ratio_data, motion_field, nowcast_config.future_steps + ratio_data, + motion_field, + nowcast_config.future_steps, + ens_members=nowcast_config.ens_members, ) # Generate previous day time steps for clearsky lookup