# Time Averaged global variable

**URL:** https://discourse.paraview.org/t/time-averaged-global-variable/10464
**Category:** ParaView Support
**Created:** [October 7, 2022, 8:23pm UTC](https://discourse.paraview.org/t/time-averaged-global-variable/10464 "2022-10-07T20:23:14Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![phismith](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/p/a9adbd/32.png) [@phismith](https://discourse.paraview.org/u/phismith)
#### Post date: [October 7, 2022, 8:23pm UTC](https://discourse.paraview.org/t/time-averaged-global-variable/10464/1 "2022-10-07T20:23:14Z")

</div>

I need to calculate a time averaged global variable. The temporal statistics filter doesn’t include global variables in its results.

Here is what I am thinking:  
My best guess is something along these lines:

1. Python calculator filter to create a new point data variable from the global variable of interest, at any given timestep (This is where I’m stuck – The syntax is incorrectt in the documentation, and should be inputs[0].FieldData[‘nsteps’][time\_index] \* displ), but the data still dose not propagate through and no new variable appears.
2. Probe location (so that I’m not processing an unnecessary amount of data)
3. Temporal statistics filter on the probe to display time-averaged values of point data

I was also thinking of using the programable filter to create the new point data variable, but I can’t seem to produce the data that I need.

Thanks for nay help you may be able to give,

-Phil

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [October 10, 2022, 2:31am UTC](https://discourse.paraview.org/t/time-averaged-global-variable/10464/2 "2022-10-10T02:31:45Z")

</div>

Hi @phismith

Maybe PlotGlobalVariablesOverTime would help you there ?

Best,

---

<div class="post-metadata">

### Author: ![phismith](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/p/a9adbd/32.png) [@phismith](https://discourse.paraview.org/u/phismith)
#### Post date: [October 10, 2022, 1:03pm UTC](https://discourse.paraview.org/t/time-averaged-global-variable/10464/3 "2022-10-10T13:03:56Z")

</div>

HI Mathieu,  
Yes this may be a solution. let me look into it a bit further. Thanks!

---

<div class="post-metadata">

### Author: ![phismith](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/p/a9adbd/32.png) [@phismith](https://discourse.paraview.org/u/phismith)
#### Post date: [October 10, 2022, 3:14pm UTC](https://discourse.paraview.org/t/time-averaged-global-variable/10464/4 "2022-10-10T15:14:53Z")

</div>

This works to an extent, but suppose I want to annotate the average of those values from the result of the filter? How would I go about doing that? The only way I can get the average, that I know of, is to dump the row data into a table and then compute the average. is there a better way? Perhaps by using the Python Annotation filter on the results of the table?

Thanks for your help,

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [October 11, 2022, 12:51am UTC](https://discourse.paraview.org/t/time-averaged-global-variable/10464/5 "2022-10-11T00:51:49Z")

</div>

PythonAnnotation or ProgrammableAnnotation should work
