congrats Icon
New! Announcing our next generation AI code completions
Read here
Tabnine Logo
VariableSimpleIF.getDataType
Code IndexAdd Tabnine to your IDE (free)

How to use
getDataType
method
in
ucar.nc2.VariableSimpleIF

Best Java code snippets using ucar.nc2.VariableSimpleIF.getDataType (Showing top 20 results out of 315)

origin: edu.ucar/netcdf

public DataType getDataType() { return v.getDataType(); }
public String getDescription() { return v.getDescription(); }
origin: Unidata/thredds

public DataType getDataType() { return v.getDataType(); }
public String getDescription() { return v.getDescription(); }
origin: edu.ucar/cdm

public DataType getDataType() { return v.getDataType(); }
public String getDescription() { return v.getDescription(); }
origin: edu.ucar/cdm

private Element writeVariable(VariableSimpleIF v) {
 Element varElem = new Element("variable");
 varElem.setAttribute("name", v.getShortName());
 ucar.ma2.DataType dt = v.getDataType();
 if (dt != null)
  varElem.setAttribute("type", dt.toString());
 // attributes
 Iterator atts = v.getAttributes().iterator();
 while (atts.hasNext()) {
  ucar.nc2.Attribute att = (ucar.nc2.Attribute) atts.next();
  varElem.addContent(ucar.nc2.ncml.NcMLWriter.writeAttribute(att, "attribute", null));
 }
 return varElem;
}
origin: edu.ucar/netcdf

private Element writeVariable(VariableSimpleIF v) {
 Element varElem = new Element("variable");
 varElem.setAttribute("name", v.getShortName());
 ucar.ma2.DataType dt = v.getDataType();
 if (dt != null)
  varElem.setAttribute("type", dt.toString());
 // attributes
 Iterator atts = v.getAttributes().iterator();
 while (atts.hasNext()) {
  ucar.nc2.Attribute att = (ucar.nc2.Attribute) atts.next();
  varElem.addContent(ucar.nc2.ncml.NcMLWriter.writeAttribute(att, "attribute", null));
 }
 return varElem;
}
origin: edu.ucar/cdm

protected void addExtraVariables() throws IOException {
 if (extra == null) return;
 if (extraMap == null) extraMap = new HashMap<>();
 addDimensionsClassic(extra, dimMap);
 for (VariableSimpleIF vs : extra) {
  List<Dimension> dims = makeDimensionList(dimMap, vs.getDimensions());
  Variable mv = writer.addVariable(null, vs.getShortName(), vs.getDataType(), dims);
  for (Attribute att : vs.getAttributes())
   mv.addAttribute(att);
  extraMap.put(mv.getShortName(), mv);
 }
}
origin: Unidata/thredds

protected void addExtraVariables() throws IOException {
 if (extra == null) return;
 if (extraMap == null) extraMap = new HashMap<>();
 addDimensionsClassic(extra, dimMap);
 for (VariableSimpleIF vs : extra) {
  List<Dimension> dims = makeDimensionList(dimMap, vs.getDimensions());
  Variable mv = writer.addVariable(null, vs.getShortName(), vs.getDataType(), dims);
  for (Attribute att : vs.getAttributes())
   mv.addAttribute(att);
  extraMap.put(mv.getShortName(), mv);
 }
}
origin: Unidata/thredds

private Element writeVariable(VariableSimpleIF v) {
 NcMLWriter ncmlWriter = new NcMLWriter();
 Element varElem = new Element("variable");
 varElem.setAttribute("name", v.getShortName());
 ucar.ma2.DataType dt = v.getDataType();
 if (dt != null)
  varElem.setAttribute("type", dt.toString());
 // attributes
 Iterator atts = v.getAttributes().iterator();
 while (atts.hasNext()) {
  ucar.nc2.Attribute att = (ucar.nc2.Attribute) atts.next();
  varElem.addContent(ncmlWriter.makeAttributeElement(att));
 }
 return varElem;
}
origin: Unidata/thredds

protected void addCoordinatesExtended(Structure parent, List<VariableSimpleIF> coords) throws IOException {
 for (VariableSimpleIF vs : coords) {
  String dims = Dimension.makeDimensionsString(vs.getDimensions());
  Variable member = writer.addStructureMember(parent, vs.getShortName(), vs.getDataType(), dims);
  if (member == null) {
   logger.warn("Variable already exists =" + vs.getShortName());  // LOOK barf
   continue;
  }
  for (Attribute att : vs.getAttributes())
   member.addAttribute(att);
 }
}
origin: Unidata/thredds

protected void replaceDataVars(StructureMembers sm) {
 for (StructureMembers.Member m : sm.getMembers()) {
  VariableSimpleIF org = this.cols.get(m.getName());
  int rank = org.getRank();
  List<Dimension> orgDims = org.getDimensions();
  // only keep the last n
  int n = m.getShape().length;
  List<Dimension> dims = orgDims.subList(rank-n, rank);
  VariableSimpleImpl result = new VariableSimpleImpl(org.getShortName(), org.getDescription(), org.getUnitsString(), org.getDataType(), dims);
  for (Attribute att : org.getAttributes()) result.add(att);
  this.cols.put(m.getName(), result);
 }
}
origin: edu.ucar/cdm

protected void addCoordinatesExtended(Structure parent, List<VariableSimpleIF> coords) throws IOException {
 for (VariableSimpleIF vs : coords) {
  String dims = Dimension.makeDimensionsString(vs.getDimensions());
  Variable member = writer.addStructureMember(parent, vs.getShortName(), vs.getDataType(), dims);
  if (member == null) {
   logger.warn("Variable already exists =" + vs.getShortName());  // LOOK barf
   continue;
  }
  for (Attribute att : vs.getAttributes())
   member.addAttribute(att);
 }
 parent.calcElementSize();
}
origin: edu.ucar/cdm

static public VariableSimpleImpl changeShape(VariableSimpleIF proxy, List<Dimension> dims) {
 VariableSimpleImpl result = new VariableSimpleImpl(proxy.getShortName(), proxy.getDescription(), proxy.getUnitsString(), proxy.getDataType(), dims);
 for (Attribute att : proxy.getAttributes()) result.add(att);
 return result;
}
origin: edu.ucar/cdm

private void createDataVariables(List<VariableSimpleIF> dataVars) throws IOException {
 // find all dimensions needed by the data variables
 for (VariableSimpleIF var : dataVars) {
  List<Dimension> dims = var.getDimensions();
  dimSet.addAll(dims);
 }
 // add them
 for (Dimension d : dimSet) {
  if (!d.isUnlimited())
   ncfile.addDimension(d.getShortName(), d.getLength(), d.isShared(), false, d.isVariableLength());
 }
 // add the data variables all using the record dimension
 for (VariableSimpleIF oldVar : dataVars) {
  List<Dimension> dims = oldVar.getDimensions();
  StringBuilder dimNames = new StringBuilder(recordDimName);
  for (Dimension d : dims) {
   if (!d.isUnlimited())
    dimNames.append(" ").append(d.getShortName());
  }
  Variable newVar = ncfile.addVariable(oldVar.getShortName(), oldVar.getDataType(), dimNames.toString());
  List<Attribute> atts = oldVar.getAttributes();
  for (Attribute att : atts) {
   ncfile.addVariableAttribute(newVar, att);
  }
 }
}
origin: edu.ucar/cdm

protected void addCoordinatesClassic(Dimension recordDim, List<VariableSimpleIF> coords, Map<String, Variable> varMap) throws IOException {
 addDimensionsClassic(coords, dimMap);
 for (VariableSimpleIF oldVar : coords) {
  List<Dimension> dims = makeDimensionList(dimMap, oldVar.getDimensions());
  dims.add(0, recordDim);
  Variable newVar;
  if (oldVar.getDataType().equals(DataType.STRING)  && !writer.getVersion().isExtendedModel()) {
   if (oldVar instanceof Variable)
    newVar = writer.addStringVariable(null, (Variable) oldVar, dims);
   else
    newVar = writer.addStringVariable(null, oldVar.getShortName(), dims, 20); // LOOK barf
  } else {
   newVar = writer.addVariable(null, oldVar.getShortName(), oldVar.getDataType(), dims);
  }
  if (newVar == null) {
   logger.warn("Variable already exists =" + oldVar.getShortName());  // LOOK barf
   continue;
  }
  for (Attribute att : oldVar.getAttributes())
   newVar.addAttribute(att);
  varMap.put(newVar.getShortName(), newVar);
 }
}
origin: edu.ucar/cdm

public PointObVar(VariableSimpleIF v) {
 setName(v.getShortName());
 setUnits(v.getUnitsString());
 setDesc(v.getDescription());
 setDataType(v.getDataType());
 //if (v.getRank() > 0) setLen( v.getShape()[0]);
}
origin: edu.ucar/netcdf

public PointObVar(VariableSimpleIF v) {
 setName(v.getShortName());
 setUnits(v.getUnitsString());
 setDesc(v.getDescription());
 setDataType(v.getDataType());
 //if (v.getRank() > 0) setLen( v.getShape()[0]);
}
origin: Unidata/thredds

public PointObVar(VariableSimpleIF v) {
 setName(v.getShortName());
 setUnits(v.getUnitsString());
 setDesc(v.getDescription());
 setDataType(v.getDataType());
 //if (v.getRank() > 0) setLen( v.getShape()[0]);
}
origin: edu.ucar/cdm

private Element writeVariable(VariableSimpleIF v) {
 Element varElem = new Element("variable");
 varElem.setAttribute("name", v.getShortName());
 ucar.ma2.DataType dt = v.getDataType();
 if (dt != null)
  varElem.setAttribute("type", dt.toString());
 // attributes
 for (Attribute att : v.getAttributes()) {
  varElem.addContent(NcMLWriter.writeAttribute(att, "attribute", null));
 }
 return varElem;
}
origin: edu.ucar/netcdf

private Element writeVariable(VariableSimpleIF v) {
 Element varElem = new Element("variable");
 varElem.setAttribute("name", v.getShortName());
 ucar.ma2.DataType dt = v.getDataType();
 if (dt != null)
  varElem.setAttribute("type", dt.toString());
 // attributes
 for (Attribute att : v.getAttributes()) {
  varElem.addContent(NcMLWriter.writeAttribute(att, "attribute", null));
 }
 return varElem;
}
origin: Unidata/thredds

private Element writeVariable(VariableSimpleIF v) {
 NcMLWriter ncMLWriter = new NcMLWriter();
 Element varElem = new Element("variable");
 varElem.setAttribute("name", v.getShortName());
 ucar.ma2.DataType dt = v.getDataType();
 if (dt != null)
  varElem.setAttribute("type", dt.toString());
 // attributes
 for (Attribute att : v.getAttributes()) {
  varElem.addContent(ncMLWriter.makeAttributeElement(att));
 }
 return varElem;
}
ucar.nc2VariableSimpleIFgetDataType

Javadoc

Variable's data type

Popular methods of VariableSimpleIF

  • getShortName
    short name of the data Variable
  • getDescription
    description of the Variable
  • getUnitsString
    Units of the Variable. These should be udunits compatible if possible
  • findAttributeIgnoreCase
    find the attribute for the variable with the given name, ignoring case.
  • getAttributes
    Attributes for the variable.
  • getDimensions
    Dimension List. empty for a scalar variable.
  • getFullName
    full, backslash escaped name of the data Variable
  • getRank
    Variable rank
  • getShape
    Variable shape

Popular in Java

  • Start an intent from android
  • onCreateOptionsMenu (Activity)
  • onRequestPermissionsResult (Fragment)
  • getSystemService (Context)
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • JList (javax.swing)
  • Logger (org.slf4j)
    The org.slf4j.Logger interface is the main user entry point of SLF4J API. It is expected that loggin
  • Top 15 Vim Plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyStudentsTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now