This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.
Greetings Rinku! > Thanks so much Sean, > > I am able to run my code to read the netcdf files using netcdf lib. Great news! > Could you please advice is there any example which shows section read for big > variable data? I am not sure I understand. Are you asking how to read a small subset of a larger variable, like a 10x10 subset of a variable that is a 2000x2000 array? Cheers, Sean > > with regards, > Rinku Panchal > > -----Original Message----- > From: Unidata netCDF Java Support [mailto:address@hidden] > Sent: Thursday, 20 October 2011 5:51 AM > To: Panchal, Rinku > Cc: address@hidden > Subject: [netCDFJava #KNP-588613]: Regarding use of netcdf-4.2.jar to read > ".nc" file > > Greetings, > > I probably should have answered this first. My advice is to look through some > of the example .java files we have on the web. which are located at (which I > think you've found): > > http://www.unidata.ucar.edu/software/netcdf/examples/programs/ > > In order to run the example programs, you will need to grab the netCDF-java > package. I would recommend going with the netcdfAll-4.2.jar. Add this jar > file to your classpath like so: > > export CLASSPATH = <path-to-netcdf-jar>/netcdfAll-4.2:$CLASSPATH (if you are > using bash) > > setenv CLASSPATH = <path-to-netcdf-jar>/netcdfAll-4.2:$CLASSPATH (if you are > using a c-based shell) > > From that point, you need to compile the .java file into a .class file. So, > for example, if you download Simple_xy_wr.java, you would need to type: > > javac Simple_xy_wr.java > > You may get some warnings, but that is ok. Once compiled, you should have a > file called Simple_xy_wr.class in your directory. To run this file, simply > type: > > java Simple_xy_wr > > If the command is successful, you will see the message "*** SUCCESS writing > example file simple_xy.nc!", and a new netCDF file named "simple_xy.nc" will > be in your directory. > > Cheers! > > Sean > > > Hello there, > > > > I am new to Java an also a very naïve user of cdf files. > > I want to read and write to CDF files (larger files). > > I have gone through the netCDF java utilities and download them. > > Could you please advise me where can I get proper information for > > how to use netcdf-4.2.jar application to read and write to file. > > > > thanks and regards, > > Rinku Panchal > > Software Engineer > > > > ------------------------------------------------------------------------- > > DISCLAIMER: This e-mail transmission and any documents, files and > > previous e-mail messages attached to it are private and confidential. > > They may contain proprietary or copyright material or information that > > is subject to legal professional privilege. They are for the use of > > the intended recipient only. Any unauthorised viewing, use, disclosure, > > copying, alteration, storage or distribution of, or reliance on, this > > message is strictly prohibited. No part may be reproduced, adapted or > > transmitted without the written permission of the owner. If you have > > received this transmission in error, or are not an authorised recipient, > > please immediately notify the sender by return email, delete this > > message and all copies from your e-mail system, and destroy any printed > > copies. Receipt by anyone other than the intended recipient should not > > be deemed a waiver of any privilege or protection. Thales Australia > > does not warrant or represent that this e-mail or any documents, files > > and previous e-mail messages attached are error or virus free. > > > > ------------------------------------------------------------------------- > > > > > > > > > Ticket Details > =================== > Ticket ID: KNP-588613 > Department: Support netCDF Java > Priority: High > Status: Open > > > > ------------------------------------------------------------------------- > DISCLAIMER: This e-mail transmission and any documents, files and > previous e-mail messages attached to it are private and confidential. > They may contain proprietary or copyright material or information that > is subject to legal professional privilege. They are for the use of > the intended recipient only. Any unauthorised viewing, use, disclosure, > copying, alteration, storage or distribution of, or reliance on, this > message is strictly prohibited. No part may be reproduced, adapted or > transmitted without the written permission of the owner. If you have > received this transmission in error, or are not an authorised recipient, > please immediately notify the sender by return email, delete this > message and all copies from your e-mail system, and destroy any printed > copies. Receipt by anyone other than the intended recipient should not > be deemed a waiver of any privilege or protection. Thales Australia > does not warrant or represent that this e-mail or any documents, files > and previous e-mail messages attached are error or virus free. > > ------------------------------------------------------------------------- > > Ticket Details =================== Ticket ID: KNP-588613 Department: Support netCDF Java Priority: High Status: Open