public boolean isValidFile(RandomAccessFile raf) throws IOException { return H4header.isValidFile(raf); }
Tag tag = tagMap.get(tagid(tagGroup.elem_ref[i], tagGroup.elem_tag[i])); if (tag == null) { log.error("Reference tag missing= " + tagGroup.elem_ref[i] + "/" + tagGroup.elem_tag[i] +" for group "+tagGroup.refno); Variable v = tag.vinfo.v; if (v != null) addVariableToGroup(group, v, tag); else log.error("Missing variable " + tag.refno); TagVH vh = (TagVH) tag; if (vh.className.startsWith("Att")) { Attribute att = makeAttribute(vh); if (null != att) group.addAttribute(att); } else if (tag.vinfo != null) { Variable v = tag.vinfo.v; addVariableToGroup(group, v, tag); TagVGroup vg = (TagVGroup) tag; if ((vg.group != null) && (vg.group.getParentGroup() == ncfile.getRootGroup())) { addGroupToGroup(group, vg.group, vg); vg.group.setParentGroup(group); } else { Group nested = makeGroup(vg, group); // danger - loops if (nested != null) addGroupToGroup(group, nested, vg);
private void findUsedDimensions(Group parent, Map<Dimension, List<Variable>> dimUsedMap) { for (Variable v : parent.getVariables()) { for (Dimension d : v.getDimensions()) { if (!d.isShared()) continue; List<Variable> vlist = dimUsedMap.get(d); if (vlist == null) { vlist = new ArrayList<>(); dimUsedMap.put(d, vlist); } vlist.add(v); } } for (Group g : parent.getGroups()) findUsedDimensions(g, dimUsedMap); }
memTracker = new MemTracker(actualSize); if (!isValidFile(myRaf)) throw new IOException("Not an HDF4 file "); long link = raf.getFilePointer(); while (link > 0) link = readDDH(alltags, link); tagMap.put(tagid(tag.refno, tag.code), tag); // track all tags in a map, key is the "tag id". if (debugTag1) System.out.println(debugTagDetail ? tag.detail() : tag); construct(ncfile, alltags); adjustDimensions(); String history = ncfile.findAttValueIgnoreCase(null, "_History", ""); ncfile.addAttribute(null, new Attribute("_History", history + "; HDF-EOS StructMetadata information was read"));
Variable v = makeImage((TagGroup) t); if (v != null) vars.add(v); TagVGroup vgroup = (TagVGroup) t; if (vgroup.className.startsWith("Dim") || vgroup.className.startsWith("UDim")) makeDimension(vgroup); Variable v = makeVariable(vgroup); if (v != null) vars.add(v); addGlobalAttributes(vgroup); TagVH tagVH = (TagVH) t; if (tagVH.className.startsWith("Data")) { Variable v = makeVariable(tagVH); if (v != null) vars.add(v); Variable v = makeVariable((TagGroup) t); if (v != null) vars.add(v); TagVH vh = (TagVH) t; if (!vh.className.startsWith("Att") && !vh.className.startsWith("_HDF_CHK_TBL")) { Variable v = makeVariable(vh); if (v != null) vars.add(v); Group g = makeGroup(vgroup, null); if (g != null) groups.add(g);
List<Dimension> dims = new ArrayList<Dimension>(); for (int i = 0; i < group.nelems; i++) { Tag tag = tagMap.get(tagid(group.elem_ref[i], group.elem_tag[i])); if (tag == null) { log.error("Reference tag missing= " + group.elem_ref[i] + "/" + group.elem_tag[i]); addVariableAttributes(group, vinfo);
@AfterClass static public void after() { H4header.setDebugFlags(new DebugFlagsImpl("")); // make sure debug flags are off }
private long readDDH(List<Tag> alltags, long start) throws IOException { raf.seek(start); int ndd = DataType.unsignedShortToInt(raf.readShort()); // number of DD blocks long link = DataType.unsignedIntToLong(raf.readInt()); // point to the next DDH; link == 0 means no more if (debugDD) System.out.println(" DDHeader ndd=" + ndd + " link=" + link); long pos = raf.getFilePointer(); for (int i = 0; i < ndd; i++) { raf.seek(pos); Tag tag = factory(); pos += 12; // tag usually changed the file pointer if (tag.code > 1) alltags.add(tag); } memTracker.add("DD block", start, raf.getFilePointer()); return link; }
memTracker = new MemTracker(actualSize); if (!isValidFile(myRaf)) throw new IOException("Not an HDF4 file "); long link = raf.getFilePointer(); while (link > 0) link = readDDH(alltags, link); tagMap.put(tagid(tag.refno, tag.code), tag); // track all tags in a map, key is the "tag id". if (debugTag1) System.out.println(debugTagDetail ? tag.detail() : tag); construct(ncfile, alltags); adjustDimensions(); String history = ncfile.findAttValueIgnoreCase(null, "_History", ""); ncfile.addAttribute(null, new Attribute("_History", history + "; HDF-EOS StructMetadata information was read"));
Variable v = makeImage((TagGroup) t); if (v != null) vars.add(v); TagVGroup vgroup = (TagVGroup) t; if (vgroup.className.startsWith("Dim") || vgroup.className.startsWith("UDim")) makeDimension(vgroup); Variable v = makeVariable(vgroup); if (v != null) vars.add(v); addGlobalAttributes(vgroup); TagVH tagVH = (TagVH) t; if (tagVH.className.startsWith("Data")) { Variable v = makeVariable(tagVH); if (v != null) vars.add(v); Variable v = makeVariable((TagGroup) t); if (v != null) vars.add(v); TagVH vh = (TagVH) t; if (!vh.className.startsWith("Att") && !vh.className.startsWith("_HDF_CHK_TBL")) { Variable v = makeVariable(vh); if (v != null) vars.add(v); Group g = makeGroup(vgroup, null); if (g != null) groups.add(g);
List<Dimension> dims = new ArrayList<>(); for (int i = 0; i < group.nelems; i++) { Tag tag = tagMap.get(tagid(group.elem_ref[i], group.elem_tag[i])); if (tag == null) { log.error("Reference tag missing= " + group.elem_ref[i] + "/" + group.elem_tag[i]); addVariableAttributes(group, vinfo);
static public void setDebugFlags(ucar.nc2.util.DebugFlags debugFlag) { debug = debugFlag.isSet("H5iosp/read"); debugPos = debugFlag.isSet("H5iosp/filePos"); debugHeap = debugFlag.isSet("H5iosp/Heap"); debugFilter = debugFlag.isSet("H5iosp/filter"); debugFilterIndexer = debugFlag.isSet("H5iosp/filterIndexer"); debugChunkIndexer = debugFlag.isSet("H5iosp/chunkIndexer"); debugVlen = debugFlag.isSet("H5iosp/vlen"); H5header.setDebugFlags(debugFlag); H4header.setDebugFlags(debugFlag); if(debugFilter) H5tiledLayoutBB.debugFilter = debugFilter; }
private long readDDH(List<Tag> alltags, long start) throws IOException { raf.seek(start); int ndd = DataType.unsignedShortToInt(raf.readShort()); // number of DD blocks long link = DataType.unsignedIntToLong(raf.readInt()); // point to the next DDH; link == 0 means no more if (debugDD) System.out.println(" DDHeader ndd=" + ndd + " link=" + link); long pos = raf.getFilePointer(); for (int i = 0; i < ndd; i++) { raf.seek(pos); Tag tag = factory(); pos += 12; // tag usually changed the file pointer if (tag.code > 1) alltags.add(tag); } memTracker.add("DD block", start, raf.getFilePointer()); return link; }
memTracker = new MemTracker(actualSize); if (!isValidFile(myRaf)) throw new IOException("Not an HDF4 file "); long link = raf.getFilePointer(); while (link > 0) link = readDDH(alltags, link); tagMap.put(tagid(tag.refno, tag.code), tag); // track all tags in a map, key is the "tag id". if (debugTag1) System.out.println(debugTagDetail ? tag.detail() : tag); construct(ncfile, alltags); adjustDimensions(); String history = ncfile.findAttValueIgnoreCase(null, "_History", ""); ncfile.addAttribute(null, new Attribute("_History", history + "; HDF-EOS StructMetadata information was read"));
Tag tag = tagMap.get(tagid(tagGroup.elem_ref[i], tagGroup.elem_tag[i])); if (tag == null) { log.error("Reference tag missing= " + tagGroup.elem_ref[i] + "/" + tagGroup.elem_tag[i] +" for group "+tagGroup.refno); Variable v = tag.vinfo.v; if (v != null) addVariableToGroup(group, v, tag); else log.error("Missing variable " + tag.refno); TagVH vh = (TagVH) tag; if (vh.className.startsWith("Att")) { Attribute att = makeAttribute(vh); if (null != att) group.addAttribute(att); } else if (tag.vinfo != null) { Variable v = tag.vinfo.v; addVariableToGroup(group, v, tag); TagVGroup vg = (TagVGroup) tag; if ((vg.group != null) && (vg.group.getParentGroup() == ncfile.getRootGroup())) { addGroupToGroup(group, vg.group, vg); vg.group.setParentGroup(group); } else { Group nested = makeGroup(vg, group); // danger - loops if (nested != null) addGroupToGroup(group, nested, vg);
Variable v = makeImage((TagGroup) t); if (v != null) vars.add(v); TagVGroup vgroup = (TagVGroup) t; if (vgroup.className.startsWith("Dim") || vgroup.className.startsWith("UDim")) makeDimension(vgroup); Variable v = makeVariable(vgroup); if (v != null) vars.add(v); addGlobalAttributes(vgroup); TagVH tagVH = (TagVH) t; if (tagVH.className.startsWith("Data")) { Variable v = makeVariable(tagVH); if (v != null) vars.add(v); Variable v = makeVariable((TagGroup) t); if (v != null) vars.add(v); TagVH vh = (TagVH) t; if (!vh.className.startsWith("Att") && !vh.className.startsWith("_HDF_CHK_TBL")) { Variable v = makeVariable(vh); if (v != null) vars.add(v); Group g = makeGroup(vgroup, null); if (g != null) groups.add(g);
List<Dimension> dims = new ArrayList<Dimension>(); for (int i = 0; i < group.nelems; i++) { Tag tag = tagMap.get(tagid(group.elem_ref[i], group.elem_tag[i])); if (tag == null) { log.error("Reference tag missing= " + group.elem_ref[i] + "/" + group.elem_tag[i]); addVariableAttributes(group, vinfo);
static public void setDebugFlags(ucar.nc2.util.DebugFlags debugFlag) { debug = debugFlag.isSet("H5iosp/read"); debugPos = debugFlag.isSet("H5iosp/filePos"); debugHeap = debugFlag.isSet("H5iosp/Heap"); debugFilter = debugFlag.isSet("H5iosp/filter"); debugFilterIndexer = debugFlag.isSet("H5iosp/filterIndexer"); debugChunkIndexer = debugFlag.isSet("H5iosp/chunkIndexer"); debugVlen = debugFlag.isSet("H5iosp/vlen"); skipEos = debugFlag.isSet("HdfEos/turnOff"); H5header.setDebugFlags(debugFlag); H4header.setDebugFlags(debugFlag); }
public boolean isValidFile(RandomAccessFile raf) throws IOException { return H4header.isValidFile(raf); }
private void findUsedDimensions(Group parent, Map<Dimension, List<Variable>> dimUsedMap) { for (Variable v : parent.getVariables()) { for (Dimension d : v.getDimensions()) { if (!d.isShared()) continue; List<Variable> vlist = dimUsedMap.get(d); if (vlist == null) { vlist = new ArrayList<Variable>(); dimUsedMap.put(d, vlist); } vlist.add(v); } } for (Group g : parent.getGroups()) findUsedDimensions(g, dimUsedMap); }