/** * Returns the data type which most closely represents the "raw" internal data of the variable. * This is the value returned by the default implementation of {@link * NetcdfImageReader#getRawDataType}. * * @param variable The variable. * @return The data type, or {@link DataBuffer#TYPE_UNDEFINED} if unknown. * @see NetcdfImageReader#getRawDataType */ public static int getRawDataType(final VariableIF variable) { VariableDS ds = (VariableDS) variable; final DataType type; if (Boolean.getBoolean(ENHANCE_SCALE_MISSING)) { type = ds.getDataType(); } else { type = ds.getOriginalDataType(); } return transcodeNetCDFDataType(type, variable.isUnsigned()); }
/** * get the data type */ public DataType getDataType() { return vs.getDataType(); }
/** * get the data type */ public DataType getDataType() { return vs.getDataType(); }
/** * When this wraps another Variable, get the original Variable's DataType. * @return original Variable's DataType, or current data type if it doesnt wrap anothe rvariable */ public DataType getOriginalDataType() { return orgDataType != null ? orgDataType : getDataType(); }
/** * get the data type */ public DataType getDataType() { return vs.getDataType(); }
/** * When this wraps another Variable, get the original Variable's DataType. * @return original Variable's DataType, or current data type if it doesnt wrap anothe rvariable */ public DataType getOriginalDataType() { return orgDataType != null ? orgDataType : getDataType(); }
/** * When this wraps another Variable, get the original Variable's DataType. * * @return original Variable's DataType, or current data type if it doesnt wrap another variable */ public DataType getOriginalDataType() { return orgDataType != null ? orgDataType : getDataType(); }
@Override public boolean isString() { return varTop.getDataType().isString(); }
@Override public boolean isString() { return coordVar.getDataType().isString(); }
@Override public boolean isInt() { return varTop.getDataType().isIntegral(); }
public String getCoordValueString(StructureData sdata) { if (coordVar.getDataType().isString()) return sdata.getScalarString(axisName); else if (coordVar.getDataType().isIntegral()) return Integer.toString(sdata.convertScalarInt(axisName)); else return Double.toString(sdata.convertScalarDouble(axisName)); }
public String getCoordValueString(StructureData sdata) { if (coordVar.getDataType().isString()) return sdata.getScalarString(memberName); else if (coordVar.getDataType().isIntegral()) return Integer.toString(sdata.convertScalarInt(memberName)); else return Double.toString(sdata.convertScalarDouble(memberName)); }
@Override public String getCoordValueString(StructureData sdata) { if (coordVar.getDataType().isString()) return sdata.getScalarString(memberName); else if (coordVar.getDataType().isIntegral()) return Integer.toString(sdata.convertScalarInt(memberName)); else return Double.toString(sdata.convertScalarDouble(memberName)); }
/** * Return Array with missing data * @param shape of this shape * @return Array with given shape */ public Array getMissingDataArray(int[] shape) { Object data = scaleMissingProxy.getFillValue( getDataType()); return Array.factoryConstant( dataType.getPrimitiveClassType(), shape, data); }
/** * Return Array with missing data * @param shape of this shape * @return Array with given shape */ public Array getMissingDataArray(int[] shape) { Object data = scaleMissingProxy.getFillValue( getDataType()); return Array.factoryConstant( dataType.getPrimitiveClassType(), shape, data); }
static public CoordinateAxis1DTime factory(NetcdfDataset ncd, VariableDS org, Formatter errMessages) throws IOException { if (org instanceof CoordinateAxis1DTime) return (CoordinateAxis1DTime) org; if (org.getDataType() == DataType.CHAR) return new CoordinateAxis1DTime(ncd, org, errMessages, org.getDimension(0).getShortName()); else if (org.getDataType() == DataType.STRING) return new CoordinateAxis1DTime(ncd, org, errMessages, org.getDimensionsString()); else return new CoordinateAxis1DTime(ncd, org, errMessages); }
static public CoordinateAxis1DTime factory(NetcdfDataset ncd, VariableDS org, Formatter errMessages) throws IOException { if (org.getDataType() == DataType.CHAR) return new CoordinateAxis1DTime(ncd, org, errMessages, org.getDimension(0).getShortName()); else if (org.getDataType() == DataType.STRING) return new CoordinateAxis1DTime(ncd, org, errMessages, org.getDimensionsString()); else return new CoordinateAxis1DTime(ncd, org, errMessages); }
static public CoordinateAxis1DTime factory(NetcdfDataset ncd, VariableDS org, Formatter errMessages) throws IOException { if (org instanceof CoordinateAxis1DTime) return (CoordinateAxis1DTime) org; if (org.getDataType() == DataType.CHAR) return new CoordinateAxis1DTime(ncd, org, errMessages, org.getDimension(0).getShortName()); else if (org.getDataType() == DataType.STRING) return new CoordinateAxis1DTime(ncd, org, errMessages, org.getDimensionsString()); else return new CoordinateAxis1DTime(ncd, org, errMessages); }
public void check(Formatter f) { for (Variable v : getVariables()) { VariableDS vds = (VariableDS) v; if (vds.getOriginalDataType() != vds.getDataType()) { f.format("Variable %s has type %s, org = %s%n", vds.getFullName(), vds.getOriginalDataType(), vds.getDataType()); } if (vds.getOriginalVariable() != null) { Variable orgVar = vds.getOriginalVariable(); if (orgVar.getRank() != vds.getRank()) f.format("Variable %s has rank %d, org = %d%n", vds.getFullName(), vds.getRank(), orgVar.getRank()); } } }
public void check(Formatter f) { for (Variable v : getVariables()) { VariableDS vds = (VariableDS) v; if (vds.getOriginalDataType() != vds.getDataType()) { f.format("Variable %s has type %s, org = %s%n", vds.getFullName(), vds.getOriginalDataType(), vds.getDataType()); } if (vds.getOriginalVariable() != null) { Variable orgVar = vds.getOriginalVariable(); if (orgVar.getRank() != vds.getRank()) f.format("Variable %s has rank %d, org = %d%n", vds.getFullName(), vds.getRank(), orgVar.getRank()); } } }