GetProperty ?

Hello,

I want to read a variable of the source to then use in a python script.
How can I do that?
GetProperty does not work.

Thank you,
Mariana

@cory.quammen : could we somehow prevent uninformed users to post here ? Do we need to change the Tips and Tricks name ?

@Mariana_Rodriguez : what do you mean by “a variable” ? do you mean data from your dataset or a property from the source ?

I mean to read a property from the source. For instance, read the vector of pressures of my .e file in a python script.

Thank you.

by “read”, do you mean directly accessing the data in the python script to process it manually ?

Yes. Exactly that.

I am trying to do this because I want to display in the view of Paraview the maximum of pressure and temperature at each time step with a python annotation filter.

Is there a simpler way to do this?

Thank you

It gets tricky to get the array values out because of the client server and parallel nature we have for scalable data. See, the client doesn’t have direct access to the arrays generally. There are tricks like servermanager.Fetch to copy an array to the client, object.CellData.GetArray(“name”).GetRange() to get the summary you see in the Information tab on the client, and ye olde python programmable filter which operates on the server and can thus inspect data directly where it lives and produce something there that you can label.

Those can be a pain, and fortunately, in this particular situation there is a workaround.
Apply the python annotation filter with an expression of “max(arrayname)” and it should do what you want.

1 Like