I have several NetCDF files that I'm trying to read into Vapor; each file holds different fields at a particular timestep. What is the proper syntax for reading in all of these files with ncdf2vdf? There doesn't appear to be a timestep (e.g. "-ts") option for this routine. For instance, my workflow is the following:
ncdfvdfcreate visSeries0001.hdf5 visSeries0002.hdf5 data.vdf
Created VDF file:
Num time steps : 2
3D Variable names : streamfunction temperature velocityz vorticityz
2DXY Variable names :
2DXZ Variable names :
2DYZ Variable names :
Excluded 3D Variable names :
Excluded 2D Variable names :
Coordinate extents : 0 0 0 1 0.5 0.25
ncdf2vdf visSeries0001.hdf5 visSeries0002.hdf5 data.vdf
Processing VDC time step 0
Processing variable streamfunction, data range (-0.000111761, 0.000120288)
Processing variable temperature, data range (-2.45736e-05, 2.92183e-05)
Processing variable velocityz, data range (-0.0107125, 0.010946)
Processing variable vorticityz, data range (-0.000394318, 0.000438261)
Processing VDC time step 1
Processing variable streamfunction, data range (-0.000111761, 0.000120288)
Processing variable temperature, data range (-2.45736e-05, 2.92183e-05)
Processing variable velocityz, data range (-0.0107125, 0.010946)
Processing variable vorticityz, data range (-0.000394318, 0.000438261)
As you can see from the above output, it reads the same file twice rather than both files. Can someone tell me what I'm doing wrong here?
Thanks
Hi Michael,
Can you post the header file for one of your NetCDF files (the output of the 'ncdump -h' command)?
thanks - jc
Here's the output:
netcdf visSeries0001 {
dimensions:
phony_dim_0 = 96 ;
phony_dim_1 = 192 ;
phony_dim_2 = 384 ;
variables:
double streamfunction(phony_dim_0, phony_dim_1, phony_dim_2) ;
double temperature(phony_dim_0, phony_dim_1, phony_dim_2) ;
double velocityz(phony_dim_0, phony_dim_1, phony_dim_2) ;
double vorticityz(phony_dim_0, phony_dim_1, phony_dim_2) ;
}
This is a bug. I have opened a case:
https://sourceforge.net/p/vapor/bugs/1040/
and we should get this fixed in the 2.4 release (December, 2014). In the interim would it be possible to add an explicit time dimension to your data? If you have an explicit time dimension you can identify it to ncdfcreate and ncf2vdf with "-timedim <dimension name>"
Thanks for letting me know. When you say "add an explicit time dimension" to my data, do you mean set up four dimensional arrays for all of the fields, or an additional array with the time stamp is all that is needed?
The minium you would need to do is define a 4th dimension for each variable. It needs to be the slowest varying dimension for each variable. For example, 'ncdump -h' might show:
float vorticity(nt, nz, ny, nx)
where nt is the time dimension.
Preferably you can also create a time coordinate variable (a one-dimensional variable dimensioned by nt). The time coordinate variable should contain the time of the variable instance in whatever units you are using. If you have a velocity field specified in m/s then the time variable should be in seconds. You would then need to inform ncdfvdfcreate and ncdf2vdf of the existince of this varaible. For example, if you had a variable:
float time(nt)
you would specify:
ncdfvdfcreate -timedim nt -timevar time ....
ncdf2vdf -timedim nt -timevar time ....
Hope this helps.
Are you saying that I need to do both steps, or can I do either step to overcome the bug?
You only need to have a time dimension. The time coordinate variable is optional, but helpful to have if you're going to do any unsteady flow integration inside of vapor.