Java Code Examples for ucar.nc2.Variable#getDimensionsString()
The following examples show how to use
ucar.nc2.Variable#getDimensionsString() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FmrcDataset.java From netcdf-java with BSD 3-Clause "New" or "Revised" License | 4 votes |
private void transferGroup(Group srcGroup, Group targetGroup, NetcdfDataset target) throws IOException { // group attributes DatasetConstructor.transferGroupAttributes(srcGroup, targetGroup); // dimensions for (Dimension d : srcGroup.getDimensions()) { if (null == targetGroup.findDimensionLocal(d.getShortName())) { Dimension newd = new Dimension(d.getShortName(), d.getLength(), d.isShared(), d.isUnlimited(), d.isVariableLength()); targetGroup.addDimension(newd); } } // transfer variables - eliminate any references to component files for (Variable v : srcGroup.getVariables()) { Variable targetV = targetGroup.findVariableLocal(v.getShortName()); if (null == targetV) { // add it if (v instanceof Structure) { targetV = new StructureDS(target, targetGroup, null, v.getShortName(), v.getDimensionsString(), v.getUnitsString(), v.getDescription()); // LOOK - not adding the members here - what to do ?? } else { targetV = new VariableDS(target, targetGroup, null, v.getShortName(), v.getDataType(), v.getDimensionsString(), v.getUnitsString(), v.getDescription()); } DatasetConstructor.transferVariableAttributes(v, targetV); VariableDS vds = (VariableDS) v; targetV.setSPobject(vds); // temporary, for non-agg variables when proto is made if (vds.hasCachedDataRecurse()) { if (vds.getSize() > 1000 * 1000) { boolean wtf = vds.hasCachedDataRecurse(); } targetV.setCachedData(vds.read()); // } targetGroup.addVariable(targetV); } } // nested groups - check if target already has it for (Group srcNested : srcGroup.getGroups()) { Group nested = targetGroup.findGroupLocal(srcNested.getShortName()); if (null == nested) { nested = new Group(target, targetGroup, srcNested.getShortName()); targetGroup.addGroup(nested); for (EnumTypedef et : srcNested.getEnumTypedefs()) { targetGroup.addEnumeration(et); } } transferGroup(srcNested, nested, target); } }