<HTML>
<HEAD>
<TITLE>Re: [Paraview] Importing time-varying data into Paraview</TITLE>
</HEAD>
<BODY>
<FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Daniel,<BR>
<BR>
The (default) ParaView netCDF reader supports the COARDS convention (<a href="http://ferret.wrc.noaa.gov/noaa_coop/coop_cdf_profile.html">http://ferret.wrc.noaa.gov/noaa_coop/coop_cdf_profile.html</a>). ParaView will pick up the time dimension in a 4D array if you follow that convention.<BR>
<BR>
The first thing you have to do is to change the order of the axes. In the COARDS convention, you list the axes backwards. NetCDF has Fortran-style indexing, so the rightmost index is the value that changes the most. The way you have your axes set up (x,y,z,time), which means that for each x,y,z position there is a continuous array of all values over time. Since you usually read or write a block of values at a single time step, this causes a widely interleaved access and subsequently horrible I/O performance. Order your axis (time,z,y,x). <BR>
<BR>
The second thing you have to do is declare the time axis as time. In the COARDS convention time is identified by the units attribute on the time variable. The ParaView reader looks for a string of the form “<time length> since <date>” or “<time length> until <date>”. (Actually, the reader just looks for the substring “since” or “until”. If you change your units from “seconds” to “seconds since 2010-11-9 00:00:00 +0:00”, that would be sufficient.<BR>
<BR>
-Ken<BR>
<BR>
On 11/8/10 8:18 PM, "Daniel Duke" <<a href="daniel.duke@monash.edu">daniel.duke@monash.edu</a>> wrote:<BR>
<BR>
</SPAN></FONT><BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'>Hi,<BR>
<BR>
I'm working for a fluid mechanics laboratory, and we have very large amounts of data that we want to interrogate in Paraview. We're moving away from text and custom binary data formats, to use the more portable VTK and NetCDF data formats. NetCDF and VTK seem very fast and easy to imolement in our in house code. Paraview is also a very efficient tool for us to visualise large data sets and create complex, 3D isosurfaces etc. It's in some respects better than the expensive commercial alternatives. I'm new to Paraview, NetCDF and VTK, but have been using Linux & Open Source for a long time.<BR>
<BR>
There is one major snag that we have, which is the importing of time-dependent data. Paraview's feature set and documentation seems to indicate that handling time-dependent data is a large part of what the application should be capable of doing, so I'm not sure why we can't get it to work.<BR>
<BR>
We have very large scalar and vector fields which are typically a function of 3D space and time, for example we might wish to plot a vector field u~(x,y,z,time). Whilst the importing of a single time instance u~(x,y,z) works perfectly via both NetCDF, we can't seem to import 4D time dependent data and animate it. Paraview appears to have some very nice animation and time based functions, but we can't use them at all because we can't get any of our data imported as a function of time.<BR>
<BR>
I've tried a number of different ways of doing it, and in every instance Paraview fails to identify the "time" axis as being distinct from x, y & z. I will list them here, along with the error messages and the incoming data format. I won't attach our actual .nc data files, as they're gigabytes in size! But I will provide the ncdump header info at the bottom of the message. They are very simple; one scalar value over a regular, structured, rectilinear grid with a regular time-step size. We don't need to compute any time-derivatives, but simply wish to animate iso-surfaces computed at each time step discretely. We have Paraview v.3.6.1 running on Linux and Mac OS X.<BR>
<BR>
Our failed attempts at loading time varying data are as follows:<BR>
<BR>
1. Importing a single large NetCDF file which has the data stored as a 4-D array (x,y,z,time). In this case each dimension is stored as a NetCDF "double" type with the appropriate units.<BR>
<BR>
Opening the .nc file results in the error "more than 3 dims without time not supported".<BR>
The "information" tab after clearing away that error shows Extents X = #timesteps in netcdf, extents Y = #sizeX in netcdf, extents Z = #sizeY in netcdf. The "Time" list at the bottom of the object inspector is empty. So it appears that Paraview is treating "time" as a spatial co-ordinate and then failing to be able to have 4 spatial co-ordinates (which makes perfect sense). I've tried naming the "time" axis several different ways and changing its units, but to no avail. <BR>
<BR>
2. Importing a sequence of separate NetCDF files which are in 3D (x,y,z) and are numbered according to their position in time. ie data-0.00.nc <<a href="http://data-0.00.nc">http://data-0.00.nc</a>> , data-0.01.nc <<a href="http://data-0.01.nc">http://data-0.01.nc</a>> , data-0.02.nc <<a href="http://data-0.02.nc">http://data-0.02.nc</a>> etc. In this case each spatial dimension is stored as a "double" type with the appropriate units , and the time value is only recorded in the filename.<BR>
<BR>
In this case, the Paraview "open" dialog does detect a "set" of files "data-*.nc". So it recognises that they are a related series. When I open "data-*.nc", I only see the data for the first time step. The "Information" tab shows "properties: filename: data-0.00.nc <<a href="http://data-0.00.nc">http://data-0.00.nc</a>> ", and the "Time" list at the bottom of the object inspector is empty. Apparently only the first file has loaded. The time animation features don't do anything. I can't find a way to move forward in the set data-*.nc.<BR>
<BR>
3. Importing time slices as NetCDF files individually into Paraview and attempting to place each slice at its appropriate position in time (tedious, but it should work, right?)<BR>
<BR>
I can't seem to find any feature which will allow me to assign a data set to a particular place in time. Creating a time source does not allow me to link a dataset to a point in time; all visible datasets are overlapping each other at all points in time.<BR>
<BR>
In summary:<BR>
Is importing time dependent data via NetCDF currently possible in Paraview ? Do we need to convert to an alternative file format, or name or mark the time axis in some special way so that Paraview recognises it? I can't see why the importing process can't allow one to choose any axis they like as the time axis; certainly this feature is built into all commercial data visualisation packages. Even if a restructuring of the data was required to do this, surely this could be easily implemented. <BR>
<BR>
Kind Regards<BR>
<BR>
Daniel Duke<BR>
Laboratory for Turbulence Research in Aerospace & Combustion<BR>
Monash University, Australia<BR>
<BR>
<BR>
------ netcdf headers produced by ncdump below -------<BR>
<BR>
--------4D file--------- this won't load. ----------------<BR>
netcdf data-timeseries {<BR>
dimensions:<BR>
X = 201 ;<BR>
Y = 201 ;<BR>
Z = 201 ;<BR>
time = 31;<BR>
variables:<BR>
double X(X) ;<BR>
X:units = "meters" ;<BR>
double Y(Y) ;<BR>
Y:units = "meters" ;<BR>
double Z(Z) ;<BR>
Z:units = "meters" ;<BR>
double time(time) ;<BR>
time:units = "seconds" ;<BR>
double scalarfield(X,Y,Z,time) ;<BR>
}<BR>
<BR>
--------3D file--------- this loads OK, but won't animate over multiple files ----------<BR>
netcdf data-slice {<BR>
dimensions:<BR>
X = 201 ;<BR>
Y = 201 ;<BR>
Z = 201 ;<BR>
variables:<BR>
double X(X) ;<BR>
X:units = "meters" ;<BR>
double Y(Y) ;<BR>
Y:units = "meters" ;<BR>
double Z(Z) ;<BR>
Z:units = "meters" ;<BR>
double scalarfield(X,Y,Z) ;<BR>
}<BR>
<BR>
</SPAN></FONT></BLOCKQUOTE><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
</SPAN></FONT><FONT SIZE="2"><FONT FACE="Consolas, Courier New, Courier"><SPAN STYLE='font-size:10pt'><BR>
**** Kenneth Moreland<BR>
*** Sandia National Laboratories<BR>
*********** <BR>
*** *** *** email: <a href="kmorel@sandia.gov">kmorel@sandia.gov</a><BR>
** *** ** phone: (505) 844-8919<BR>
*** web: <a href="http://www.cs.unm.edu/~kmorel">http://www.cs.unm.edu/~kmorel</a><BR>
</SPAN></FONT></FONT><FONT FACE="Calibri, Verdana, Helvetica, Arial"><SPAN STYLE='font-size:11pt'><BR>
</SPAN></FONT>
</BODY>
</HTML>