case Spectral: final DataType dataType = coordinateAxis.getDataType();
/** * Does the axis have numeric values. * * @return true if the CoordAxis is numeric, false if its string valued ("nominal"). */ public boolean isNumeric() { return (getDataType() != DataType.CHAR) && (getDataType() != DataType.STRING) && (getDataType() != DataType.STRUCTURE); }
/** * Does the axis have numeric values. * * @return true if the CoordAxis is numeric, false if its string valued ("nominal"). */ public boolean isNumeric() { return (getDataType() != DataType.CHAR) && (getDataType() != DataType.STRING) && (getDataType() != DataType.STRUCTURE); }
/** * Does the axis have numeric values. * * @return true if the CoordAxis is numeric, false if its string valued ("nominal"). */ public boolean isNumeric() { return (getDataType() != DataType.CHAR) && (getDataType() != DataType.STRING) && (getDataType() != DataType.STRUCTURE); }
if (units != null && SimpleUnit.isDateUnit(units) && tAxis.getDataType().isNumeric()) { DateUnit du = new DateUnit(units); Array data = tAxis.read(); } else if (tAxis.getDataType() == DataType.STRING) { } else if (tAxis.getDataType() == DataType.CHAR) { DateFormatter formatter = new DateFormatter(); ArrayChar data = (ArrayChar) tAxis.read();
if (units != null && SimpleUnit.isDateUnit(units) && tAxis.getDataType().isNumeric()) { DateUnit du = new DateUnit(units); Array data = tAxis.read(); } else if (tAxis.getDataType() == DataType.STRING) { } else if (tAxis.getDataType() == DataType.CHAR) { DateFormatter formatter = new DateFormatter(); ArrayChar data = (ArrayChar) tAxis.read();
varElem.setAttribute("shape", buff.toString()); DataType dt = var.getDataType(); varElem.setAttribute("type", dt.toString());
varElem.setAttribute("shape", buff.toString()); DataType dt = var.getDataType(); varElem.setAttribute("type", dt.toString());
/** * Make a copy, with an independent cache. * * @return copy of this CoordinateAxis */ public CoordinateAxis copyNoCache() { CoordinateAxis axis = new CoordinateAxis(ncd, getParentGroup(), getShortName(), getDataType(), getDimensionsString(), getUnitsString(), getDescription()); // other state axis.axisType = this.axisType; axis.boundaryRef = this.boundaryRef; axis.isContiguous = this.isContiguous; axis.positive = this.positive; axis.cache = new Variable.Cache(); // decouple cache return axis; }
/** * Make a copy, with an independent cache. * * @return copy of this CoordinateAxis */ public CoordinateAxis copyNoCache() { CoordinateAxis axis = new CoordinateAxis(ncd, getParentGroup(), getShortName(), getDataType(), getDimensionsString(), getUnitsString(), getDescription()); // other state axis.axisType = this.axisType; axis.boundaryRef = this.boundaryRef; axis.isContiguous = this.isContiguous; axis.positive = this.positive; axis.cache = new Variable.Cache(); // decouple cache return axis; }
/** * Make a copy, with an independent cache. * * @return copy of this CoordinateAxis */ public CoordinateAxis copyNoCache() { CoordinateAxis axis = new CoordinateAxis(ncd, getParentGroup(), getShortName(), getDataType(), getDimensionsString(), getUnitsString(), getDescription()); // other state axis.axisType = this.axisType; axis.boundaryRef = this.boundaryRef; axis.isContiguous = this.isContiguous; axis.positive = this.positive; axis.cache = new Variable.Cache(); // decouple cache return axis; }
private Element writeAxis2(CoordinateAxis axis, String name) { if (axis == null) return null; NcMLWriter ncmlWriter = new NcMLWriter(); Element varElem = new Element(name); varElem.setAttribute("name", axis.getFullName()); varElem.setAttribute("shape", getShapeString(axis.getShape())); // axis.getDimensionsString()); DataType dt = axis.getDataType(); varElem.setAttribute("type", dt.toString()); AxisType axisType = axis.getAxisType(); if (null != axisType) varElem.setAttribute("axisType", axisType.toString()); // attributes for (Attribute att : axis.getAttributes()) varElem.addContent(ncmlWriter.makeAttributeElement(att)); try { Element values = ncmlWriter.makeValuesElement(axis, false); values.setAttribute("npts", Long.toString(axis.getSize())); varElem.addContent(values); } catch (IOException e) { String message = String.format( "Couldn't read values for %s. Omitting <values> element.", axis.getFullName()); logger.warn(message, e); } return varElem; }
private Element writeAxis2(CoordinateAxis axis, String name) { if (axis == null) return null; Element varElem = new Element(name); varElem.setAttribute("name", axis.getFullName()); varElem.setAttribute("shape", getShapeString(axis.getShape())); // axis.getDimensionsString()); DataType dt = axis.getDataType(); varElem.setAttribute("type", dt.toString()); AxisType axisType = axis.getAxisType(); if (null != axisType) varElem.setAttribute("axisType", axisType.toString()); // attributes for (Attribute att : axis.getAttributes()) varElem.addContent(ucar.nc2.ncml.NcMLWriter.writeAttribute(att, "attribute", null)); Element values = ucar.nc2.ncml.NcMLWriter.writeValues(axis, null, false); values.setAttribute("npts", Long.toString(axis.getSize())); varElem.addContent(values); return varElem; }
private Element writeAxis(CoordinateAxis axis) { NcMLWriter ncmlWriter = new NcMLWriter(); Element varElem = new Element("axis"); varElem.setAttribute("name", axis.getFullName()); varElem.setAttribute("shape", getShapeString(axis.getShape())); // axis.getDimensionsString()); DataType dt = axis.getDataType(); varElem.setAttribute("type", dt.toString()); AxisType axisType = axis.getAxisType(); if (null != axisType) varElem.setAttribute("axisType", axisType.toString()); // attributes for (Attribute att : axis.getAttributes()) { varElem.addContent(ncmlWriter.makeAttributeElement(att)); } if (axis.getRank() == 1) { try { Element values = ncmlWriter.makeValuesElement(axis, true); varElem.addContent(values); } catch (IOException e) { String message = String.format( "Couldn't read values for %s. Omitting <values> element.", axis.getFullName()); logger.warn(message, e); } } return varElem; }
private Element writeAxis2(CoordinateAxis axis, String name) { if (axis == null) return null; Element varElem = new Element(name); varElem.setAttribute("name", axis.getFullName()); varElem.setAttribute("shape", getShapeString(axis.getShape())); // axis.getDimensionsString()); DataType dt = axis.getDataType(); varElem.setAttribute("type", dt.toString()); AxisType axisType = axis.getAxisType(); if (null != axisType) varElem.setAttribute("axisType", axisType.toString()); // attributes for (Attribute att : axis.getAttributes()) varElem.addContent(ucar.nc2.ncml.NcMLWriter.writeAttribute(att, "attribute", null)); Element values = ucar.nc2.ncml.NcMLWriter.writeValues(axis, null, false); values.setAttribute("npts", Long.toString(axis.getSize())); varElem.addContent(values); return varElem; }
DataType dtype = axis.getDataType(); if (dtype.isFloatingPoint()) { IndexIterator ii = data.getIndexIterator();
DataType dtype = axis.getDataType(); if (dtype.isFloatingPoint()) { IndexIterator ii = data.getIndexIterator();
DataType dtype = axis.getDataType(); if (dtype.isFloatingPoint()) { IndexIterator ii = data.getIndexIterator();
private Element writeAxis(CoordinateAxis axis) { Element varElem = new Element("axis"); varElem.setAttribute("name", axis.getFullName()); varElem.setAttribute("shape", getShapeString(axis.getShape())); // axis.getDimensionsString()); DataType dt = axis.getDataType(); varElem.setAttribute("type", dt.toString()); AxisType axisType = axis.getAxisType(); if (null != axisType) varElem.setAttribute("axisType", axisType.toString()); // attributes for (Attribute att : axis.getAttributes()) { varElem.addContent(ucar.nc2.ncml.NcMLWriter.writeAttribute(att, "attribute", null)); } if (axis.getRank() == 1) { Element values = ucar.nc2.ncml.NcMLWriter.writeValues(axis, null, true); //values.setAttribute("npts", Long.toString(axis.getSize())); varElem.addContent(values); } return varElem; }
private Element writeAxis(CoordinateAxis axis) { Element varElem = new Element("axis"); varElem.setAttribute("name", axis.getFullName()); varElem.setAttribute("shape", getShapeString(axis.getShape())); // axis.getDimensionsString()); DataType dt = axis.getDataType(); varElem.setAttribute("type", dt.toString()); AxisType axisType = axis.getAxisType(); if (null != axisType) varElem.setAttribute("axisType", axisType.toString()); // attributes for (Attribute att : axis.getAttributes()) { varElem.addContent(ucar.nc2.ncml.NcMLWriter.writeAttribute(att, "attribute", null)); } if (axis.getRank() == 1) { Element values = ucar.nc2.ncml.NcMLWriter.writeValues(axis, null, true); //values.setAttribute("npts", Long.toString(axis.getSize())); varElem.addContent(values); } return varElem; }