public String getUnit() { return coordinateAxis.getUnitsString(); }
@Override public boolean canHandle(CoordinateAxis axis) { if (axis != null && "time".equalsIgnoreCase(axis.getShortName()) && CLIMATOLOGICAL_UNITS.equalsIgnoreCase(axis.getUnitsString())) { if (LOGGER.isLoggable(Level.FINEST)) { LOGGER.finest("Climatological Time Handler Spi can handle the axis"); } return true; } return false; }
static String[] getUnitDirection(CoordinateAxis axis) { AxisType type = axis.getAxisType(); String units = axis.getUnitsString();
/** * @param binding * @param coordinateAxis */ public CoordinateVariable(Class<T> binding, CoordinateAxis coordinateAxis) { Utilities.ensureNonNull("coordinateAxis", coordinateAxis); Utilities.ensureNonNull("binding", binding); this.binding = binding; this.coordinateAxis = coordinateAxis; this.conversionFactor = 1d; AxisType axisType = coordinateAxis.getAxisType(); // Special management for projected coordinates with unit = km if ((axisType == AxisType.GeoX || axisType == AxisType.GeoY) && coordinateAxis.getUnitsString().equalsIgnoreCase("km")) { conversionFactor = KM_TO_M; convertAxis = true; } }
LOGGER.fine( "Detected unparseable unit string in time axis: '" + axis.getUnitsString() + "'.");
units = coordinateAxis.getUnitsString();
return null; String units = zAxis.getUnitsString(); AxisType axisType = zAxis.getAxisType();
if (timeAxis != null) { AxisType type = timeAxis.getAxisType(); String units = timeAxis.getUnitsString();
/** Get the units of Calendar time. * To get a Date, from a time value, call DateUnit.getStandardDate(double value). * To get units as a String, call DateUnit.getUnitsString(). */ public ucar.nc2.units.DateUnit getTimeUnits() throws Exception { if (null == dateUnit) { dateUnit = new DateUnit( timeAxis.getUnitsString()); } return dateUnit; }
/** Get the units of Calendar time. * To get a Date, from a time value, call DateUnit.getStandardDate(double value). * To get units as a String, call DateUnit.getUnitsString(). */ public ucar.nc2.units.DateUnit getTimeUnits() throws Exception { if (null == dateUnit) { dateUnit = new DateUnit( timeAxis.getUnitsString()); } return dateUnit; }
/** @return "up" if this is a Vertical (z) coordinate axis which goes up as coords get bigger * @param v for this axis */ public String getZisPositive( CoordinateAxis v) { // gotta have a length unit String unit = v.getUnitsString(); if ((unit != null) && SimpleUnit.isCompatible("m", unit)) return "up"; return "down"; // lame NUWG COnventions! units of millibar might be "millibars above ground" ! // heres a kludge that should work // return v.getName().equalsIgnoreCase("fhg") ? "up" : "down"; }
@Override public boolean canHandle(CoordinateAxis axis) { if (axis != null && "time".equalsIgnoreCase(axis.getShortName()) && CLIMATOLOGICAL_UNITS.equalsIgnoreCase(axis.getUnitsString())) { if (LOGGER.isLoggable(Level.FINEST)) { LOGGER.finest("Climatological Time Handler Spi can handle the axis"); } return true; } return false; }
protected void setTimeUnits() throws Exception { CoordinateAxis axis = ds.findCoordinateAxis(AxisType.Time); if (axis == null) { parseInfo.append("*** Time Units not Found\n"); } else { String units = axis.getUnitsString(); dateUnits = new DateUnit(units); } }
protected void setTimeUnits() throws Exception { List axes = ds.getCoordinateAxes(); for (int i = 0; i < axes.size(); i++) { CoordinateAxis axis = (CoordinateAxis) axes.get(i); if (axis.getAxisType() == AxisType.Time) { String units = axis.getUnitsString(); dateUnits = new DateUnit(units); return; } } parseInfo.append("*** Time Units not Found\n"); }
protected void setTimeUnits() throws Exception { List axes = ds.getCoordinateAxes(); for (int i = 0; i < axes.size(); i++) { CoordinateAxis axis = (CoordinateAxis) axes.get(i); if (axis.getAxisType() == AxisType.Time) { String units = axis.getUnitsString(); dateUnits = new DateUnit(units); return; } } parseInfo.append("*** Time Units not Found\n"); }
protected void setTimeUnits() throws Exception { List axes = ncd.getCoordinateAxes(); for (int i = 0; i < axes.size(); i++) { CoordinateAxis axis = (CoordinateAxis) axes.get(i); if (axis.getAxisType() == AxisType.Time) { String units = axis.getUnitsString(); dateUnits = new DateUnit(units); return; } } parseInfo.append("*** Time Units not Found\n"); }
protected void setTimeUnits() throws Exception { CoordinateAxis axis = ds.findCoordinateAxis(AxisType.Time); if (axis == null) { parseInfo.append("*** Time Units not Found\n"); } else { String units = axis.getUnitsString(); dateUnits = new DateUnit(units); calDateUnits = CalendarDateUnit.of(null, units); } }
private String getZisPositive(NetcdfDataset ds, CoordinateAxis v) { String attValue = ds.findAttValueIgnoreCase(v, "positive", null); if (null != attValue) return attValue.equalsIgnoreCase("up") ? "up" : "down"; String unit = v.getUnitsString(); if ((unit != null) && SimpleUnit.isCompatible("millibar", unit)) return "down"; if ((unit != null) && SimpleUnit.isCompatible("m", unit)) return "up"; // dunno return null; }
private String getZisPositive(NetcdfDataset ds, CoordinateAxis v) { String attValue = ds.findAttValueIgnoreCase(v, "positive", null); if (null != attValue) return attValue.equalsIgnoreCase("up") ? "up" : "down"; String unit = v.getUnitsString(); if ((unit != null) && SimpleUnit.isCompatible("millibar", unit)) return "down"; if ((unit != null) && SimpleUnit.isCompatible("m", unit)) return "up"; // dunno return null; }
protected void setTimeUnits() throws Exception { CoordinateAxis axis = ds.findCoordinateAxis(AxisType.Time); if (axis == null) { parseInfo.append("*** Time Units not Found\n"); } else { String units = axis.getUnitsString(); dateUnits = new DateUnit(units); calDateUnits = CalendarDateUnit.of(null, units); } }