ucar.nc2.dataset
Class CoordinateAxis2D

java.lang.Object
  extended by ucar.nc2.Variable
      extended by ucar.nc2.dataset.VariableDS
          extended by ucar.nc2.dataset.CoordinateAxis
              extended by ucar.nc2.dataset.CoordinateAxis2D
All Implemented Interfaces:
Comparable<VariableSimpleIF>, Enhancements, EnhanceScaleMissing, VariableEnhanced, ProxyReader, VariableIF, VariableSimpleIF

public class CoordinateAxis2D
extends CoordinateAxis

A 2-dimensional numeric Coordinate Axis. Must be invertible meaning, roughly, that if you draw lines connecting the points, none would cross.

Author:
john caron
See Also:
CoordinateAxis.factory(ucar.nc2.dataset.NetcdfDataset, ucar.nc2.dataset.VariableDS)

Nested Class Summary
 
Nested classes/interfaces inherited from class ucar.nc2.dataset.CoordinateAxis
CoordinateAxis.AxisComparator
 
Nested classes/interfaces inherited from class ucar.nc2.Variable
Variable.Cache
 
Field Summary
 
Fields inherited from class ucar.nc2.dataset.CoordinateAxis
axisType, boundaryRef, isContiguous, ncd, positive
 
Fields inherited from class ucar.nc2.dataset.VariableDS
orgDataType, orgName, orgVar
 
Fields inherited from class ucar.nc2.Variable
attributes, cache, dataType, debugCaching, defaultCoordsSizeToCache, defaultSizeToCache, dimensions, elementSize, group, isMetadata, isVariableLength, ncfile, parent, proxyReader, shape, shapeAsSection, shortName, sizeToCache, spiObject
 
Constructor Summary
CoordinateAxis2D(NetcdfDataset ncd, VariableDS vds)
          Create a 2D coordinate axis from an existing VariableDS
 
Method Summary
protected  Variable copy()
           
 double getCoordValue(int j, int i)
          Get the coordinate value at the i, j index.
 double[] getCoordValues()
          Get the coordinate values as a 1D double array, in canonical order.
 ArrayDouble.D2 getMidpoints()
           
static ArrayDouble.D2 makeXEdges(ArrayDouble.D2 midx)
          Normal case: do something reasonable in deciding on the edges when we have the midpoints of a 2D coordinate.
static ArrayDouble.D2 makeXEdgesRotated(ArrayDouble.D2 midx)
          Experimental: for WRF rotated (staggered) Grids
static ArrayDouble.D2 makeYEdges(ArrayDouble.D2 midy)
          Normal case: do something reasonable in deciding on the edges when we have the midpoints of a 2D coordinate.
static ArrayDouble.D2 makeYEdgesRotated(ArrayDouble.D2 midy)
          Experimental: for WRF rotated (staggered) Grids
 CoordinateAxis2D section(Range r1, Range r2)
          Create a new CoordinateAxis2D as a section of this CoordinateAxis2D.
 
Methods inherited from class ucar.nc2.dataset.CoordinateAxis
copyNoCache, equals, factory, getAxisType, getBoundaryRef, getInfo, getMaxValue, getMinValue, getPositive, getUnitsString, hashCode, isContiguous, isNumeric, setAxisType, setBoundaryRef, setPositive
 
Methods inherited from class ucar.nc2.dataset.VariableDS
_read, _read, addCoordinateSystem, clearCoordinateSystems, convertEnums, convertScaleOffsetMissing, convertScaleOffsetMissing, convertScaleOffsetMissing, convertScaleOffsetMissing, convertScaleOffsetMissing, convertScaleOffsetMissing, enhance, getCoordinateSystems, getDescription, getEnhanceMode, getMissingDataArray, getOriginalDataType, getOriginalName, getOriginalVariable, getUseNaNs, getValidMax, getValidMin, hasCachedDataRecurse, hasFillValue, hasInvalidData, hasMissing, hasMissingValue, hasScaleOffset, isFillValue, isInvalidData, isMissing, isMissingFast, isMissingValue, lookupEnumString, reallyRead, reallyRead, removeCoordinateSystem, setCaching, setFillValueIsMissing, setInvalidDataIsMissing, setMissingDataIsMissing, setName, setOriginalVariable, setUnitsString, setUseNaNs, showScaleMissingProxy, toStringDebug
 
Methods inherited from class ucar.nc2.Variable
addAttribute, clone, compareTo, createNewCache, extraInfo, findAttribute, findAttributeIgnoreCase, findDimensionIndex, getAttributes, getDataType, getDimension, getDimensions, getDimensionsAll, getDimensionsString, getElementSize, getEnumTypedef, getFullName, getFullNameEscaped, getName, getNameAndDimensions, getNameAndDimensions, getNameAndDimensions, getNameAndDimensions, getNameAndDimensions, getNameAndDimensions, getParentGroup, getParentStructure, getProxyReader, getRanges, getRank, getScalarData, getShape, getShape, getShapeAll, getShapeAsSection, getShortName, getSize, getSizeToCache, getSPobject, hasCachedData, invalidateCache, isCaching, isCoordinateVariable, isImmutable, isMemberOfStructure, isMetadata, isScalar, isUnknownLength, isUnlimited, isUnsigned, isVariableLength, read, read, read, read, read, readScalarByte, readScalarDouble, readScalarFloat, readScalarInt, readScalarLong, readScalarShort, readScalarString, readToByteChannel, remove, removeAttribute, removeAttributeIgnoreCase, resetDimensions, resetShape, section, section, setCachedData, setCachedData, setDataType, setDimension, setDimensions, setDimensions, setDimensionsAnonymous, setElementSize, setEnumTypedef, setImmutable, setIsScalar, setParentGroup, setParentStructure, setProxyReader, setSizeToCache, setSPobject, setValues, setValues, slice, toString, writeCDL, writeCDL
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface ucar.nc2.VariableIF
findAttribute, findAttributeIgnoreCase, findDimensionIndex, getAttributes, getDataType, getDimension, getDimensions, getDimensionsAll, getElementSize, getFullName, getFullNameEscaped, getNameAndDimensions, getParentGroup, getParentStructure, getRanges, getRank, getShape, getShapeAsSection, getShortName, getSize, isCoordinateVariable, isMemberOfStructure, isMetadata, isScalar, isUnlimited, isUnsigned, isVariableLength, read, read, read, read, readScalarByte, readScalarDouble, readScalarFloat, readScalarInt, readScalarLong, readScalarShort, readScalarString, section
 
Methods inherited from interface ucar.nc2.VariableSimpleIF
getName
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Constructor Detail

CoordinateAxis2D

public CoordinateAxis2D(NetcdfDataset ncd,
                        VariableDS vds)
Create a 2D coordinate axis from an existing VariableDS

Parameters:
ncd - the containing dataset
vds - create it from here
Method Detail

copy

protected Variable copy()
Overrides:
copy in class CoordinateAxis

getCoordValue

public double getCoordValue(int j,
                            int i)
Get the coordinate value at the i, j index.

Parameters:
i - index 0 (fastest varying, right-most)
j - index 1
Returns:
midpoint.get( j,i).

getCoordValues

public double[] getCoordValues()
Get the coordinate values as a 1D double array, in canonical order.

Returns:
coordinate values
Throws:
UnsupportedOperationException - if !isNumeric()

section

public CoordinateAxis2D section(Range r1,
                                Range r2)
                         throws InvalidRangeException
Create a new CoordinateAxis2D as a section of this CoordinateAxis2D.

Parameters:
r1 - the section on the first index
r2 - the section on the second index
Returns:
a section of this CoordinateAxis2D
Throws:
InvalidRangeException - if specified Ranges are invalid

getMidpoints

public ArrayDouble.D2 getMidpoints()

makeXEdges

public static ArrayDouble.D2 makeXEdges(ArrayDouble.D2 midx)
Normal case: do something reasonable in deciding on the edges when we have the midpoints of a 2D coordinate.

Parameters:
midx - x coordinates of midpoints
Returns:
x coordinates of edges with shape (ny+1, nx+1)

makeYEdges

public static ArrayDouble.D2 makeYEdges(ArrayDouble.D2 midy)
Normal case: do something reasonable in deciding on the edges when we have the midpoints of a 2D coordinate.

Parameters:
midy - y coordinates of midpoints
Returns:
y coordinates of edges with shape (ny+1, nx+1)

makeXEdgesRotated

public static ArrayDouble.D2 makeXEdgesRotated(ArrayDouble.D2 midx)
Experimental: for WRF rotated (staggered) Grids

Parameters:
midx - x coordinates of midpoints
Returns:
x coordinates of edges with shape (ny+2, nx+1)

makeYEdgesRotated

public static ArrayDouble.D2 makeYEdgesRotated(ArrayDouble.D2 midy)
Experimental: for WRF rotated (staggered) Grids

Parameters:
midy - y coordinates of midpoints
Returns:
y coordinates of edges with shape (ny+2, nx+1)


Copyright © 1999-2011 UCAR/Unidata. All Rights Reserved.