CSV I/O

class rtctools.simulation.csv_mixin.CSVMixin

Bases: rtctools.simulation.simulation_problem.SimulationProblem

Adds reading and writing of CSV timeseries and parameters to your simulation problem.

During preprocessing, files named timeseries_import.csv, initial_state.csv, and parameters.csv are read from the input subfolder.

During postprocessing, a file named timeseries_export.csv is written to the output subfolder.

In ensemble mode, a file named ensemble.csv is read from the input folder. This file contains two columns. The first column gives the name of the ensemble member, and the second column its probability. Furthermore, the other XML files appear one level deeper inside the filesystem hierarchy, inside subfolders with the names of the ensemble members.

Variables:
  • csv_delimiter – Column delimiter used in CSV files. Default is ,.
  • csv_validate_timeseries – Check consistency of timeseries. Default is True.
timeseries_at(self, variable, t)

Return the value of a time series at the given time.

Parameters:
  • variable – Variable name.
  • t – Time.
Returns:

The interpolated value of the time series.

Raises:

KeyError