Codota Logo
VariableSimpleIF
Code IndexAdd Codota to your IDE (free)

How to use
VariableSimpleIF
in
ucar.nc2

Best Java code snippets using ucar.nc2.VariableSimpleIF (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/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: Unidata/thredds

public ucar.nc2.Attribute findAttributeIgnoreCase(String attName){
 return v.findAttributeIgnoreCase(attName);
}
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: edu.ucar/cdm

private void addDataVariables(List<VariableSimpleIF> list, Table t) {
 if (t.parent != null) addDataVariables(list, t.parent);
 for (VariableSimpleIF col : t.cols.values()) {
  if (t.nondataVars.contains(col.getFullName())) continue;
  if (t.nondataVars.contains(col.getShortName())) continue;  // fishy
  list.add(col);
 }
}
origin: Unidata/thredds

public ThreddsMetadata.VariableGroup extractVariables(FeatureDatasetPoint fd) {
 List<ThreddsMetadata.Variable> vars = new ArrayList<>();
 List<VariableSimpleIF> dataVars = fd.getDataVariables();
 if (dataVars == null)
  return null;
 for (VariableSimpleIF v : dataVars) {
  String name = v.getShortName();
  String desc = v.getDescription();
  String units = v.getUnitsString();
  String vname = null;
  String id = null;
  ucar.nc2.Attribute att = v.findAttributeIgnoreCase("standard_name");
  if (att != null)
   vname = att.getStringValue();
  vars.add(new ThreddsMetadata.Variable(name, desc, vname, units, id));
 }
 Collections.sort(vars);
                      // String vocab, String vocabHref, URI vocabUri, URI mapUri, List<Variable> variables
 return new ThreddsMetadata.VariableGroup("CF-1.0", null, null, vars);
}
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

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

 @Override
 public int compareTo(VariableSimpleIF o) {
  return name.compareTo(o.getShortName()); // ??
 }
}
origin: edu.ucar/cdm

public String getName() { return v.getFullName(); }
public String getShortName() { return v.getShortName(); }
origin: edu.ucar/netcdf

public List<Dimension> getDimensions() { return v.getDimensions(); }
public List<Attribute> getAttributes() { return v.getAttributes(); }
origin: edu.ucar/cdm

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

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

public List<Attribute> getAttributes() { return v.getAttributes(); }
public ucar.nc2.Attribute findAttributeIgnoreCase(String attName){
origin: Unidata/thredds

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

public int getRank() {  return v.getRank(); }
public int[] getShape() { return v.getShape(); }
origin: edu.ucar/netcdf

public int[] getShape() { return v.getShape(); }
public List<Dimension> getDimensions() { return v.getDimensions(); }
origin: edu.ucar/cdm

static public ThreddsMetadata.Variables extractVariables(FeatureDatasetPoint fd) {
 ThreddsMetadata.Variables vars = new ThreddsMetadata.Variables("CF-1.5");
 List<VariableSimpleIF> dataVars =  fd.getDataVariables();
 if (dataVars == null)
  return vars;
 for (VariableSimpleIF v : dataVars) {
  ThreddsMetadata.Variable tv = new ThreddsMetadata.Variable();
  vars.addVariable(tv);
  tv.setName(v.getShortName());
  tv.setDescription(v.getDescription());
  tv.setUnits(v.getUnitsString());
  ucar.nc2.Attribute att = v.findAttributeIgnoreCase("standard_name");
  if (att != null)
    tv.setVocabularyName(att.getStringValue());
 }
 vars.sort();
 return vars;
}
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: Unidata/thredds

public VariableSimpleIF getDataVariable(String shortName) {
 for (VariableSimpleIF s : dataVariables) {
  String ss = s.getShortName();
  if (shortName.equals(ss)) return s;
 }
 return null;
}
origin: Unidata/thredds

private void addDataVariables(List<VariableSimpleIF> list, Table t) {
 if (t.parent != null) addDataVariables(list, t.parent);
 for (VariableSimpleIF col : t.cols.values()) {
  if (t.nondataVars.contains(col.getFullName())) continue;
  if (t.nondataVars.contains(col.getShortName())) continue;  // fishy
  list.add(col);
 }
}
ucar.nc2VariableSimpleIF

Javadoc

A lightweight abstractions of a Variable.

Most used methods

  • 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.
  • getDataType
    Variable's data type
  • 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

  • Reactive rest calls using spring rest template
  • compareTo (BigDecimal)
  • getSharedPreferences (Context)
  • onCreateOptionsMenu (Activity)
  • InetAddress (java.net)
    This class represents an Internet Protocol (IP) address. An IP address is either a 32-bit or 128-bit
  • MalformedURLException (java.net)
    Thrown to indicate that a malformed URL has occurred. Either no legal protocol could be found in a s
  • Path (java.nio.file)
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Reference (javax.naming)
  • JTable (javax.swing)
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