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:
- Raises:
ValueError – If the
timeoftrajectoryis 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
.ncfilenc_path, it build the physical parameters from the configuration fileyaml_path.var_namesis 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
zrzwandtime. 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 inTrajectory.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
Casewill 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
Trajectoryand fornthe parameters ofCase. It must at least contains entries forzrzwandtime
- Returns:
obs – An object that represent these files as an observation.
- Return type: