Data Cave

From ACEnet
Jump to: navigation, search

Contents

Usage

Steps to run vGeo

Bob Deupree has made a cheat sheet for using vGeo. This cheat sheet is a step by step set of instructions for taking a data set and volume rendering it in the cave. The cheat sheet has been written from the point of view of taking Bob's CHEF data and rendering it in the cave. It should provide useful information as well as a good starting point for anyone wishing to use vGeo in the cave.

HDF4 Data Format for vGeo

vGeo is a new piece of software for the cave which handles volume rendering as well as many other visualization methods. One of the data file formats supported by vGeo is HDF4. Below is a fortran90 subroutine which can be used as a template to write a program that writes out an HDF4 data file.

subroutine hdfdmp(cOutputFile,daX,daY,daZ,cFormat,cCoordSys&
  ,cLabel1,cUnits1,dDataMin1,dDataMax1,daData1&
  ,cLabel2,cUnits2,dDataMin2,dDataMax2,daData2)
  
  !Declarations
  implicit none
  
  !internal
  integer*4 nXMax,nYMax,nZMax,nRet,naShape(3),nRank
  parameter (nXMax=100,nYMax=200,nZMax=300)
  
  !input
  character*100 cOutputFile
  character*16 cLabel1,cUnits1,cLabel2,cUnits2,cFormat,cCoordSys
  real*4 daX(nXMax),daY(nYMax), daZ(nZMax), daData1(nXMax*nYMax*nZMax),daData2(nXMax*nYMax*nZMax)
  real*4 dDataMin1,dDataMax1,dDataMin2,dDataMax2
  integer*4 dssdims,dssdisc,dssdast,dssrang,dspdata,dsadata
  !set rank and shape of dataset
  nRank=3
  naShape(1)=nXMax
  naShape(2)=nYMax
  naShape(3)=nZMax
  
  !Set size of grid
  nRet=dssdims(nRank,naShape)
  
  !Write out coordinates of Cartesian grid
  nRet=dssdisc(1,naShape(1),daX)
  nRet=dssdisc(2,naShape(2),daY)
  nRet=dssdisc(3,naShape(3),daZ)
  
  !write out first variable
  !=============================================
  
  !Set strings for data sets
  nRet=dssdast(cLabel1,cUnits1,cFormat,cCoordSys)
  
  !Set range of data set
  nRet=dssrang(dDataMax1,dDataMin1)
  
  !Write out data set
  nRet=dspdata(cOutputFile,nRank,naShape,daData1)
  
  !write out second variable
  !=============================================
  
  !Set strings for data sets
  nRet=dssdast(cLabel2,cUnits2,cFormat,cCoordSys)
  
  !Set range of data set
  nRet=dssrang(dDataMax2,dDataMin2)
  
  !Write out data set
  nRet=dsadata(cOutputFile,nRank,naShape,daData2)
  return
end

To compile this you will need to link to the following libraries by adding the flags

  • -L/usr/local/hdf4.2r1/lib
  • -L/usr/local/szip/lib
  • -lmfhdf
  • -ljpeg
  • -lz
  • -lsz

to compiler command. The program has been tested to compiled using 64 bit but it may also be possible to compile using 32 bit. It also seemed to have trouble loading shared libraries when not linked statically. Putting it all together, and compiling with f95 results in the following command

 f95 -static –m64 -o executable source.f90 -L/usr/local/hdf4.2r1/lib -L/usr/local/szip/lib -lmfhdf -ldf -ljpeg -lz -lsz

Also below is a simple driver program which calls the above subroutine. If these are both put into an f90 file, and compiled with the above command (replacing "source.f90" with your f90 file and "executable" with whatever you want to call your executable) and the executable is run, it will produce an hdf file called "test.hdf" with two variables. The hdf file can be viewed with HDFView

 program hdf_test
   integer*4 nXMax,nYMax,nZMax
   parameter (nXMax=1,nYMax=2,nZMax=3)
   character*100 cOutputFile
   character*16 cLabel1,cLabel2,cUnits1,cUnits2,cFormat,cCoordSys
   real*4 daX(nXMax),daY(nYMax),daZ(nZMax),dDataMin1,dDataMin2,dDataMax1,dDataMax2
   real*4 daData1(nXMax*nYMax*nZMax),daData2(nXMax*nYMax*nZMax)
   cOutputFile="test.hdf"
   cLabel1="test var1"
   cLabel2="test var2"
   cUnits1="Kg"
   cUnits2="s"
   cFormat="Doesn't matter"
   cCoordSys="Who cares"
   daX(1)=0.0
   daY(1)=1.0
   daY(2)=2.0
   daZ(1)=3.0
   daZ(2)=4.0
   daZ(3)=5.0
   daData1(1)=0.1
   daData1(2)=1.1
   daData1(3)=2.1
   daData1(4)=3.1
   daData1(5)=4.1
   daData1(6)=5.1
   dDataMin1=0.1
   dDataMax1=5.1
   daData2(1)=0.2
   daData2(2)=1.2
   daData2(3)=2.2
   daData2(4)=3.2
   daData2(5)=4.2
   daData2(6)=5.2
   dDataMin2=0.2
   dDataMax2=5.2
   write(6,*) '\"',cOutputFile,'\"'
   call hdfdmp(cOutputFile,daX,daY,daZ,cFormat,cCoordSys&
   ,cLabel1,cUnits1,dDataMin1,dDataMax1,daData1&
   ,cLabel2,cUnits2,dDataMin2,dDataMax2,daData2)
   stop
 end

Construction

The Fakespace Data Cave at SMU is complete and we are in the final stages of testing. Check out our recent coverage on CBC's The National:

ACEnet's Virtual Environment

Datacave drawing.png

Construction Images

ICA personnel
The construction begins.
The skeleton framework is completed.
Screens in place.
Computer installed.
Testing of the Data Cave
Alignment of the Data Cave

Related Resources

Resources
User Support
News and Events
Organization
About Us