public AxisType getAxisType(){ return coordinateAxis.getAxisType(); }
AxisType axisType = axis.getAxisType(); if (axisType == null) { return false;
private Variable getTemporalAxis() { final int axesSize = axes.size(); Variable temporalAxis = null; if (axesSize > 2){ temporalAxis = axes.get(0); final CoordinateAxis1D axis = (CoordinateAxis1D) temporalAxis; final AxisType axisType = axis.getAxisType(); if (axisType==AxisType.Time || axisType==AxisType.RunTime) return axis; } return temporalAxis; }
/** * true if increasing z coordinate values means "up" in altitude */ @Override public boolean isZPositive() { if (vertZaxis == null) return false; if (vertZaxis.getPositive() != null) { return vertZaxis.getPositive().equalsIgnoreCase(ucar.nc2.constants.CF.POSITIVE_UP); } if (vertZaxis.getAxisType() == AxisType.Height) return true; return vertZaxis.getAxisType() != AxisType.Pressure; }
/** * true if increasing z coordinate values means "up" in altitude */ @Override public boolean isZPositive() { if (vertZaxis == null) return false; if (vertZaxis.getPositive() != null) { return vertZaxis.getPositive().equalsIgnoreCase(ucar.nc2.constants.CF.POSITIVE_UP); } if (vertZaxis.getAxisType() == AxisType.Height) return true; return vertZaxis.getAxisType() != AxisType.Pressure; }
/** * true if increasing z coordinate values means "up" in altitude */ @Override public boolean isZPositive() { if (vertZaxis == null) return false; if (vertZaxis.getPositive() != null) { return vertZaxis.getPositive().equalsIgnoreCase(ucar.nc2.constants.CF.POSITIVE_UP); } if (vertZaxis.getAxisType() == AxisType.Height) return true; if (vertZaxis.getAxisType() == AxisType.Pressure) return false; return true; // default }
@Override public CoordinateReferenceSystem getCoordinateReferenceSystem() { if(this.crs==null){ synchronized (this) { final AxisType axisType = coordinateAxis.getAxisType(); switch(axisType){ case GeoZ:case Height:case Pressure: String axisName =getName(); if (UnidataCRSUtilities.VERTICAL_AXIS_NAMES.contains(axisName)) { this.crs= UnidataCRSUtilities.buildVerticalCrs(coordinateAxis); } break; } } } return crs; } }
/** * Returns the units, or {@code null} if unknown. * * @throws ParserException if a unit has been found but its symbol can not be parsed. * * @see CoordinateAxis1D#getUnitsString() * @see Unit#valueOf(CharSequence) */ @Override public Unit<?> getUnit() throws ParserException { Unit<?> unit = this.unit; if (unit == null) { final String symbol = getUnitsString(); if (symbol != null && !symbol.isEmpty()) { this.unit = unit = Units.parse(symbol); } else { // Infer default units if they were not specified. final AxisType type = axis.getAxisType(); if (type != null) { switch (type) { case Lon: case Lat: this.unit = unit = Units.DEGREE; break; } } } } return unit; }
@SuppressWarnings({ "rawtypes", "unchecked" }) public static CoordinateVariable<?> create(CoordinateAxis1D coordinateAxis){ Utilities.ensureNonNull("coordinateAxis", coordinateAxis); // If the axis is not numeric, we can't process any further. if (!coordinateAxis.isNumeric()) { throw new IllegalArgumentException("Unable to process non numeric coordinate variable: "+coordinateAxis.toString()); } // INITIALIZATION // AxisType? final AxisType axisType= coordinateAxis.getAxisType(); switch(axisType){ case GeoX:case GeoY: case GeoZ: case Height: case Lat: case Lon: case Pressure: case Spectral: return new NumericCoordinateVariable(suggestBinding(coordinateAxis),coordinateAxis); case RunTime:case Time: return new TimeCoordinateVariable(coordinateAxis); default: throw new IllegalArgumentException("Unsupported axis type: "+axisType+ " for coordinate variable: "+coordinateAxis.toStringDebug()); } }
public static Class<?> suggestBinding(CoordinateAxis1D coordinateAxis){ Utilities.ensureNonNull("coordinateAxis", coordinateAxis); final AxisType axisType=coordinateAxis.getAxisType();
CoordinateAxis1D axis = (CoordinateAxis1D) axes.get(i); if (axis != null) { final AxisType type = axis.getAxisType(); if (type != null) { // This is really null in some netCDF file. switch (type) {
AxisType axisType = axis.getAxisType(); if (axisType == null) { return false;
AxisType axisType = axis.getAxisType(); if (axisType == null) { return false;