Class VariableDS

All Implemented Interfaces:
Comparable<VariableSimpleIF>, Iterable<Attribute>, IsMissingEvaluator, AttributeContainer, Enhancements, EnhanceScaleMissingUnsigned, VariableEnhanced, ProxyReader, VariableSimpleIF
Direct Known Subclasses:
CoordinateAxis

public class VariableDS extends Variable implements VariableEnhanced, EnhanceScaleMissingUnsigned
A wrapper around a Variable, creating an "enhanced" Variable. The original Variable is used for the I/O. There are several distinct uses:
  1. Handle scale/offset/missing/enum/unsigned conversion; this can change DataType and data values
  2. Container for coordinate system information
  3. NcML modifications to underlying Variable
See Also:
  • Constructor Details

    • VariableDS

      @Deprecated public VariableDS(NetcdfDataset ds, Group group, Structure parentStructure, String shortName, DataType dataType, String dims, String units, String desc)
      Deprecated.
      Use NetcdfDataset.builder()
      Constructor when there's no underlying variable. You must also set the values by doing one of:
      1. set the values with setCachedData()
      2. set a proxy reader with setProxyReader()
      Otherwise, it is assumed to have constant values (using the fill value)
      Parameters:
      ds - the containing dataset
      group - the containing group
      parentStructure - the containing Structure (may be null)
      shortName - the (short) name
      dataType - the data type
      dims - list of dimension names, these must already exist in the Group; empty String = scalar
      units - String value of units, may be null
      desc - String value of description, may be null
    • VariableDS

      @Deprecated public VariableDS(Group group, Structure parent, String shortName, Variable orgVar)
      Deprecated.
      Use NetcdfDataset.builder()
      Make a new VariableDS, delegate data reading to the original variable, but otherwise dont take any info from it. This is used by NcML explicit mode.
      Parameters:
      group - the containing group; may not be null
      parent - parent Structure, may be null
      shortName - variable shortName, must be unique within the Group
      orgVar - the original Variable to wrap. The original Variable is not modified. Must not be a Structure, use StructureDS instead.
    • VariableDS

      @Deprecated public VariableDS(Group g, Variable orgVar, boolean enhance)
      Deprecated.
      Use NetcdfDataset.builder()
      Wrap the given Variable, making it into a VariableDS. Delegate data reading to the original variable. Take all metadata from original variable. Does not share cache, iosp.
      Parameters:
      g - logical container, if null use orgVar's group
      orgVar - the original Variable to wrap. The original Variable is not modified. Must not be a Structure, use StructureDS instead.
      enhance - if true, use NetcdfDataset.defaultEnhanceMode to define what enhancements are made. Note that this can change DataType and data values. You can also call enhance() later. If orgVar is VariableDS, then enhance is inherited from there, and this parameter is ignored.
  • Method Details