database

Abstraction for calibration databases.

This module the objects that are used in Tunax to describe a Database of observations used for a calibration. By obersvations (Obs), we refer to a set of time-series representing a physical experiment, a measurment or a simulation like a Large Eddy Simulation (LES) for example. These classes can be obtained by the prefix tunax.database. or directly by tunax..

class Obs(trajectory, case)[source]

Abstraction to represent an obersation.

The observations represent every elements of a database, each one represent a simulation or a measurement with their own time-series of variables and the physical case which is linked to them

Parameters:
  • trajectory (Trajectory) – cf. attribute.

  • case (Case) – cf. attribute.

trajectory

The time-series of the variables that represent this obervation.

Type:

Trajectory

case

The physical case that represent this observation.

Type:

Case

Raises:

ValueError – If the time of trajectory is not build with constant time-steps.

Parameters:
  • trajectory (Trajectory)

  • case (Case)

classmethod from_files(nc_path, yaml_path, var_names)[source]

Create an instance from a netcdf and a yaml files.

This class method build a trajectory from the .nc file nc_path, it build the physical parameters from the configuration file yaml_path. var_names is used to do the link between Tunax name convention and the one from the used database.

Parameters:
  • nc_path (str) – Path of the netcdf file that contains the time-series of the observation trajectory. The file should contains at least the three dimensions zr zw and time. The time-series can be created with default values if they are not present in the file. Otherwise, they must have the good dimensions described in Trajectory.

  • yaml_path (str) – Path of the yaml file that contains the parameters and forcing that describe the observation. The parameters should be float numbers and directly accessible from the root of the file with a key. Only the parameters that are described in Case will be takend in account.

  • var_names (Dict[str, str]) – Link between the convention names in Tunax and the ones in the database. The keys are the Tunax names and the values are the names in the database. It works for variables of the Trajectory and fornthe parameters of Case. It must at least contains entries for zr zw and time

Returns:

obs – An object that represent these files as an observation.

Return type:

Obs

class Database(observations)[source]

Represent a set of several observations that form a database.

Parameters:

observations (List[Obs]) – cf. attribute.

observations

A list of several observations with potentially various forcings, geometry and time configuration.

Type:

List[Obs]