Codota Logo
Group.getGroups
Code IndexAdd Codota to your IDE (free)

How to use
getGroups
method
in
ucar.nc2.Group

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

  • Common ways to obtain Group
private void myMethod () {
Group g =
  • Codota IconNetcdfFile ncfile;ncfile.getRootGroup()
  • Codota IconNetcdfFile ncfile;String str;ncfile.findGroup(str)
  • Codota IconVariable v;v.getParentGroup()
  • Smart code suggestions by Codota
}
origin: apache/tika

protected void unravelStringMet(NetcdfFile ncFile, Group group, Metadata met) {
  if (group == null) {
    group = ncFile.getRootGroup();
  }
  // get file type
  met.set("File-Type-Description", ncFile.getFileTypeDescription());
  // unravel its string attrs
  for (Attribute attribute : group.getAttributes()) {
    if (attribute.isString()) {
      met.add(attribute.getFullName(), attribute.getStringValue());
    } else {
      // try and cast its value to a string
      met.add(attribute.getFullName(), String.valueOf(attribute
          .getNumericValue()));
    }
  }
  for (Group g : group.getGroups()) {
    unravelStringMet(ncFile, g, met);
  }
}
origin: bcdev/beam

static Group findGroupNested(Group parent, String name) {
 for (Group g : parent.getGroups()) {
  if (g.getShortName().equals(name))
   return g;
 }
 for (Group g : parent.getGroups()) {
  Group result = findGroupNested(g, name);
  if (result != null)
   return result;
 }
 return null;
}
origin: Unidata/thredds

private Group findGroupNested(Group parent, String name) {
 for (Group g : parent.getGroups()) {
  if (g.getShortName().equals(name)) { return g; }
 }
 for (Group g : parent.getGroups()) {
  Group result = findGroupNested(g, name);
  if (result != null) { return result; }
 }
 return null;
}
origin: edu.ucar/cdm

private Group findGroupNested(Group parent, String name) {
 for (Group g : parent.getGroups()) {
  if (g.getShortName().equals(name))
   return g;
 }
 for (Group g : parent.getGroups()) {
  Group result = findGroupNested(g, name);
  if (result != null)
   return result;
 }
 return null;
}
origin: edu.ucar/netcdf

private Group findGroupNested(Group parent, String name) {
 for (Group g : parent.getGroups()) {
  if (g.getShortName().equals(name))
   return g;
 }
 for (Group g : parent.getGroups()) {
  Group result = findGroupNested(g, name);
  if (result != null)
   return result;
 }
 return null;
}
origin: edu.ucar/netcdf

private void augmentGroup(NetcdfDataset ds, Group g) {
 Variable crs = g.findVariable(HdfEos.HDFEOS_CRS);
 if (crs != null) augmentGroupWithProjectionInfo(ds, g);
 for (Group ng : g.getGroups())
  augmentGroup(ds, ng);
}
origin: edu.ucar/netcdf

public Variable findVariableByAttribute(Group g, String attName, String attValue) {
 if (g == null) g = getRootGroup();
 for (Variable v : variables) {
  for (Attribute att : v.getAttributes())
   if (attName.equals(att.getShortName()) && attValue.equals(att.getStringValue()))
    return v;
 }
 for (Group nested : g.getGroups()) {
  Variable v = findVariableByAttribute(nested, attName, attValue);
  if (v != null) return v;
 }
 return null;
}
origin: edu.ucar/cdm

private void augmentGroup(NetcdfDataset ds, Group g) {
 Variable crs = g.findVariable(HdfEos.HDFEOS_CRS);
 if (crs != null) augmentGroupWithProjectionInfo(ds, g);
 for (Group ng : g.getGroups())
  augmentGroup(ds, ng);
}
origin: Unidata/thredds

private void augmentGroup(NetcdfDataset ds, Group g) {
 Variable crs = g.findVariable(HdfEos.HDFEOS_CRS);
 if (crs != null) augmentGroupWithProjectionInfo(ds, g);
 for (Group ng : g.getGroups())
  augmentGroup(ds, ng);
}
origin: Unidata/thredds

public Variable findVariableByAttribute(Group g, String attName, String attValue) {
 if (g == null) g = getRootGroup();
 for (Variable v : g.getVariables()) {
  for (Attribute att : v.getAttributes())
   if (attName.equals(att.getShortName()) && attValue.equals(att.getStringValue()))
    return v;
 }
 for (Group nested : g.getGroups()) {
  Variable v = findVariableByAttribute(nested, attName, attValue);
  if (v != null) return v;
 }
 return null;
}
origin: edu.ucar/cdm

public Variable findVariableByAttribute(Group g, String attName, String attValue) {
 if (g == null) g = getRootGroup();
 for (Variable v : g.getVariables()) {
  for (Attribute att : v.getAttributes())
   if (attName.equals(att.getShortName()) && attValue.equals(att.getStringValue()))
    return v;
 }
 for (Group nested : g.getGroups()) {
  Variable v = findVariableByAttribute(nested, attName, attValue);
  if (v != null) return v;
 }
 return null;
}
origin: edu.ucar/netcdf

private void setImmutable(Group g) {
 for (Variable v : g.variables)
  v.setImmutable();
 for (Dimension d : g.dimensions)
  d.setImmutable();
 for (Group nested : g.getGroups())
  setImmutable(nested);
 g.setImmutable();
}
origin: edu.ucar/cdm

private void setImmutable(Group g) {
 for (Variable v : g.variables)
  v.setImmutable();
 for (Dimension d : g.dimensions)
  d.setImmutable();
 for (Group nested : g.getGroups())
  setImmutable(nested);
 g.setImmutable();
}
origin: Unidata/thredds

private void setImmutable(Group g) {
 for (Variable v : g.variables)
  v.setImmutable();
 for (Dimension d : g.dimensions)
  d.setImmutable();
 for (Group nested : g.getGroups())
  setImmutable(nested);
 g.setImmutable();
}
origin: edu.ucar/cdm

private void fixAttributes(Group g) {
 for (Variable v : g.getVariables()) {
  for (Attribute a : v.getAttributes()) {
   if (a.getShortName().equalsIgnoreCase("UNIT") || a.getShortName().equalsIgnoreCase("UNITS"))
    a.setShortName(CDM.UNITS);
   if (a.getShortName().equalsIgnoreCase("SCALE_FACTOR"))
    a.setShortName(CDM.SCALE_FACTOR);
   if (a.getShortName().equalsIgnoreCase("OFFSET"))
    a.setShortName(CDM.ADD_OFFSET);
  }
 }
 for (Group ng : g.getGroups()) {
  fixAttributes(ng);
 }
}
origin: edu.ucar/cdm

private static boolean checkGroup(Group g) {
 Variable crs = g.findVariable(HdfEos.HDFEOS_CRS);
 Group dataG = g.findGroup(DATA_GROUP);
 if (crs != null && dataG != null) {
  Attribute att = crs.findAttribute(HdfEos.HDFEOS_CRS_Projection);
  if (att == null) return false;
  if (!att.getStringValue().equals("GCTP_SNSOID") && !att.getStringValue().equals("GCTP_GEO")) return false;
  return !(dataG.findDimensionLocal(DIMX_NAME) == null || dataG.findDimensionLocal(DIMY_NAME) == null);
 }
 for (Group ng : g.getGroups()) {
  if (checkGroup(ng)) return true;
 }
 return false;
}
origin: senbox-org/s1tbx

public static void addGroups(final MetadataElement parentElem, final Group parentGroup) {
  final List<Group> groupList = parentGroup.getGroups();
  for (Group grp : groupList) {
    final MetadataElement newElem = new MetadataElement(grp.getShortName());
    parentElem.addElement(newElem);
    // recurse
    addGroups(newElem, grp);
  }
  addAttributes(parentElem, parentGroup);
}
origin: Unidata/thredds

void transferData(Group oldGroup) throws IOException, InvalidRangeException {
 for (Variable v : oldGroup.getVariables()) {
  if (!isRadial && v.getRank() >= 3) {
   invertOneVar(v);
  } else {
   System.out.printf("write %s%n",v.getNameAndDimensions());
   Array data = v.read();
   Variable nv = ncOut.findVariable(v.getFullName());
   ncOut.write(nv,  data);
  }
 }
 // recurse
 for (Group g : oldGroup.getGroups())
  transferData( g);
}
origin: Unidata/thredds

@Test
public void code6_assume_spherical() throws IOException {
  String filename = dir + "berkes.grb2";
  try (NetcdfFile ncfile = NetcdfFile.open(filename, null)) {
    Group grp = ncfile.getRootGroup().getGroups().get(0);
    Variable v = grp.findVariable("LatLon_Projection");
    Attribute axis = v.findAttribute("earth_radius");
    Assert.assertEquals(6371229., axis.getNumericValue().doubleValue(),
        0.1);
  }
}
origin: edu.ucar/cdm

private void convertGroup(Group g, Group from) {
 for (EnumTypedef et : from.getEnumTypedefs())
  g.addEnumeration(et);
 for (Dimension d : from.getDimensions())
  g.addDimension(new Dimension(d.getShortName(), d));
 for (Attribute a : from.getAttributes())
  g.addAttribute(a);
 for (Variable v : from.getVariables())
  g.addVariable(convertVariable(g, v));
 for (Group nested : from.getGroups()) {
  Group nnested = new Group(this, g, nested.getShortName());
  g.addGroup(nnested);
  convertGroup(nnested, nested);
 }
}
ucar.nc2GroupgetGroups

Javadoc

Get the Groups contained directly in this Group.

Popular methods of Group

  • findVariable
    Find the Variable with the specified (short) name in this group.
  • getAttributes
    Get the set of attributes contained directly in this Group.
  • getVariables
    Get the Variables contained directly in this group.
  • findAttribute
    Find an Attribute in this Group by its name.
  • findDimension
    Retrieve a Dimension using its (short) name. If it doesnt exist in this group, recursively look in p
  • getDimensions
    Get the Dimensions contained directly in this group.
  • <init>
    Constructor
  • addAttribute
    Add new Attribute; replace old if has same name.
  • getShortName
    Get the "short" name, unique within its parent Group.
  • addEnumeration
    Add an Enumeration
  • findGroup
    Retrieve the Group with the specified (short) name.
  • addGroup
    Add a nested Group
  • findGroup,
  • addGroup,
  • findEnumeration,
  • addDimension,
  • remove,
  • addVariable,
  • equals,
  • findAttributeIgnoreCase,
  • getEnumTypedefs

Popular in Java

  • Start an intent from android
  • getSharedPreferences (Context)
  • scheduleAtFixedRate (ScheduledExecutorService)
    Creates and executes a periodic action that becomes enabled first after the given initial delay, and
  • compareTo (BigDecimal)
    Compares this BigDecimal with the specified BigDecimal. Two BigDecimal objects that are equal in val
  • Thread (java.lang)
    A thread is a thread of execution in a program. The Java Virtual Machine allows an application to ha
  • DecimalFormat (java.text)
    DecimalFormat is a concrete subclass ofNumberFormat that formats decimal numbers. It has a variety o
  • BitSet (java.util)
    This class implements a vector of bits that grows as needed. Each component of the bit set has a boo
  • JButton (javax.swing)
  • JFileChooser (javax.swing)
  • 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