Re: [visad] help

Hi all....


Well McV and IDV have lots of code demonstrating that.

IDV goes one step further to use ucar.n2.dataset.grid.GridDataset which uses NetcdfFile class to create grids which it further connects with visad using ucar.visad.data.GeoGridFlatField. That is pretty complicated in the sense, you know how to extend the ucar.nc2.dataset.CoordSysBuilder to insert your dataset file in that. In McV, it is plain NetcdfFile class being used almost in the new development may be related to S-NPP datasources or even the Hydra stuff. The new incarnation of Hydra (Hydra 2), uses McV code based for creating Multispectral datasources
for calipso, cloudsat, modis, etc.

Coming back to what Devanshi is concerned about. Actually as far as I know she is trying with Meghatropiques dataset. It is a very special satellite as it provides all the acquisitions in tropical region specifically dedicated to study the water cycle of
tropical region. It is collaboration between ISRO and CNES.


I would suggest Devanshi, you should just first try to see how you are reading variables. The code snippet that you sent, in that you are reading the "Science Data" as a variable but it is group. You should first try the following method:

List<Variable> var_list = ncFile.getVariables();

It gives the list of all the variables in the hdf-5 file.
Then you can pick the variable of interest from that list and apply
float samples[] = variable.read(float.class); //assuming data type is float

I hope it helps.

Ghansham


On 03/25/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. Re: help (Tom Whittaker)
    2. Re: help (Curtis Rueden)
    3. Re: help (Tom Whittaker)


----------------------------------------------------------------------

Message: 1
Date: Tue, 25 Mar 2014 09:12:12 -0500
From: Tom Whittaker<whittaker@xxxxxxxx>
To: Devanshi Prajapati<prajapati.devanshi@xxxxxxxxx>
Cc: "visad@xxxxxxxxxxxxxxxx"<visad@xxxxxxxxxxxxxxxx>
Subject: Re: [visad] help
Message-ID:
        <CAA6nkJBHXNWD=YWJ2+TWbG865GQwVXQmC4+xTEZuj2X2YSDJrg@xxxxxxxxxxxxxx>
Content-Type: text/plain; CHARSET=US-ASCII

I believe the main issue here is that the code in the VisAD library
for HDF files has not been maintained by the original authors.  This
also is true of the netCDF adapter ("Plain").  Unfortunately, this
means that for files that use newer features in these formats, the
code no longer works.

I do not have any solutions, other than as Ghansham suggests, using
the "official" releases of the respective libraries and then building
your own VisAD Data objects...

tom

On Fri, Mar 21, 2014 at 3:14 AM, Devanshi Prajapati
<prajapati.devanshi@xxxxxxxxx>  wrote:
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


_______________________________________________
visad mailing list
visad@xxxxxxxxxxxxxxxx
For list information, to unsubscribe, visit:
http://www.unidata.ucar.edu/mailing_lists/