Time Average

Description

Compute a basic time average of the base on a characteristic integration time using an online algorithm.

Construction

import antares
myt = antares.Treatment('onlinetimeaveraging')

Parameters

  • base: antares.Base

    The input base to be averaged.

  • nb_ite_averaging: int or in_attr, default= ‘in_attr’

    Number of iterations over which averaging is done. If in_attr, then each zone of the base must have an attribute nb_averaging_ite.

  • extracts_step: int, default= 1

    The number of time iterations between two instants of the base.

  • memory_mode: bool, default= False

    If True, the initial base is deleted on the fly to limit memory usage.

Preconditions

Zones may contain multiple instants and shared variables.

Extract timestep is assumed constant.

Postconditions

The output base contains one instant ‘average’ and the shared instant from input base.

Example

The following example shows a time averaging on the first 1000 iterations with an extracts step of 10.

import antares
myt = antares.Treatment('onlinetimeaveraging')
myt['base'] = base
myt['nb_ite_averaging'] = 1000
myt['extracts_step'] = 10
myt['memory_mode'] = False
base_avg = myt.execute()

Warning

The Treatment keep in memory the number of iteration accumulated

Main functions

class antares.treatment.TreatmentOnlineTimeAveraging.TreatmentOnlineTimeAveraging
execute()

Execute the treatment.

Returns

the base containing the results

Return type

antares.Base