This is the object to be used when defining time constraints for a simulation.

class pyconturb.TimeConstraint(data=None, index: Axes | None = None, columns: Axes | None = None, dtype: Dtype | None = None, copy: bool | None = None)[source]

DataFrame-style object that specfies time constraints for simulation.

The TimeConstraint object is essentially a pandas.DataFrame with a particular structure and some added useful methods. The first four rows correspond to k, x, y and z. The remaining rows are time steps. Each column corresponds to a different location/turbulence component. The index must be of the form ['k', 'x', 'y', 'z', <float array of time steps>]. The columns need not have names.

The object can be pickled/saved using same methods as pandas. To reload, load a properly-formatted pandas.DataFrame using the usual methods and pass it into the object: e.g.,``TimeConstraint(pd.read_csv(path))``.

  • data (ndarray (structured or homogeneous), Iterable, dict, or DataFrame.) – Dict can contain Series, arrays, constants, or list-like objects.

  • index (Index or array-like) – Index to use for resulting frame. Will default to RangeIndex if no indexing information part of input data and no index provided

  • columns (Index or array-like) – Column labels to use for resulting frame. Will default to RangeIndex (0, 1, 2, …, n) if no column labels are provided

  • dtype (dtype, default None) – Data type to force. Only a single dtype is allowed. If None, infer

  • copy (boolean, default False) – Copy data from inputs. Only affects DataFrame / 2d ndarray input

from_con_data(con_data=None, con_spat_df=None, con_turb_df=None)[source]

Create TimeConstraint from old-style con_data dictionary


Return the total time of the constraining data


Return the numer of time steps in constraining data


Return a DataFrame with the spatial information


Return a DataFrame with the spatial information