Hello
visad uses ncsa hdf5 library which is not
a pure java library but uses JNI code
written in C. if you are working in linux,
you should set LD_LIBRARY_PATH
environment variable to point the shared object
library file that comes with ncsa
hdf5 java library.
I hope it helps.
Why I prefer netcdf java because its
a pure java library and no JNI
deprndency.
ghansham
On Fri, Mar 21, 2014, visad-request@xxxxxxxxxxxxxxxx said:
> Send visad mailing list submissions to
> visad@xxxxxxxxxxxxxxxx
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://mailman.unidata.ucar.edu/mailman/listinfo/visad
> or, via email, send a message with subject or body 'help' to
> visad-request@xxxxxxxxxxxxxxxx
>
> You can reach the person managing the list at
> visad-owner@xxxxxxxxxxxxxxxx
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of visad digest..."
>
>
> Today's Topics:
>
> 1. Re: (no subject) (Devanshi Prajapati) (Ghansham Sangar)
> 2. help (Devanshi Prajapati)
> 3. help (Devanshi Prajapati)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Fri, 21 Mar 2014 09:21:13 +0530
> From: Ghansham Sangar <ghansham@xxxxxxxxxxxxxxx>
> To: visad@xxxxxxxxxxxxxxxx
> Subject: Re: [visad] (no subject) (Devanshi Prajapati)
> Message-ID: <532BB731.5090204@xxxxxxxxxxxxxxx>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
>
> Hello,
>
> I would suggest rather than using hdf5 adapter available in visad,
> you should netcdf-java library for reading hdf5 images.
> It is pretty simple and straight forward.
>
> NetcdfFile ncFile = NetcdfFile.open("myfile.h5");
> Variable var = ncFile.findVariable("my_variable"); //the dataset you
> want to read
> //Assuming image is 2 dimension
> int scans = var.getDimension(0).getLength(); //Getting scans
> int pixels = var.getDimension(1).getLength(); //Getting pixels
> float samples[] =var.read(float.class); //suppose dataset is float data
>
> Given the width, height and pixels of the image (range), you can use any
> of the example
> provided in examples with visad source code to construct the flatfield
> and create a display.
>
> To find netcdf-java library, just google "netcdf-java".
>
>
> Ghansham
>
> On 03/20/2014 11:30 PM, visad-request@xxxxxxxxxxxxxxxx wrote:
>> Send visad mailing list submissions to
>> visad@xxxxxxxxxxxxxxxx
>>
>> To subscribe or unsubscribe via the World Wide Web, visit
>> http://mailman.unidata.ucar.edu/mailman/listinfo/visad
>> or, via email, send a message with subject or body 'help' to
>> visad-request@xxxxxxxxxxxxxxxx
>>
>> You can reach the person managing the list at
>> visad-owner@xxxxxxxxxxxxxxxx
>>
>> When replying, please edit your Subject line so it is more specific
>> than "Re: Contents of visad digest..."
>>
>>
>> Today's Topics:
>>
>> 1. (no subject) (Devanshi Prajapati)
>>
>>
>> ----------------------------------------------------------------------
>>
>> Message: 1
>> Date: Wed, 19 Mar 2014 23:52:35 +0530
>> From: Devanshi Prajapati<prajapati.devanshi@xxxxxxxxx>
>> To: visad@xxxxxxxxxxxxxxxx
>> Subject: [visad] (no subject)
>> Message-ID:
>> <CAH3DJ6K15usGntrtRSBxqR9oGFThqHiDx2j-dAqTQuioP1aGdQ@xxxxxxxxxxxxxx>
>> Content-Type: text/plain; charset="iso-8859-1"
>>
>> Hello ,
>>
>> I want an example that how to plot an hdf5 image in visAD,
>> using it's adapter.I have tried but it is not working.
>
>
>
> ------------------------------
>
> Message: 2
> Date: Fri, 21 Mar 2014 10:41:17 +0530
> From: Devanshi Prajapati <prajapati.devanshi@xxxxxxxxx>
> To: visad@xxxxxxxxxxxxxxxx
> Subject: [visad] help
> Message-ID:
> <CAH3DJ6KA4AJw2rSLOxD-75q91akYu-Li8=K1+gQ7FO55eepcmA@xxxxxxxxxxxxxx>
> Content-Type: text/plain; charset="iso-8859-1"
>
> hi,
>
> I want to read a HDF5 file using visad.jar.
> I am using Hdf5Form to open a file but it gives me an error :
>
> UnsatisfiedLinkError: no ncsa.hdf.hdf5lib.H5.H5Open found
>
> I have added jar in my project still it is giving me this error.
>
>
>
> --
> Devanshi U. Prajapati
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> <http://mailman.unidata.ucar.edu/mailing_lists/archives/visad/attachments/20140321/efff5be0/attachment.html>
>
> ------------------------------
>
> Message: 3
> Date: Fri, 21 Mar 2014 13:44:58 +0530
> From: Devanshi Prajapati <prajapati.devanshi@xxxxxxxxx>
> To: visad@xxxxxxxxxxxxxxxx
> Subject: [visad] help
> Message-ID:
> <CAH3DJ6KOrSBTc2ptp96Rg8-wuOVY3P2zu5K2QnTTXVgOkL=dKQ@xxxxxxxxxxxxxx>
> Content-Type: text/plain; charset="iso-8859-1"
>
> Hi.......This is my program,
>
> package myapp;
>
> import java.rmi.RemoteException;
> import visad.DataImpl;
> import visad.VisADException;
> import visad.data.hdf5.HDF5Form;
> import ncsa.hdf.hdf5lib.*;
>
> public final class hfAdapter2
> { String filePath;
> public hfAdapter2() throws VisADException, RemoteException
> {
> filePath="F:\\Devanshi\\Input\\xyz.h5";
> System.load("F:\\Devanshi\\Projects\\MyApp\\Lib\\jhdf.dll");
> System.load("F:\\Devanshi\\Projects\\MyApp\\Lib\\jhdf5.dll");
> HDF5Form h=new HDF5Form();
> DataImpl ncData=h.open(filePath);
> }
> public static void main(String[] args)
> throws RemoteException, VisADException, IOException
> { new hfAdapter2();
> }
> }
> And the Error I got is,
>
> run:
> Exception in thread "main" java.lang.UnsatisfiedLinkError:
> ncsa.hdf.hdf5lib.H5.H5Fopen(Ljava/lang/String;II)I
> at ncsa.hdf.hdf5lib.H5.H5Fopen(Native Method)
> at visad.data.hdf5.hdf5objects.HDF5File.<init>(HDF5File.java:85)
> at visad.data.hdf5.HDF5FileAdapted.<init>(HDF5FileAdapted.java:70)
> at visad.data.hdf5.HDF5Form.open(HDF5Form.java:102)
> at myapp.hfAdapter2.<init>(hfAdapter2.java:46)
> at myapp.hfAdapter2.main(hfAdapter2.java:96)
> Java Result: 1
> BUILD SUCCESSFUL (total time: 0 seconds)
>
> --
> Devanshi U. Prajapati
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL:
> <http://mailman.unidata.ucar.edu/mailing_lists/archives/visad/attachments/20140321/9b2d71ad/attachment.html>
>
> ------------------------------
>
> _______________________________________________
> visad mailing list
> visad@xxxxxxxxxxxxxxxx
> For list information, to unsubscribe, visit:
> http://www.unidata.ucar.edu/mailing_lists/
>
> End of visad Digest, Vol 50, Issue 2
> ************************************
>
--