# calculation of certain parameters using PV filter for all the snapshots(dump file)

**URL:** https://discourse.paraview.org/t/calculation-of-certain-parameters-using-pv-filter-for-all-the-snapshots-dump-file/7540
**Category:** ParaView Support
**Tags:** python
**Created:** [July 3, 2021, 10:56am UTC](https://discourse.paraview.org/t/calculation-of-certain-parameters-using-pv-filter-for-all-the-snapshots-dump-file/7540 "2021-07-03T10:56:30Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![deepakpawar2310](https://discourse.paraview.org/user_avatar/discourse.paraview.org/deepakpawar2310/32/4602_2.png) [@deepakpawar2310](https://discourse.paraview.org/u/deepakpawar2310)
#### Post date: [July 3, 2021, 10:56am UTC](https://discourse.paraview.org/t/calculation-of-certain-parameters-using-pv-filter-for-all-the-snapshots-dump-file/7540/1 "2021-07-03T10:56:30Z")

</div>

(1) I need to calculate specific parameters using the PV filter (external ) to a particular snapshot  
(dump file),

(2) store that variable, and

(3) use the same filter for subsequent snapshots (for example, I have 400 snapshots/dump data).  
Are there any inbuilt commands or functions for this?

> Similarly, I have over 500 dump files. As a result, I’m not sure how to execute it in one approach.

Any help/comments will be highly appreciated!

Thank you

---

<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: [July 3, 2021, 11:03am UTC](https://discourse.paraview.org/t/calculation-of-certain-parameters-using-pv-filter-for-all-the-snapshots-dump-file/7540/2 "2021-07-03T11:03:54Z")

</div>

Use a python script ?

---

<div class="post-metadata">

### Author: ![deepakpawar2310](https://discourse.paraview.org/user_avatar/discourse.paraview.org/deepakpawar2310/32/4602_2.png) [@deepakpawar2310](https://discourse.paraview.org/u/deepakpawar2310)
#### Post date: [July 3, 2021, 11:26am UTC](https://discourse.paraview.org/t/calculation-of-certain-parameters-using-pv-filter-for-all-the-snapshots-dump-file/7540/3 "2021-07-03T11:26:23Z")

</div>

Yes, it appears to be doable.  
(1) How python script will load the vtk file automatically

(2) After that, it will most likely be necessary to run the PV filter and save the variable.

(3) Then need to upload the following vtk file

(4) After that, repeat the procedure with the next vtk file.  
1-2-3

And how can run the python script to accomplish the task above?  
I’m using Ubuntu 16.04

---

<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: [July 3, 2021, 2:07pm UTC](https://discourse.paraview.org/t/calculation-of-certain-parameters-using-pv-filter-for-all-the-snapshots-dump-file/7540/4 "2021-07-03T14:07:00Z")

</div>

> [@deepakpawar2310](#):
>
> (1) How python script will load the vtk file automatically

`OpenDataFile()`

> [@](#):
>
> (2) After that, it will most likely be necessary to run the PV filter and save the variable.

`YourFilter()`

> [@](#):
>
> (3) Then need to upload the following vtk file

`SaveData()`?

> [@](#):
>
> (4) After that, repeat the procedure with the next vtk file.  
> 1-2-3

`for` loop ?

You can try using the python trace to understand how to write a pvpython script

---

<div class="post-metadata">

### Author: ![wascott](https://discourse.paraview.org/letter_avatar_proxy/v4/letter/w/8e8cbc/32.png) [@wascott](https://discourse.paraview.org/u/wascott)
#### Post date: [July 6, 2021, 5:05pm UTC](https://discourse.paraview.org/t/calculation-of-certain-parameters-using-pv-filter-for-all-the-snapshots-dump-file/7540/5 "2021-07-06T17:05:19Z")

</div>

One good resource is the Sandia tutorials, located here: [https://www.paraview.org/Wiki/SNL\_ParaView\_Tutorials](https://www.paraview.org/Wiki/SNL_ParaView_Tutorials). You want to go through the Paraview and Python, and the PvPython and PvBatch tutorials.
