[Paraview] Is the PythonAnnotation documentation obsolete?

Utkarsh Ayachit utkarsh.ayachit at kitware.com
Fri Sep 9 10:53:44 EDT 2016


Dennis,

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 [1].

Hope that helps.
Utkarsh

[1] https://blog.kitware.com/improved-vtk-numpy-integration-part-5/

On Thu, Sep 8, 2016 at 2:32 PM, Dennis Conklin
<dennis_conklin at goodyear.com> wrote:
> All,
>
>
>
> 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)                          (error)
>
> 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[t_index]                       (error)
>
> FBFORCE1[0]                                  [ 154.2]
>
> FBFORCE1[1]                                  (error)
>
> Int(FBFORCE1)                                (error)
>
> Int(FBFORCE1[0])                           (error)
>
>
>
> 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
>
> FBFORCE1[t_index][0]                   (error)
>
> Int(FBFORCE1[t_index])                 error)
>
>
>
> 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
>
>
>
> Dennis
>
>
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Please keep messages on-topic and check the ParaView Wiki at:
> http://paraview.org/Wiki/ParaView
>
> Search the list archives at: http://markmail.org/search/?q=ParaView
>
> Follow this link to subscribe/unsubscribe:
> http://public.kitware.com/mailman/listinfo/paraview
>


More information about the ParaView mailing list