run_functions_old
Functions
|
Prepare the input data for the model. |
Module Contents
- run_functions_old.prepare_input(uarr, input_config, output_metadata, split_year=2019, stage=1)
Prepare the input data for the model.
Get the training data from the input NetCDF dataset as numpy arrays and concatenate them along the time dimension.
- Parameters:
uarr (unox.uarray) – The dataset of the input NetCDF file.
input_config (str or dict) – Path to the input configuration JSON file or a dictionary containing the configuration.
output_metadata (dict) – The dictionary of metadata describing the output of a model run.
split_year (int, optional) – The year at which to split the training and validation data. Defaults to 2019.
stage (int, optional) – The stage of the data to plot (1 or 2).
- Returns:
xtrain (np.ndarray) – Concatenated training input features.
ytrain (np.ndarray) – Concatenated training target variables.
output_metadata (dict) – The dictionary of metadata describing the output of a model run with values added for train_years and unet_build_shape.