Class CoordinateAxis

  • All Implemented Interfaces:
    Comparable<Variable>, VariableEnhanced, ProxyReader
    Direct Known Subclasses:
    CoordinateAxis1D

    @Immutable
    public class CoordinateAxis
    extends VariableDS
    A Variable that specifies one of the coordinates of a CoordinateSystem, this is a legacy class, use GridAxis for new code.

     Mathematically it is a scalar function F from index space to S:
      F:D -> S
      where D is a product set of dimensions (aka index space), and S is the set of reals (R) or Strings.
     

    If its element type is CHAR, it is considered a string-valued Coordinate Axis and rank is reduced by one, since the outermost dimension is considered the string length: v(i, j, .., strlen). If its element type is String, it is a string-valued Coordinate Axis. Otherwise it is numeric-valued, and isNumeric() is true.

    A CoordinateAxis is optionally marked as georeferencing with an AxisType. It should have a units string and optionally a description string.

    A Structure cannot be a CoordinateAxis, although members of Structures can.

    • Method Detail

      • fromVariableDS

        public static CoordinateAxis.Builder<?> fromVariableDS​(VariableDS.Builder<?> vdsBuilder)
        Create a coordinate axis from an existing VariableDS.Builder.
        Parameters:
        vdsBuilder - an existing Variable in dataset.
        Returns:
        CoordinateAxis or one of its subclasses (CoordinateAxis1D, CoordinateAxis2D, or CoordinateAxis1DTime).
      • getAxisType

        @Nullable
        public AxisType getAxisType()
        Get type of axis
      • isNumeric

        public boolean isNumeric()
        Does the axis have numeric values?
        Returns:
        true if the CoordAxis is numeric, false if its string valued ("nominal").
      • equals

        public boolean equals​(Object oo)
        Instances which have same content are equal.
        Overrides:
        equals in class Variable
      • hashCode

        public int hashCode()
        Override Object.hashCode() to implement equals.
        Overrides:
        hashCode in class Variable
      • getCalendarFromAttribute

        public Calendar getCalendarFromAttribute()
        Figure out what calendar to use from the axis' attributes.
      • getCalendarFromAttribute

        @Nullable
        public static Calendar getCalendarFromAttribute​(@Nullable
                                                        NetcdfFile ncd,
                                                        AttributeContainer attributes)
        Figure out what calendar to use from the given attributes.