Re: netCDF Java - define variables without a dimension

  • To: Michael Keller <km@xxxxxxxxxx>
  • Subject: Re: netCDF Java - define variables without a dimension
  • From: John Caron <caron@xxxxxxxxxxxxxxxx>
  • Date: Thu, 01 Sep 2005 08:37:46 -0600
A scalar variable can be defined with an empty list of dimensions, eg, in 
NetcdfFileWriteable:

/**
   * Add a variable to the file. Must be in define mode.
   * @param varName name of Variable, must be unique with the file.
   * @param dataType type of underlying element
* @param dims list of Dimensions for the variable, must already have been added. Use a list of length 0
   *   for a scalar variable.
   */
  public void addVariable(String varName, DataType dataType, ArrayList dims);


Michael Keller wrote:
Institution: Metrohm AG
Package Version: 2.1.10
Operating System: Windows XP
Hardware Information: nothing special
Inquiry: I'm implementing the cdl template from ASTM (Analytical Data 
Interchange Protocol for Chromatograhic Data) in Java. There are several 
variables defined without a dimension. But in JavaDoc I can't find a methode to 
add a variable to a ncFile without a defined dimension.

I've opend some cdf examples (witch implemented this cdl from ASTM) in a NetCDF file 
browser and the browser lists the dimension of this variables with "no dimensions 
found". I attached a example.

Do you know a way, how I can do it the way all other programers did it?

Kind regards
Michael