Advanced State Management: Difference between revisions

From KitwarePublic
Jump to navigationJump to search
No edit summary
 
(6 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 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==
==Save Data==


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


==Export==
: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.


The Export feature is selected from the main menu: File → Export.  Export will write the actual data from a graph or spreadsheet to a file.  For instance, if a spreadsheet is highlighted, you will write a .csv file.  Csv files can be read by excel, which can then sort and plot this data. 


You can also export the data from a 2d plot, using a trick.  After creating your 2d plot, split the window and select spreadsheet.  The data from your 2d plot filter will be displayed in the spreadsheet view, and this can be exported as described above.
==Export Scene==


Example:
This feature will save whatever is in the viewport to a file.  The Export Scene feature is selected from the main menu: File → Export SceneAgain, the data type is whatever you chose when you export scene.   
*Open disk_out_ref.exo. turn on all variablesPress '''Apply'''.
 
*Drag the object around with the left mouse button until you can see the inside.
:Export Scene can be used to create .webgl files of what is displayed in the viewportA .html file will be written out, which you can load in a web browserThis format allows users to create interactive data products that anyone can load in a web browser.
*Select the '''Filters → Data Analysis→ Plot over line''' buttonApply.
:Export Scene can be used to create .pdf files of what is displayed in the viewport.
*Split the 2d plot vertically. Spreadsheet view.
*File/Export. This will export the data in the spreadsheet viewNote that the rows will be numbered from 0 to 100, representing 101 steps down the lineNotice that there is a column named "arc_length" that represents the X axis of the plot.




Line 29: Line 28:


Example:
Example:
*Start ParaView (3.6.2 or later)
*Start ParaView  
*Tools/ Python Shell/ Trace/ Start Trace.
*Tools/ Python Shell/ Trace/ Start Trace.
*Open disk_out_ref.exo, all variables on, Apply.
*Open disk_out_ref.exo, all variables on, Apply.
Line 36: Line 35:
*Color by Temp.
*Color by Temp.
*In the Python Shell window, Stop Trace.
*In the Python Shell window, Stop Trace.
*Save trace.  Save this file somewhere.
*Save trace.  Save as macro. Call it '''Super-disk'''. 
*Edit/ Delete All
*Edit/ Delete All


Now, lets run the trace.   
Now, lets run the trace.   
*In the Python Shell window, Run Script.  Select your trace file.
*On the Macros toolbar, you will see Super-diskClick it.
 
Notice a few things:
*The Show Plane tool does not turn off.  This is a bug that will be resolved soon.
 
*With multi-file CTH files, ParaView does not create internal variable names correctly.  Before using the trace file, edit this file and change names that look like spcta_a_0* to spcta_a_0I.e., get rid of the *.  This is also true for multi-file Exodus datasets.
 
*The Save Screenshot does not work.  You can add the following code to the trace, and screenshots will be saved.  You want to replace the line at the bottom of the trace that says '''Render()'''
 
<source lang="python">
>>>WriteImage("/path/to/image.png")
 
</source>
 
For Windows XP, use the following:
<source lang="python">
>>>WriteImage("c:/wherever you want/fileName.png")
 
</source>
 
Saving an animation isn't much harder - you use the following code in place of the '''Render()''' call.
 
<source lang="python">
>>>AnimateReader(reader, filename=".../movie.avi")
 
</source>




Line 71: Line 45:


=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.