PythonAnnotation doesn't allow formatting of Cell or Point variables, documentation is confusing
On Fri, Sep 9, 2016 at 1:28 PM, Dennis Conklin email@example.com wrote:
Okay, thanks for that explanation. I have some comments.
The documentation is very confusing and/or incomplete and misleading. Hovering over the expression box produces a popup which makes it seem as though t-index is the way to access things. No real distinction is made between Field, Cell and Point variables
What?? The expression is added to the row data, which I have never seen or used before. And this is PythonAnnotation, not PythonCalculator - the object is to display it on the screen. So why can I only format Field data on the screen? "Vertical Force: %g" %REACTZ_901 works and outputs formatted, labelled text on screen because it is a Field Variable "FBFORCE1: %g" %FBFORCE prints (error) to the screen because it is a cell variable. What is the point of including cell and point variables into an Annotation filter in a way which makes it impossible to format the annotation? I'm not able to think of a situation in which this is useful. Perhaps I'm not creative enough.
I couldn't find an explanation of all of this anywhere in the documentation, so my title for this thread stands. I think the documentation might be expanded a little. And I would suggest a new name of PythonFieldVariableAnnotation. I have used it to annotate Field Variables, but I don't know how I can use unlabeled, unformatted Cell or Point data annotations to add value to a picture or animation.
Re-reading this it seems harsher than I intended. Just my disappointment at not being able to Annotate Cell Values. I appreciate your support and explanations, I just would like to capture this information somewhere in the documentation.
-----Original Message----- From: Utkarsh Ayachit [mailto:firstname.lastname@example.org] Sent: Friday, September 09, 2016 10:54 AM To: Dennis Conklin email@example.com Cc: Paraview (firstname.lastname@example.org) email@example.com Subject: [EXT] Re: [Paraview] Is the PythonAnnotation documentation obsolete?
Python Annotation only works with what's available in the current timestep. If you look at the "Field Data" in the SpreadSheet view, you'll see that the Exodus reader puts out an array with values for all timesteps for variables like REACTZ_901 and hence you can offset into it using t_index irrespective of which timestep you are at.
For Point/Cell data, you have access to the field values for all points/cells for the current timestep only. Thus, t_index doesn't make much sense for those cases. For understanding how indexing works when dealing with multblock datasets, I'd recommend reading Berk's blog post .
Hope that helps. Utkarsh
On Thu, Sep 8, 2016 at 2:32 PM, Dennis Conklin firstname.lastname@example.org wrote:
I have tried to use PythonAnnotation but it only seems to work properly with FieldVariables.
So for instance, with field variables of REACTZ_901 and REACTZ_902, the following expressions work and display the values as expected
REACTZ_901 displays array of values for all timesteps
REACTZ_901[t_index] displays single number (no brackets)
Int(REACTZ_901[t_index] displays truncated integer value (no brackets)
To try to work with CellData I have made an ExtractSelection of a single Cell. I have a Cell variable of FBFORCE1
I want to use PythonAnnotation to print out the FBFORCE1 for that cell over time (with formatting)
FBFORCE1 [VTKArray([154.2])] shouldn’t this have a value for each timestep?
FBFORCE1 [ 154.2]
2nd try – Ran PythonAnnotation on an entire file – many cells, with following results
FBFORCE1 VTKArray([ value1, value2 ………value_final]) – seems like 1 value per timestep (shouldn’t there be array of # of cells by # of timesteps?
FBFORCE1[t_index] [131.4] - again- should be array of # of cells? Which cell is this
So it seems that Field Variables are numpy-friendly in that formatting works with them, while Cell Variables are still VTK Array variables and not numpy-friendly.
It’s possible that I am completely missing something here, but it seems Cell Variables are not very useable in the PythonAnnotation.
Is there a way for me to Annotate with individual cell values, either by running PythonAnnotation on a single cell, or by manipulating the variables which are available in the filter?
At this point I don’t know why Cell and Point Variables are included in the filter since I can only figure out how to use Field Variables
Thanks for any hints