Advanced State Management: Difference between revisions

From KitwarePublic
Jump to navigationJump to search
(New page: =Introduction= This tutorial covers different types of state management. ==Save State / Load State== ParaView state files are saved by selecting the menu option File → Save State. The...)
 
 
(10 intermediate revisions by the same user not shown)
Line 4: Line 4:
==Save State / Load State==
==Save State / Load State==


ParaView state files are saved by selecting the menu option File → Save State.  The pipeline, orientation of the data set, and all view windows are saved.  Select File → Load State to retrieve to open a saved ParaView state file.
ParaView state files are saved by selecting the menu option File → Save State.  These files can be saved as .pvsm files (xml) or .py files (python).  The pipeline, orientation of the data set, and all view windows are saved.  Select File → Load State to open a saved ParaView state file.


==Save Data==


This feature will save the data output from the selected source/filter.  The Save Data feature is selected from the main menu: File → Save Data.  The data type is whatever you chose when you save the data.  If a data type is missing, it probably means you are trying to output data that is not supported by this dataset format.  For example, you need to have surface data, as trianges, to output .stl files. 


:Save Data can be used to create .csv files of your data.  .csv files can be read into spreadsheets and other programs.
:Save Data can be used to create .stl files.  .stl files are often used for additive manufacturing, or animation programs.  Run filters '''Extract Surface''' then '''Triangulate''' before Saving Data.
:Save Data can be used to create files Houdini can ingest.  These are .geo files.  Again, run filters '''Extract Surface''' then '''Triangulate''' before Saving Data.


==Save Data and Save Geometry==


ParaView offers two features to manage the complexity of your data sets – Save Data and Save Geometry. 
==Export Scene==


This feature will save whatever is in the viewport to a file.  The Export Scene feature is selected from the main menu: File → Export Scene.  Again, the data type is whatever you chose when you export scene. 


===Save Data===
:Export Scene can be used to create .webgl files of what is displayed in the viewport.  A .html file will be written out, which you can load in a web browser.  This format allows users to create interactive data products that anyone can load in a web browser.
:Export Scene can be used to create .pdf files of what is displayed in the viewport.


The Save Data feature is selected from the main menu: File → Save Data.  This feature will save the data output from the selected source/filter.  The data type is the same as that produced by the source/filter.  For example, the data can be an unstructured grid, image data, etc… 


In the example below we have created a simple pipeline using the can.ex2 data set along with a Clip filter.  We will then select the Save Data option.
==Traces==


   
ParaView can now automatically save traces, or macros.  This means that you can start recording a trace, do something, stop recording a trace, and save this trace into a file. You can then use this trace file as input to the pvbatch program, or as a macro within ParaView.
[[Image:advanced_state_management_1.png|800px]]


Example:
*Start ParaView
*Tools/ Python Shell/ Trace/ Start Trace.
*Open disk_out_ref.exo, all variables on, Apply.
*Clip, Z normal, unselect show plane, Apply.
*Slice, unselect show plane, Apply.
*Color by Temp.
*In the Python Shell window, Stop Trace.
*Save trace.  Save as macro.  Call it '''Super-disk'''. 
*Edit/ Delete All


After selecting a name for the file that you wish to save the following widow will then appear:
Now, lets run the trace. 
*On the Macros toolbar, you will see Super-disk.  Click it.




[[Image:advanced_state_management_2.png]]
The Data Mode is a parameter on how the data is saved in the vtx files.  Appended is a good default; it means the data is written in binary format after the XML metadata in the file specified.  Other options include Binary and ASCII.  Binary means that the data is written in between tags of the XML metadata and ASCII means that all data is converted to ASCII strings – which is a very inefficient way of saving the data, but useful if you have a small data set and want to be able to read all the values in a text editor. 
The Ghost Level is only really valid for parallel data sets.  It saves extra layers of cells between files that are used to remove inter-file artifacts.  However, if all the data is in one process, then this is meaningless. 
For most users using the Appended mode along with a Ghost Level of 0 will suffice. 
To open our saved data set select File → Open and browse to the .pvd file which was created.  Also worth noting is that once the data has been saved the complexity of the data is significantly reduced.  In our example above, we applied a clip filter to the data set; therefore when we reload the saved data set you will notice that only the relevant half of the original data set has been restored, thus reducing the size of our data. 
===Save Geometry===
Save Geometry will save the geometry for the entire animation.  The saved file will have as many time steps as there were in the animation.  All the geometry in the view is saved, not merely the selected source.  The saved data is always polydata. 
To use this feature select File → Save Geometry.  To open our saved data set select File → Open and browse to the .pvd file which was created. 
==Record Test==
Record Test offers the user the ability to capture various commands and actions to be replayed at a later time.  To use this feature select the menu item Tools → Record Test.  You will be prompted to specify a file to save the recorded data to.  At this point any action taken will be recorded and may be later played back by selecting Tools → Play Test.  You can also run a test by using the –run-test=filename option when starting ParaView.
This feature is useful to group actions/commands that are common to a data set or a group of actions that can be applied to several different data sets.  The latter only makes sense when the recorded commands are compatible with the data set it is being played back on.  For example, if you were to record a series of actions specific to a data set with time steps, these actions may or may not be able to be played back on a different data set that has no time steps.
Another good use of this feature is to be able to record the steps needed to recreate bugs.  The recorded test file can then be sent to the ParaView developers.




=Acknowledgements=
=Acknowledgements=
Sandia is a multiprogram laboratory operated by Sandia Corporation, a Lockheed Martin Company, for the United States Department of Energy’s National Nuclear Security Administration under contract DE-AC04-94AL85000.
Sandia National Laboratories is a multi-mission laboratory managed and operated by National Technology and Engineering Solutions of Sandia, LLC., a wholly owned subsidiary of Honeywell International, Inc., for the U.S. Department of Energy’s National Nuclear Security Administration under contract DE-NA-0003525.

Latest revision as of 02:28, 10 November 2020

Introduction

This tutorial covers different types of state management.

Save State / Load State

ParaView state files are saved by selecting the menu option File → Save State. These files can be saved as .pvsm files (xml) or .py files (python). The pipeline, orientation of the data set, and all view windows are saved. Select File → Load State to open a saved ParaView state file.

Save Data

This feature will save the data output from the selected source/filter. The Save Data feature is selected from the main menu: File → Save Data. The data type is whatever you chose when you save the data. If a data type is missing, it probably means you are trying to output data that is not supported by this dataset format. For example, you need to have surface data, as trianges, to output .stl files.

Save Data can be used to create .csv files of your data. .csv files can be read into spreadsheets and other programs.
Save Data can be used to create .stl files. .stl files are often used for additive manufacturing, or animation programs. Run filters Extract Surface then Triangulate before Saving Data.
Save Data can be used to create files Houdini can ingest. These are .geo files. Again, run filters Extract Surface then Triangulate before Saving Data.


Export Scene

This feature will save whatever is in the viewport to a file. The Export Scene feature is selected from the main menu: File → Export Scene. Again, the data type is whatever you chose when you export scene.

Export Scene can be used to create .webgl files of what is displayed in the viewport. A .html file will be written out, which you can load in a web browser. This format allows users to create interactive data products that anyone can load in a web browser.
Export Scene can be used to create .pdf files of what is displayed in the viewport.


Traces

ParaView can now automatically save traces, or macros. This means that you can start recording a trace, do something, stop recording a trace, and save this trace into a file. You can then use this trace file as input to the pvbatch program, or as a macro within ParaView.

Example:

  • Start ParaView
  • Tools/ Python Shell/ Trace/ Start Trace.
  • Open disk_out_ref.exo, all variables on, Apply.
  • Clip, Z normal, unselect show plane, Apply.
  • Slice, unselect show plane, Apply.
  • Color by Temp.
  • In the Python Shell window, Stop Trace.
  • Save trace. Save as macro. Call it Super-disk.
  • Edit/ Delete All

Now, lets run the trace.

  • On the Macros toolbar, you will see Super-disk. Click it.



Acknowledgements

Sandia National Laboratories is a multi-mission laboratory managed and operated by National Technology and Engineering Solutions of Sandia, LLC., a wholly owned subsidiary of Honeywell International, Inc., for the U.S. Department of Energy’s National Nuclear Security Administration under contract DE-NA-0003525.