Skip to content

forecast⚓︎

Forecast support for assimilation ensembles.

Running the forward simulator and turning its raw output into pred_data is ensemble work, not loop work: it reads sim, enX, data_df and the compression machinery, and it writes pred_data. It lived on pipt.loop.assimilation.Assimilate only because that class historically drove every iteration.

:class:AssimilationScheme expects its ensemble collaborator to expose a public :meth:ForecastMixin.forecast, so the forecast lives here and the loop delegates to it. Mixed into :class:pipt.ensembles.AssimilationEnsemble.

ForecastMixin ⚓︎

Forward simulation and predicted-data preparation.

save_folder: str | None ⚓︎

Folder for run artifacts, or None when saving is disabled.

save_folder is accepted too; the config boundary maps it to savefolder. Reading this creates nothing; :meth:_save_path makes the folder when something is about to be written into it.

forecast(enX) ⚓︎

Run forecast simulations and prepare predicted data for analysis.

Parameters:

Name Type Description Default
enX

The state to predict on. Passed in rather than read off the ensemble, so a scheme can forecast a trial state without first parking it somewhere for this method to find.

required

sim_to_pred_data(pred) ⚓︎

Filter the simulator output to match the structure of the predicted data expected.

Parameters:

Name Type Description Default
pred Any

The raw output from the simulator, which may be a list of DataFrames or a single DataFrame.

required

Returns:

Type Description
Any

The processed predicted data, structured to match the ensemble's expected format for analysis.

treat_modeling_error() ⚓︎

Shift every coarser level so each row's ensemble mean matches the finest level's.

OutlierMixin ⚓︎

Replacement of outlier ensemble members.

Ensemble work, like the forecast: it rewrites pred_data, sim_data and the state matrix in place. Called between forecast and scoring, so the replacement feeds into the misfit the scheme sees.

remove_outliers(enX) ⚓︎

Replace outlier ensemble members with resampled non-outliers.

Returns the state with outliers resampled -- the same object when there is nothing to replace. Returned rather than written back, because the caller owns the state being forecast.