
***************************************
DataSignals now uses a messy combination of pure java NetCDF to write NetCDF4 files
 but that still reads any old HDF5 files.
 
 It no longer compresses, although it will read compressed files if you gzip them
 blah.nc --> blah.nc.gz 
 
 NetCDF is also a complete mess, but at least is a mess in pure Java.
 The NetCDF library can read any (NetCDF3, NetCDF4, HDF5) format in pure java, but can only write NetCDF3 in pure java.
 NetCDF3 format can't handle LONG, or STRING types.
 NetCDF4 reading requires native lib.
 
 There is a pure jar file called 'NUJAN' which does ONLY NetCDF4 writing in pure java, filling in most of the gaps of the NetCDF library.
 
 Both the NetCDF and NUJAN seem to be reasonably fast, although some copying of arrays is involved, and shouldn't be.
 
 NUJAN will write strings and netcdf will read them, but NetCDF won't read string from HDF5 files, so
 any old signals with strings will need to be converted(no, i dont know an easy way) or recreated.
 Once recreated as NetCDF4, strings are ok.  

***************************************
 

*********** OBSOLETE ***************

DataSignals requires use of HDF5 which comes in three parts:
a) libhdf5.so / hdf5.dll / ????  				- Native HDF5 Main libraries.
b) libjhdf5.so / jhdf5.dll / libjhdf5.jnilib	- Native-Java bindings (JNI)
c) jhdf5.jar 									- Java interface for HDF5

Some prebuilt sets of the three are under lib-prebuilt/ 

1) To remove the errors in eclipse:
	Window -> Preferences -> Java -> Build Path -> User Libraries
	Click 'New' and enter the name 'JHDF5'
	Click 'Add JARs'
	Find the appropriate jhdf5.jar (possible one of the one under lib-prebuilt).
	
2) Put the libhdf5* and libjhdf5* or hdf5.dll jhdf5.dll etc into your system libraries area (e.g. /usr/lib or Windows\System32).

3) Run src/tests/JetPFTests.java

If the system still fails to find the library 'jhdf5' you may need to point the first line of JetPFTest directly at it, or...
Set the environment variable 'ncsa.hdf.hdf5lib.H5.hdf5lib' to point directly at the actual jhdf5 library binary file (not the hdf core library).
[ In minerva, set data-signals.jhdf5.libraryFile to point directly at the jhdf5 library file ]

If you get errors like...
"java.lang.UnsatisfiedLinkError: ncsa.hdf.hdf5lib.HDF5Constants.H5_SZIP_MAX_PIXELS_PER_BLOCK()I"

Then your jhdf5.jar and libjhdf5 JNI lib do not match.




The versions for all of these things have to match to a certain degree - you will find that some versions of JHDF do not work with some
versions of HDF5 native and some versions of the JHDF5.JAR java code fail with some versions of the JHDF5 bindings.

The JHDF5.JAR is added as an eclipse 'user library'. You need to point this to the correct version on your system, which
may or may not be the one under lib-prebuilt 

There are some versions of all of these things in the lib-prebuilt directory, try various combinations until it works.

Otherwise, download it all from one of these places...





Java HDF5 native libraries (JHI):
ftp://ftp.hdfgroup.org/HDF5/hdf-java/bin/
(or HDF5 website).

For windows:
ftp://ftp.hdfgroup.org/HDF5/hdf-java/bin/win32/hdf-java/win/jhdf.dll
ftp://ftp.hdfgroup.org/HDF5/hdf-java/bin/win32/hdf-java/win/jhdf5.dll

For windows 64-bit:
See lib-prebuilt/windows-x64/README-windows64.txt

For linux 32-bit:
ftp://ftp.hdfgroup.org/HDF5/hdf-java/bin/linux32/hdf-java/lib/linux/libjhdf.so
ftp://ftp.hdfgroup.org/HDF5/hdf-java/bin/linux32/hdf-java/lib/linux/libjhdf5.so

For linux 64-bit:
ftp://ftp.hdfgroup.org/HDF5/hdf-java/bin/linux64amd/hdf-java/lib/linux/libjhdf.so
ftp://ftp.hdfgroup.org/HDF5/hdf-java/bin/linux64amd/hdf-java/lib/linux/libjhdf5.so

For mac 32-bit:
????

For max 64-bit:
There is a precompiled binary for 64-bit mac under lib-prebuilt/mac-x64
There are some instructions on how to compile this under lib-prebuilt/mac-x64/README-mac64.txt 

For Windows Vista, put these dll:s in the c:\Windows directory rather than c:\Windows\System32 which works
better for some unknown security reasons.


JET MDS+
There is some random scraps of info in 4 emails between myself(oliford) and Adrian Capel in the doc folder. 
These were used to help build a lot of the code in the MDS+/TDI calls made in JETMdsFetcher.doMDSGetSignal()


Email from Antoine Sirinelli about installing HDF5 on 64bit Ubuntu:
On a Debian Linux system (and on Ubuntu), it is at the end quite
straightforward to have HDF5 working in eclipse. Everything is available
in the Debian official repositories (for Ubuntu, it is in universe).

You can install the relevant files with one command:
apt-get install libjhdf5-java libjhdf5-jni

it will install jhdf5.jar in /usr/share/java/ and libjhdf5.so
in /usr/lib/jni/.

In Eclipse, you just have to set the Project properties this way:
"Java Build Path" -> Libraries -> Add External JARs
-> /usr/share/java/jhdf5.jar
Then, under the newly created jhdf5.jar library, select "Native library
location" and click on "Edit...". Add the Location Path /usr/lib/jni/

This way, you do not have to manually installed any libraries or set any
environment variables and you are assured that all the libraries used
matches.


