aurel.time

Variable calculation and scalar estimation over time for the Aurel package.

This module provides a function to calculate variables over time series data and applying statistical estimation functions to 3D arrays.

aurel.time.over_time(data, fd, vars=[], estimates=[], verbose=True, veryverbose=False, **rel_kwargs)[source]

Calculate variables from the data and store them in the data dictionary.

This function processes time series data by creating AurelCore instances for each time step, calculating specified variables, and optionally applying estimation functions to 3D arrays.

Parameters:
  • data (dict) – Dictionary containing time series data. Must include an ‘it’ key with iteration information. This function will add calculated variables to this dictionary.

  • fd (FiniteDifference) – Finite difference class used to initialize AurelCore instances.

  • vars (list of str or dict, optional) –

    List of variable names to calculate. These variables will be computed using the AurelCore instance at each time step. Elements can be:

    • str: Names of predefined variables from core.descriptions

    • dict: Custom variable definitions with string keys (variable names) and functions that take an AurelCore instance and return the variable value.

    Default is an empty list, no variable calculations are performed.

  • estimates (list of str or dict, optional) –

    List containing estimation functions to apply to all 3D scalar arrays. Elements can be:

    • str: Names of predefined functions from est_functions (‘max’, ‘mean’, ‘median’, ‘min’, ‘OD’, ‘UD’, …)

    • dict: Custom estimation functions with string keys (function names) and functions that take a scalar 3D array of shape (fd.Nx, fd.Ny, fd.Nz) and return a scalar value.

    Default is an empty list (no estimation applied).

  • verbose (bool, optional) – If True, prints debug information about the calculation process.

  • veryverbose (bool, optional) – If True, provides more detailed debug information. Defaults to False.

  • **rel_kwargs (dict, optional) –

    Additional parameters passed to AurelCore initialization, such as:

    • Lambda : float, cosmological constant

    • tetrad_to_use : str, tetrad choice for Weyl calculations

Returns:

Updated data dictionary with calculated variables. If vars is provided, a new key is added containing a list of values for each time step. If estimates is provided, additional keys are added with format ‘{variable}_{estimation_func}’.

Return type:

dict

aurel.time.process_single_timestep(data, fd, vars, estimates, verbose, scalarkeys, rel_kwargs)[source]

Process a single time step for variable calculation and estimation.

This function creates an AurelCore instance for the specified time step, calculates requested variables, and applies estimation functions to 3D arrays if specified.

Parameters:
  • data (dict) – Dictionary containing variables of relevant iteration. The function will add calculated variables to this dictionary.

  • fd (FiniteDifference) – Finite difference class used to initialize AurelCore instances.

  • vars (list of str or dict) –

    List of variable names to calculate. These variables will be computed using the AurelCore instance at each time step. Elements can be:

    • str: Names of predefined variables from core.descriptions

    • dict: Custom variable definitions with string keys (variable names) and functions that take an AurelCore instance and return the variable value.

    If empty, no variable calculations are performed.

  • estimates (list of str or dict) –

    List containing estimation functions to apply to all 3D scalar arrays. Elements can be:

    • str: Names of predefined functions from est_functions

    • dict: Custom estimation functions with string keys (function names) and functions that take a 3D array of shape (fd.Nx, fd.Ny, fd.Nz) and return a scalar value.

    If empty, no estimation applied.

  • verbose (bool) – Passed to AurelCore for debug information and calculation process.

  • scalarkeys (list of str) – List of keys in data that contain 3D scalar arrays. If None, the function will determine these keys automatically.

  • rel_kwargs (dict) – Additional parameters passed to AurelCore initialization.

Returns:

  • dict – Updated data dictionary with calculated variables. If vars is provided, a new key is added containing a list of values for this time step. If estimates is provided, additional keys are added with format ‘{variable}_{estimation_func}’.

  • list of str – List of scalar keys if scalarkeys is None, otherwise returns None.

aurel.time.validate_estimation_function(func, func_name, fd, verbose=True)[source]

Validate that estimation function has correct signature and behaviour.

Parameters:
  • func (callable) – Function to validate

  • func_name (str) – Name of the function for error messages

  • fd (FiniteDifference) – Finite difference object to get grid dimensions

  • verbose (bool, optional) – If True, prints debug information about the validation process.

Returns:

True if function is valid

Return type:

bool

aurel.time.validate_variable_function(func, func_name, fd, verbose=True, veryverbose=False)[source]

Validate that variable function has correct signature and behaviour.

Parameters:
  • func (callable) – Function to validate

  • func_name (str) – Name of the function for error messages

  • fd (FiniteDifference) – Finite difference object to get grid dimensions

  • verbose (bool, optional) – If True, prints debug information about the validation process. Default Ture.

  • veryverbose (bool, optional) – If True, prints aurelcore verbose information. Default False.

Returns:

True if function is valid

Return type:

bool

estimates

The following estimation functions are available for use with the estimates parameter in aurel.over_time():

max, mean, median, min, sum, std, var, maxabs, minabs, meanabs, medianabs, sumabs, stdabs, varabs, OD, UD

[source: est_functions definition]