From: Rich S. <rsi...@us...> - 2011-04-11 11:59:06
|
Chris, I use njTBX to access NetCDF4 files all the time, as long as they contain regular grids, or other Common Data Model feature types. It doesn't handle structures however. Can you point us toward an example of one of the files you are trying to read? If you do have structures, see this example here from the alternate "nctoolbox", which is also a Matlab toolbox based on NetCDF-Java. You need to have Matlab 2008a or later to use "nctoolbox", however. http://code.google.com/p/nctoolbox/source/browse/demos/demo10.m Thanks, Rich 2011/4/11 Chris Wen <chr...@ho...> > Hi All: > > I know the answer. Because, no matter of which version of Netcdf -Java you > use, they just do not support NetCDF 4 > http://www.unidata.ucar.edu/downloads/netcdf/index.jsp > .....So, that is it. > > -Chris > > ------------------------------ > From: sk...@gm... > Date: Fri, 8 Apr 2011 10:38:01 -0400 > > Subject: Re: [njtbx-users] : Installation Problem....Anyone helps.. > To: chr...@ho... > CC: njt...@li... > > Chris.. > > Can you try to download the latest toolsUI jar file from Unidata site > directly and try ? > > ftp://ftp.unidata.ucar.edu/pub/netcdf-java/v4.2/toolsUI-4.2.jar > > Remove the 'toolsui-4.0.49' from your matlab java path, add > 'toolsUI-4.2.jar' ... then restart matlab. > > -skb > > 2011/4/8 Chris Wen <chr...@ho...> > > Hi > > With the example file of bora_feb.nc in classcis format, some method like > varget and attget works fine. > The file that I use is of type NetCDF-4. As I use those methods with my > file, I get these exception: > att=nj_attget(uri,'enu'); > Java exception occurred: > java.lang.RuntimeException: java.lang.NoSuchMethodError: > ucar.unidata.util.SpecialMathFunction.log2(D)D > > at ucar.nc2.NetcdfFile.<init>(NetcdfFile.java:1315) > > at ucar.nc2.NetcdfFile.open(NetcdfFile.java:734) > > at ucar.nc2.NetcdfFile.open(NetcdfFile.java:389) > > at ucar.nc2.dataset.NetcdfDataset.openOrAcquireFile(NetcdfDataset.java:709) > > at ucar.nc2.dataset.NetcdfDataset.openDataset(NetcdfDataset.java:434) > > at ucar.nc2.dataset.NetcdfDataset.acquireDataset(NetcdfDataset.java:544) > > at ucar.nc2.dt.grid.GridDataset.open(GridDataset.java:88) > > at msstate.cstm.data.JDataset.<init>(Unknown Source) > > Caused by: java.lang.NoSuchMethodError: > ucar.unidata.util.SpecialMathFunction.log2(D)D > > at > ucar.nc2.iosp.hdf5.H5header$FractalHeap$IndirectBlock.<init>(H5header.java:4946) > > at ucar.nc2.iosp.hdf5.H5header$FractalHeap.<init>(H5header.java:4789) > > at ucar.nc2.iosp.hdf5.H5header.readGroupNew(H5header.java:3428) > > at ucar.nc2.iosp.hdf5.H5header.access$1100(H5header.java:64) > > at ucar.nc2.iosp.hdf5.H5header$H5Group.<init>(H5header.java:1769) > > at ucar.nc2.iosp.hdf5.H5header$H5Group.<init>(H5header.java:1734) > > at ucar.nc2.iosp.hdf5.H5header.readSuperBlock2(H5header.java:319) > > at ucar.nc2.iosp.hdf5.H5header.read(H5header.java:173) > > at ucar.nc2.iosp.hdf5.H5iosp.open(H5iosp.java:108) > > at ucar.nc2.NetcdfFile.<init>(NetcdfFile.java:1297) > > ... 7 more > . > MATLAB:nj_attget:Unable to create "mDataset" object > > It is supposed to also handle the Netcdf-4 file , isn't it? > > -Chris > ------------------------------ > To: chr...@ho... > CC: njt...@li... > Subject: Re: [njtbx-users] : Installation Problem....Anyone helps.. > From: emo...@us... > Date: Fri, 8 Apr 2011 09:41:42 -0400 > > > Chris- > > The toolsUI-4.0.49 I have is also ~18mb, but it's that size on a system > where the njTBX works fine. > > I notice you now also have this in your error msg: > (Ljava/lang/StringBuilder;IZ)V > > I'm wondering if the string parser is having lots of trouble and the 'L' is > really supposed to be a : or a /? > Ellyn > > Ellyn T. Montgomery, Oceanographer and Data Manager > U.S. Geological Survey > Woods Hole Coastal and Marine Science Center > 384 Woods Hole Road, Woods Hole, MA 02543-1598 > (508)457-2356 > > > From: Chris Wen <chr...@ho...> To: < > njt...@li...> Date: 04/08/2011 09:22 AM Subject: Re: > [njtbx-users] : Installation Problem....Anyone helps.. > ------------------------------ > > > > Skb > > I tried those methods you told me, it still does not work: > 1. I found the size of toolUI is not the same as the size described in the > installation page, in which it is toolsUI-4.0.49.jar<http://sourceforge.net/projects/njtbx/files/njTBX-downloads/toolsUI-4.0.49.jar/download>(~15mb), > while the size of toolsUI I got is 18mb. The toolsUI that I downloaded is > from the path the installation page gives. > > 2. > clear classes > clear cache > import ucar.nc2.dt.grid.GridDataset > > uri='C:\NetCDFLab\Tools\matlab-njTbx-2.0.05\matlab-njTbx-2.0.05\examples\data\ > bora_feb.nc'; > nc=GridDataset.open(uri); > nc.getDetailInfo; > ??? Java exception occurred: > java.lang.NoSuchMethodError: > ucar.unidata.util.Format.tab(Ljava/lang/StringBuilder;IZ)V > > at ucar.nc2.dt.grid.GeoGrid.getInfo(GeoGrid.java:854) > > at ucar.nc2.dt.grid.GridDataset.getInfo(GridDataset.java:315) > > at ucar.nc2.dt.grid.GridDataset.getDetailInfo(GridDataset.java:338) > > The above exception is what I got. > > -Chris > > ------------------------------ > From: sk...@gm... > Date: Thu, 7 Apr 2011 11:12:26 -0400 > Subject: Re: [njtbx-users] FW: Installation Problem....Anyone helps.. > To: chr...@ho... > CC: njt...@li... > > Chris, > > Not sure of the source of the problem, but I would try these simple steps. > > 1. Make sure that both jar files you have downloaded from sourceforge are > of correct size. > I mean there may be a slight chance that they didn't download > completely/correctly. > If you do find discrepancy in files, then please download them again and > restart matlab. > > 2. Ruling out which jar is giving problem. Please run this sequence in > matlab. > Use local data file that came with njtbx. You would find that in > 'examples/data/*bora_feb.nc* <http://bora_feb.nc/>'. > > >>clear classes > >>clear cache > >> import ucar.nc2.dt.grid.GridDataset > > >> uri=' examples/data/*bora_feb.nc* <http://bora_feb.nc/>'; > >> nc=GridDataset.open(uri); > > >> nc.getDetailInfo > > > Let me know if there is any success. We will go from here. > > > thanks.. > > -skb > > 2011/4/7 Chris Wen <*chr...@ho...* <chr...@ho...>> > > Hi > > 1.I found this: > *Prinstallation Requirements*<http://sourceforge.net/apps/trac/njtbx/wiki/DownloadNjtbx-current#Pre-installationRequirements> > Before you proceed to download, make sure that you meet the following > minimum requirements. > > - Java Runtime 1.5 or higher (1.6 recommended). Type "version -java" in > Matlab if you are unsure. > - Matlab version 2006b or higher > > > Matlab version 2006b is released with MATLAB 7.2, while my Matlab is 7.0.4. > However on the Start page, it is said that it should work on any version > of Matlab that supports Java (Matlab 6.5 and later). I feel a little bit > confused.. > > > 2.No, it throw this exception: > url='*http://geoport.whoi.edu/thredds/dodsC/bathy/crm_vol1.nc*<http://geoport.whoi.edu/thredds/dodsC/bathy/crm_vol1.nc> > '; > nc=mDataset(url); > Java exception occurred: > java.lang.IllegalAccessError: tried to access method > ucar.unidata.util.StringUtil.replace(Ljava/lang/String;[C[Ljava/lang/String;)Ljava/lang/String; > from class ucar.nc2.NCdumpW > > at ucar.nc2.NCdumpW.encodeString(NCdumpW.java:894) > > at ucar.nc2.Attribute.toString(Attribute.java:280) > > at ucar.nc2.Variable.writeCDL(Variable.java:1122) > > at ucar.nc2.Variable.writeCDL(Variable.java:1098) > > at ucar.nc2.Variable.toString(Variable.java:1085) > > at java.util.Formatter$FormatSpecifier.printString(Unknown Source) > > at java.util.Formatter$FormatSpecifier.print(Unknown Source) > > at java.util.Formatter.format(Unknown Source) > > at java.util.Formatter.format(Unknown Source) > > at > ucar.nc2.dataset.CoordTransBuilder.makeCoordinateTransform(CoordTransBuilder.java:190) > > at > ucar.nc2.dataset.CoordSysBuilder.makeCoordinateTransforms(CoordSysBuilder.java:1019) > > at > ucar.nc2.dataset.CoordSysBuilder.buildCoordinateSystems(CoordSysBuilder.java:612) > > at ucar.nc2.dataset.NetcdfDataset.enhance(NetcdfDataset.java:503) > > at ucar.nc2.dataset.NetcdfDataset.<init>(NetcdfDataset.java:1174) > > at ucar.nc2.dataset.NetcdfDataset.openDataset(NetcdfDataset.java:440) > > at ucar.nc2.dataset.NetcdfDataset.acquireDataset(NetcdfDataset.java:544) > > at ucar.nc2.dt.grid.GridDataset.open(GridDataset.java:88) > > at msstate.cstm.data.JDataset.<init>(Unknown Source) > > -Chris > > > > > Date: Thu, 7 Apr 2011 07:58:34 -0400 > > > Subject: Re: [njtbx-users] Installation Problem....Anyone helps.. > > From: *rsi...@us...* <rsi...@us...> > > To: *chr...@ho...* <chr...@ho...> > > > > Chris, > > Does this work? > > > > url='*http://geoport.whoi.edu/thredds/dodsC/bathy/crm_vol1.nc*<http://geoport.whoi.edu/thredds/dodsC/bathy/crm_vol1.nc> > '; > > nc=mDataset(url); > > lon=nc{'lon'}(:); > > > > > 2011/4/7 Chris Wen <*chr...@ho...*<chr...@ho...> > >: > > > Hi > > > 1.I used the zip file.... > > > 2.I tried the new URL, but it still does not work... > > > version -java > > > ans = > > > Java 1.5.0 with Sun Microsystems Inc. Java HotSpot(TM) Client VM > > > (mixed mode) > > > ncRef='*http://geoport.whoi.edu/thredds/dodsC/bathy/crm_vol1.nc*<http://geoport.whoi.edu/thredds/dodsC/bathy/crm_vol1.nc> > '; > > > [data,geo]=nj_subsetGrid(ncRef,'topo',[-70.9 -70.1 41.15 41.65]); > > > ??? Error: File: nj_subsetGrid.m Line: 70 Column: 23 > > > Functions cannot be indexed using {} or . indexing. > > > Really appreciate your reply.... > > > -Chris > > > > > >> Date: Thu, 7 Apr 2011 07:09:34 -0400 > > >> Subject: Re: [njtbx-users] Installation Problem....Anyone helps.. > > >> From: *rsi...@us...* <rsi...@us...> > > >> To: *chr...@ho...* <chr...@ho...> > > >> CC: *njt...@li...*<njt...@li...> > > >> > > >> Chris, > > >> > > >> 1. Did you download the m-files from the SVN or did you use the zip > file? > > >> > > >> 2. I don't think this is the problem, but that bathy URL is down. Can > > >> you try this instead? > > >> > > >> ncRef='*http://geoport.whoi.edu/thredds/dodsC/bathy/crm_vol1.nc*<http://geoport.whoi.edu/thredds/dodsC/bathy/crm_vol1.nc> > ' > > >> [data,geo]=nj_subsetGrid(ncRef,'topo',[-70.9 -70.1 41.15 41.65]); > > >> > > >> -Rich > > >> > > >> 2011/4/7 Chris Wen <*chr...@ho...*<chr...@ho...> > >: > > >> > Hi > > >> > > > >> > > > >> > > > >> > As it is said ‘njTBX uses only Java and M-files, thus should work > on > > >> > any > > >> > version of Matlab that supports Java (Matlab 6.5 and later) and on > any > > >> > platform. The library is freely available and the source code is > > >> > released > > >> > under the (MIT-style) ‘, thus my matlab, which is version 7(R14) > > >> > released at > > >> > Jan.29.2005, can also use njTBX? > > >> > > > >> > > > >> > > > >> > Following the installation instructions, I met a error: > > >> > > > >> > > > >> > > > >> >>> ncRef > > >> >>> ='* > http://coast-enviro.er.usgs.gov/thredds/dodsC/bathy/crm_vol1.nc*<http://coast-enviro.er.usgs.gov/thredds/dodsC/bathy/crm_vol1.nc> > '; > > >> > > > >> >>> [data,geo]=nj_subsetGrid(ncRef,'topo',[-70.9 -70.1 41.15 41.65]); > > >> > > > >> > ??? Error: File: nj_subsetGrid.m Line: 70 Column: 23 > > >> > > > >> > Functions cannot be indexed using {} or . indexing. > > >> > > > >> > > > >> > > > >> > Anybody can tell me the reason? > > >> > > > >> > > > >> > > > >> > My configuration seems correct: > > >> > > > >> > > > >> > > > >> >>> path > > >> > > > >> > > > >> > > > >> > MATLABPATH > > >> > > > >> > > > >> > > > >> > > > >> > C:\NetCDFLab\Tools\matlab-njTbx-2.0.05\matlab-njTbx-2.0.05\examples > > >> > > > >> > > > >> > > > >> > > C:\NetCDFLab\Tools\matlab-njTbx-2.0.05\matlab-njTbx-2.0.05\njTBX-2.0\Utilities > > >> > > > >> > > > >> > C:\NetCDFLab\Tools\matlab-njTbx-2.0.05\matlab-njTbx-2.0.05\seawater > > >> > > > >> > > > >> > C:\NetCDFLab\Tools\matlab-njTbx-2.0.05\matlab-njTbx-2.0.05\RPSstuff > > >> > > > >> > > > >> > C:\NetCDFLab\Tools\matlab-njTbx-2.0.05\matlab-njTbx-2.0.05\njTBX-2.0 > > >> > > > >> > > > >> > C:\NetCDFLab\Tools\matlab-njTbx-2.0.05\matlab-njTbx-2.0.05\njFunc > > >> > > > >> > > > >> > C:\NetCDFLab\Tools\matlab-njTbx-2.0.05\matlab-njTbx-2.0.05 > > >> > > > >> > C:\Program Files\MATLAB704\toolbox\matlab\general > > >> > > > >> > C:\Program Files\MATLAB704\toolbox\matlab\ops > > >> > > > >> > C:\Program Files\MATLAB704\toolbox\matlab\lang > > >> > > > >> > C:\Program Files\MATLAB704\toolbox\matlab\elmat > > >> > > > >> > C:\Program Files\MATLAB704\toolbox\matlab\elfun > > >> > > > >> > C:\Program Files\MATLAB704\toolbox\matlab\specfun > > >> > > > >> > C:\Program Files\MATLAB704\toolbox\matlab\matfun > > >> > > > >> > C:\Program Files\MATLAB704\toolbox\matlab\datafun > > >> > > > >> > C:\Program Files\MATLAB704\toolbox\matlab\polyfun > > >> > > > >> > C:\Program Files\MATLAB704\toolbox\matlab\funfun > > >> > > > >> > C:\Program Files\MATLAB704\toolbox\matlab\sparfun > > >> > > > >> > C:\Program Files\MATLAB704\toolbox\matlab\scribe > > >> > > > >> > C:\Program Files\MATLAB704\toolbox\matlab\graph2d > > >> > > > >> > …….. > > >> > > > >> > > > >> > > > >> >>> javaclasspath > > >> > > > >> > > > >> > > > >> > STATIC JAVA PATH > > >> > > > >> > > > >> > > > >> > > > >> > C:\NetCDFLab\Tools\njTools-2.0.12_jre1.5.jar > > >> > > > >> > > > >> > C:\NetCDFLab\Tools\toolsUI-4.0.49.jar > > >> > > > >> > C:\Program > > >> > Files\MATLAB704\java\patch > > >> > > > >> > C:\Program > > >> > Files\MATLAB704\java\jar\util.jar > > >> > > > >> > C:\Program > > >> > Files\MATLAB704\java\jar\widgets.jar > > >> > > > >> > C:\Program > > >> > Files\MATLAB704\java\jar\agent.jar > > >> > > > >> > C:\Program > > >> > Files\MATLAB704\java\jar\beans.jar > > >> > > > >> > C:\Program > > >> > Files\MATLAB704\java\jar\download.jar > > >> > > > >> > C:\Program > > >> > Files\MATLAB704\java\jar\hg.jar > > >> > > > >> > C:\Program > > >> > Files\MATLAB704\java\jar\ice.jar > > >> > > > >> > C:\Program > > >> > Files\MATLAB704\java\jar\ide.jar > > >> > > > >> > C:\Program > > >> > Files\MATLAB704\java\jar\jmi.jar > > >> > > > >> > C:\Program > > >> > Files\MATLAB704\java\jar\mde.jar > > >> > > > >> > > > >> > > > >> > …. > > >> > > > >> > The thing worth noticing is that the java path of njTools and > toolsUI is > > >> > located at STATIC JAVA PATH, which I think is OK. > > >> > > > >> > > > >> > > ------------------------------------------------------------------------------ > > >> > Xperia(TM) PLAY > > >> > It's a major breakthrough. An authentic gaming > > >> > smartphone on the nation's most reliable network. > > >> > And it wants your games. > > >> > *http://p.sf.net/sfu/verizon-sfdev*<http://p.sf.net/sfu/verizon-sfdev> > > >> > _______________________________________________ > > >> > njtbx-users mailing list > > >> > *njt...@li...*<njt...@li...> > > >> > *https://lists.sourceforge.net/lists/listinfo/njtbx-users*<https://lists.sourceforge.net/lists/listinfo/njtbx-users> > > >> > > > >> > > > >> > > >> > > >> > > >> -- > > >> Dr. Richard P. Signell (508) 457-2229 > > >> USGS, 384 Woods Hole Rd. > > >> Woods Hole, MA 02543-1598 > > > > > > > ------------------------------------------------------------------------------ > > > Xperia(TM) PLAY > > > It's a major breakthrough. An authentic gaming > > > smartphone on the nation's most reliable network. > > > And it wants your games. > > > *http://p.sf.net/sfu/verizon-sfdev*<http://p.sf.net/sfu/verizon-sfdev> > > > _______________________________________________ > > > njtbx-users mailing list > > > *njt...@li...*<njt...@li...> > > > *https://lists.sourceforge.net/lists/listinfo/njtbx-users*<https://lists.sourceforge.net/lists/listinfo/njtbx-users> > > > > > > > > > > > > > > -- > > Dr. Richard P. Signell (508) 457-2229 > > USGS, 384 Woods Hole Rd. > > Woods Hole, MA 02543-1598 > > > ------------------------------------------------------------------------------ > Xperia(TM) PLAY > It's a major breakthrough. An authentic gaming > smartphone on the nation's most reliable network. > And it wants your games.* > **http://p.sf.net/sfu/verizon-sfdev* <http://p.sf.net/sfu/verizon-sfdev> > _______________________________________________ > njtbx-users mailing list* > **njt...@li...* <njt...@li...>* > **https://lists.sourceforge.net/lists/listinfo/njtbx-users*<https://lists.sourceforge.net/lists/listinfo/njtbx-users> > > > > > -- > Sachin Bhate* > **http://njtbx.sourceforge.net/* <http://njtbx.sourceforge.net/> > ------------------------------------------------------------------------------ > Xperia(TM) PLAY > It's a major breakthrough. An authentic gaming > smartphone on the nation's most reliable network. > And it wants your games. > http://p.sf.net/sfu/verizon-sfdev > _______________________________________________ > njtbx-users mailing list > njt...@li... > https://lists.sourceforge.net/lists/listinfo/njtbx-users > > > > > ------------------------------------------------------------------------------ > Xperia(TM) PLAY > It's a major breakthrough. An authentic gaming > smartphone on the nation's most reliable network. > And it wants your games. > http://p.sf.net/sfu/verizon-sfdev > _______________________________________________ > njtbx-users mailing list > njt...@li... > https://lists.sourceforge.net/lists/listinfo/njtbx-users > > > > > -- > Sachin Bhate > http://njtbx.sourceforge.net/ > > > ------------------------------------------------------------------------------ > Xperia(TM) PLAY > It's a major breakthrough. An authentic gaming > smartphone on the nation's most reliable network. > And it wants your games. > http://p.sf.net/sfu/verizon-sfdev > _______________________________________________ > njtbx-users mailing list > njt...@li... > https://lists.sourceforge.net/lists/listinfo/njtbx-users > > -- Dr. Richard P. Signell (508) 457-2229 USGS, 384 Woods Hole Rd. Woods Hole, MA 02543-1598 |