How to access "Row Data" in Python?

Hello all,

So this is an embarrassingly simple question, but I’ve Googled a lot, and am throwing in the towel and asking for directions.

I’m writing a pvbatch script that reads a cvs/ssv file, which works fine. But when viewed in ParaView proper, the spreadsheet view calls the data “Row Data”. And for the life of me, I can’t figure out how to access “Row Data” in the Python interface. There are functions for “Cell Data” and “Point Data” and “Field Data”, but no “Row Data” (nor a couple others that the Spreadsheet offers).

So I’m loading the data as follows:

frameinfo = CSVReader(registrationName='frame-info', FileName=['.../frame-info'])
frameinfo.FieldDelimiterCharacters = ' '
frameinfo.MergeConsecutiveDelimiters = 1                                                             
frameinfo.UpdatePipeline()

But now what? I’ve used dir() and help() in the Python shell, but again they only refer to cell/point/field data.

I did try this:

>>> calc=Calculator(Input=frameinfo)
>>> calc.Function = 'Rotation(rad)'
>>> calc.ResultArrayName='rot'
>>> calc.UpdatePipeline()

And that seems to produce the data, but once again I don’t know how to access the “calc” data.

Thanks in advance,
Bill

You are looking for servermanager.Fetch(calc)

Hello Mathieu,

Yes! Using servermanager.Fetch() worked for both “calc” and the original “frameinfo”!

Thank you!

Followup: any chance you can give a one or two sentence explanation for what that does / why that’s necessary?

Thanks again!
Bill

Hi Bill,

The scripting layer you are working with accesses the ParaView layer of data management. That’s what takes care of setting up pipelines and coordinating them across client and any existing server processes. The actual data is available on the server side only by default. To access it in the scripting environment in which you are working, you need to explicitly bring over a copy onto the client side, which is what servermanager.Fetch does. Once you have copied the data over, then you can work with it.

2 Likes

Awesome, thanks for the explanation Cory!
Bill