On 9/3/07, Roger GALLOU (AGO) <roger.gallou@xxxxxx> wrote:
> I'm working with Java nc2 library and I wish to read Etopo files (which
> are in NetCDF format) with the methods of the library. I work with
> MatLab R2006b.
> I want to sample the data in Latitude and Longitude, ie, I don't want to
> read all the data but only two samples among 4.
> In Java, I manage to read it with loop in latitude and longitude but
> it isn't satisfied by the process time which is more longer than the
> version with mex version.
> Do you know a method with Java which is so faster than with mex functions ?
Did you know that SNCTOOLS can read NetCDF files into Matlab using
NetCDF-Java? All you have to do is edit "nc_method.m" and change
"method=mexnc" to "method=java".
At least on the file I tried, using SNCTOOLS "nc_varget" function
(java) is then faster than using the mex-file based "NetCDF toolkit":
Elapsed time is 0.083326 seconds.
Elapsed time is 0.369757 seconds.
You can explore the "nc_varget_java.m" routine in the SNCTOOLS
"private" directory to see the NetCDF java routines used.
Dr. Richard P. Signell (508) 457-2229
USGS, 384 Woods Hole Rd.
Woods Hole, MA 02543-1598