[Paraview] Saving one data array into one file

Dan Goldstein dan at cora.nwra.com
Sun Dec 7 16:22:28 EST 2008


There is a trick I use to do this that does not require python.
It works if you save your data in an xml format. I edit the header of  
the xml data file
to mask out the variables I do not want. Then you can read the edited  
data file into ParaView and
do a "Save Data" and the saved data file will only have the unmasked  
out variables, and thus be smaller.
A little round about, but it can be handy to reduce the size of data  
files to something more manageable that only
contains the variables you need.
Below is the header of one of my .vtp data files, with three variables  
commented out.
In xml comments start with: <!--
and end with: -->
In the example below I have commented out the variables
Pressure, Temperature and Total_Viscosity
I have left only velocity

Hope this helps

Dan

Header of example xml data file:

<?xml version="1.0"?>
<!--
  NEK5000 results file
  Simulation Run Name    = rnj199_XVptTvisc_nid0000_fld0094_sliceXZ.vtp
  Simulation Dump Number = 94
  Simulation Dump Time   =        277.0013
94@<DataSet timestep="277.0013" group="" part="0"  
file="rnj199_XVptTvisc_nid0000_fld0094_sliceXZ.vtp"/>
-->
<VTKFile type="PolyData" version="0.1" byte_order="LittleEndian"  
compressor="vtkZLibDataCompressor">
   <PolyData>
     <Piece NumberOfPoints="56682"                 
NumberOfVerts="0"                     
NumberOfLines="0"                     
NumberOfStrips="0"                     
NumberOfPolys="112000"              >
       <PointData>
         <DataArray type="Float32" Name="velocity"  
NumberOfComponents="3" format="appended"  
RangeMin="0"                    RangeMax="8.9045344071"          
offset="0"                   />
<!--
         <DataArray type="Float32" Name="Pressure" format="appended"  
RangeMin="-17.463245392"        RangeMax="7.5806732178"          
offset="834872"              />
         <DataArray type="Float32" Name="Temperature"  
format="appended" RangeMin="294.73049927"          
RangeMax="513.46710205"         offset="1111516"             />
         <DataArray type="Float32" Name="Total_Viscosity"  
format="appended" RangeMin="0.23999999464"         
RangeMax="4.1113233566"         offset="1321156"             />
-->
       </PointData>
       <CellData>
       </CellData>
       <Points>
         <DataArray type="Float32" Name="Array 0x5c82f0"  
NumberOfComponents="3" format="appended"  
RangeMin="1.7795446345"         RangeMax="5727.0763336"          
offset="1380356"             />
       </Points>
       <Verts>
         <DataArray type="Int64" Name="connectivity" format="appended"  
RangeMin=""                     RangeMax=""                      
offset="1860160"             />
         <DataArray type="Int64" Name="offsets" format="appended"  
RangeMin=""                     RangeMax=""                      
offset="1860176"             />
       </Verts>
       <Lines>
         <DataArray type="Int64" Name="connectivity" format="appended"  
RangeMin=""                     RangeMax=""                      
offset="1860192"             />
         <DataArray type="Int64" Name="offsets" format="appended"  
RangeMin=""                     RangeMax=""                      
offset="1860208"             />
       </Lines>
       <Strips>
         <DataArray type="Int64" Name="connectivity" format="appended"  
RangeMin=""                     RangeMax=""                      
offset="1860224"             />
         <DataArray type="Int64" Name="offsets" format="appended"  
RangeMin=""                     RangeMax=""                      
offset="1860240"             />
       </Strips>
       <Polys>
         <DataArray type="Int64" Name="connectivity" format="appended"  
RangeMin=""                     RangeMax=""                      
offset="1860256"             />
         <DataArray type="Int64" Name="offsets" format="appended"  
RangeMin=""                     RangeMax=""                      
offset="2393580"             />
       </Polys>
     </Piece>
   </PolyData>
   <AppendedData encoding="base64">

On Dec 5, 2008, at 3:27 PM, Berk Geveci wrote:

> I am afraid there is no easy way of doing. You can use the python
> programmable filter to remove the arrays you don't want though. There
> is some documentation on the wiki.
>
> -berk
>
> On Wed, Nov 19, 2008 at 8:24 PM, amayt <tyamamayt at gmail.com> wrote:
>> Dear all,
>>
>> I have an image data that has been generated with multiple data  
>> arrays
>> based on the 'Append Attributes' filter.  e.g., a data array a is
>> generated by b+c.  When saving this sort of data, all the arrays
>> contained (e.g., arrays a, b, and c) are saved into one file.  I'd
>> like to know how to save just one array (e.g., array a) into one  
>> file.
>>
>> I'd appreciate any comments.
>>
>> Thanks,
>>
>> Amayt
>> _______________________________________________
>> ParaView mailing list
>> ParaView at paraview.org
>> http://www.paraview.org/mailman/listinfo/paraview
>>
> _______________________________________________
> ParaView mailing list
> ParaView at paraview.org
> http://www.paraview.org/mailman/listinfo/paraview



More information about the ParaView mailing list