Codota Logo
VariableSimpleIF.getDataType
Code IndexAdd Codota 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)

  • Common ways to obtain VariableSimpleIF
private void myMethod () {
VariableSimpleIF v =
  • Codota IconIterator iterator;(VariableSimpleIF) iterator.next()
  • Codota IconHashMap hashMap;Object key;(VariableSimpleIF) hashMap.get(key)
  • Codota IconTrajectoryObsDataset trajectoryObsDataset;String str;trajectoryObsDataset.getDataVariable(str)
  • Smart code suggestions by Codota
}
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

  • Creating JSON documents from java classes using gson
  • setScale (BigDecimal)
  • getContentResolver (Context)
  • findViewById (Activity)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • ConcurrentHashMap (java.util.concurrent)
    A hash table supporting full concurrency of retrievals and adjustable expected concurrency for updat
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now