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.
Hi Annie: You need to use the javadoc for ucar.nc2.Variable: http://www.unidata.ucar.edu/software/thredds/v4.3/netcdf-java/v4.3/javadoc/index.html John > Greetings support crew, > > I'm trying to parse each variable in a NetCDF file. For example, if I > print out each variable in ncFile using: > > for (Variable var : ncFile.getVariables()){ > System.out.println(var); > } > > One of the variables that prints will look something like this. > > float lat(lat=180); > :units = "degrees_north"; > :long_name = "Latitude"; > :actual_range = 89.5f, -89.5f; // float > :standard_name = "latitude"; > :axis = "Y"; > :coordinate_defines = "center"; > > I'm totally stumped on how to isolate each of those list components in the > variable. Because 'var' is neither an array or structure, I don't know how > to isolate any given line within var. Is there a method I'm missing that > could help with this? > > Please let me know if you need any other information! I appreciate any > insights you can give. > > Best, > Annie > > -- > ------------------------------------------------------------------------------------------ > Ann Bryant Burgess, PhD > > Postdoctoral Fellow > Computer Science Department > University of Southern California > Viterbi School of Engineering > Los Angeles, CA > > Alaska Science Center/USGS > Anchorage, AK > > Cell: (585) 738-7549 > Office: (907) 786-7059 > Fax: (907) 786-7150 > E-mail: address@hidden > Office Address: 4210 University Dr., Anchorage, AK 99508-4626 > ------------------------------------------------------------------------------------------- > > Ticket Details =================== Ticket ID: NDX-797833 Department: Support netCDF Java Priority: Critical Status: Closed