/** * Transform a NetcdfFile into a NetcdfDataset, optionally enhance it. * You must not use the original NetcdfFile after this call. * * @param ncfile NetcdfFile to transform, do not use independently after this. * @param mode set of enhance modes. If null, then none * @throws java.io.IOException on read error */ public NetcdfDataset(NetcdfFile ncfile, Set<Enhance> mode) throws IOException { super(ncfile); this.orgFile = ncfile; this.spi = null; // has a orgFile, not an iosp convertGroup(getRootGroup(), ncfile.getRootGroup()); finish(); // build global lists enhance(this, mode, null); }
/** * Transform a NetcdfFile into a NetcdfDataset, optionally enhance it. * You must not use the original NetcdfFile after this call. * * @param ncfile NetcdfFile to transform, do not use independently after this. * @param mode set of enhance modes. If null, then none * @throws java.io.IOException on read error */ public NetcdfDataset(NetcdfFile ncfile, Set<Enhance> mode) throws IOException { super(ncfile); this.orgFile = ncfile; this.spi = null; // has a orgFile, not an iosp convertGroup(getRootGroup(), ncfile.getRootGroup()); finish(); // build global lists enhance(this, mode, null); }
/** * Transform a NetcdfFile into a NetcdfDataset, optionally enhance it. * You must not use the original NetcdfFile after this call. * * @param ncfile NetcdfFile to transform, do not use independently after this. * @param mode set of enhance modes. If null, then none * @throws java.io.IOException on read error */ public NetcdfDataset(NetcdfFile ncfile, Set<Enhance> mode) throws IOException { super(ncfile); this.orgFile = ncfile; this.spi = null; // has a orgFile, not an iosp convertGroup(getRootGroup(), ncfile.getRootGroup()); finish(); // build global lists enhance(this, mode, null); }
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); } }
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); } }
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); } }