Exctracting time history of a spatial point in pvpython

Hello All.

I would like to extract time series data for a single point in my domain. Right now, I have only been able to come up with a workflow that accesses one time-history value at a time. I send the desired time step to this script, extract the entire set of data to a csv, then extract the pressure from the nodeID I’m interested from the csv in a different python script. I do this whole process for every time step. Is there a more efficient way to extract the time-history of a single point?

First script that accepts a time step and dumps the entire data set

from paraview.simple import *
from paraview.numpy_support import vtk_to_numpy
import vtk.numpy_interface.dataset_adapter as dsa
import sys
s = ExodusIIReader(FileName='first_cfl_100/aoa_19.500000/results/S809_AoA0_SST_Fnew.e')
d = CreateWriter('./out.csv', s)
d.FieldAssociation = "Points"
d = CreateWriter('./out.csv', s)

Second script that extracts the pressure associated with the point I’m interested in

import pandas as pd
import numpy as np
dat = pd.read_csv('./out0.csv')
dat = dat[dat.GlobalNodeId==1531]

Yes! You can do this quite easily using the Find Data dialog in the ParaView desktop application. First, set the first popup menu to “Point(s)” from the data set you have loaded. Then, set the query to “Global Id” “is” 1531, as in your example. Next, click the button that says “Run Selection Query”. Lastly, click the button in the bottom row that says “Plot Selection Over Time”. Go to the Pipeline Browser and click the Apply button. A graph will appear showing you the data plotted over time. With the PlotSelectionOverTime filter selected in the browser, go to File -> Save Data and save out a .csv file. It will contain data values at the selected point over all time steps.

How would you do this if you have a long list of global id’s that don’t have order such that one could use ranges?

You can use the Find Data dialog and set the query to “Global Id” “is one of” and then provide a comma-separated list of global ids.

I did try that, thank you. When I did it with a large number of values it would extract the data but when I went to extract time steps from a remote connection it made paraview crash. (maybe the id’s are changing in time (although I am using global Ids, so I will have to check that)

also, I had use the selection tool and then export the list from the spreadsheet view and then transposed the csv for the global id column and saved to csv when I then copied and pasted from text editor.

I figured there would be an easier way, usually paraview is good at there being an easier way.
Thank you

I was able to get this to work properly using the method I describe above.