veriflow.datamodel.main#

Module with the veriflow internal DataModel.

Classes

InputDataset(data)

Class containing simulations and observations.

OutputDataset(input_dataset)

The internal output dataset.

class veriflow.datamodel.main.InputDataset(data)[source]#

Class containing simulations and observations.

InputDataset has functionality to retrieve verification pairs for computation of scores per pair. It is the central object used in the verification pipeline.

Parameters:

data (Iterable[Dataset])

static map_historical_into_forecast_space(obs, sim)[source]#

Transform array of historical data into forecast structure.

Given an observation array with dimension ‘time’ and a simulation array with dimensions ‘forecast_reference_time’ and ‘lead_time’, project the observed values onto the simulation array.

This method is called at runtime when the pipeline starts a score computation on forecast data. On the fly, the observation array is mapped to the forecast structure, so data are aligned along the same dimensions.

Parameters:
Return type:

DataArray

get_pair(verification_pair)[source]#

Return observations and simulations for a given verification pair.

Selects verification_pair.variable from each source’s dataset and returns the resulting DataArrays. This method is called by the verification pipeline at runtime to retrieve the correct data for one of the configured verification pairs.

Parameters:

verification_pair (VerificationPair)

Return type:

tuple[DataArray, DataArray]

get_thresholds_array(variable)[source]#

Get the thresholds array for a given variable from the input dataset.

Parameters:

variable (str)

Return type:

DataArray

class veriflow.datamodel.main.OutputDataset(input_dataset)[source]#

The internal output dataset.

Contains input data, results from verification scores and metadata.

Parameters:

input_dataset (InputDataset)

add_score(score, verification_pair)[source]#

Add a score results to the datastore.

Parameters:
Return type:

None

get(verification_pair, *, include_input_data=True)[source]#

Get the output dataset for a given verification pair.

Parameters:
  • verification_pair (VerificationPair)

  • include_input_data (bool)

Return type:

Dataset

property verification_pairs: list[VerificationPair]#

Return the list of verification pairs that are stored in the output dataset.