Tabnine Logo
H4header
Code IndexAdd Tabnine to your IDE (free)

How to use
H4header
in
ucar.nc2.iosp.hdf4

Best Java code snippets using ucar.nc2.iosp.hdf4.H4header (Showing top 20 results out of 315)

origin: edu.ucar/cdm

public boolean isValidFile(RandomAccessFile raf) throws IOException {
 return H4header.isValidFile(raf);
}
origin: edu.ucar/netcdf

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);
origin: Unidata/thredds

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);
}
origin: Unidata/thredds

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"));
origin: Unidata/thredds

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);
origin: edu.ucar/cdm

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);
origin: Unidata/thredds

@AfterClass
static public void after() {
 H4header.setDebugFlags(new DebugFlagsImpl(""));  // make sure debug flags are off
}
origin: edu.ucar/netcdf

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;
}
origin: edu.ucar/netcdf

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"));
origin: edu.ucar/cdm

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);
origin: Unidata/thredds

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);
origin: Unidata/thredds

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;
}
origin: Unidata/thredds

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;
}
origin: edu.ucar/cdm

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"));
origin: edu.ucar/cdm

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);
origin: edu.ucar/netcdf

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);
origin: edu.ucar/netcdf

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);
origin: edu.ucar/cdm

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);
}
origin: edu.ucar/netcdf

public boolean isValidFile(RandomAccessFile raf) throws IOException {
 return H4header.isValidFile(raf);
}
origin: edu.ucar/netcdf

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);
}
ucar.nc2.iosp.hdf4H4header

Javadoc

Read the tags of an HDF4 file, construct CDM objects. All page references are to "HDF Specification and Developers Guide" version 4.1r5, nov 2001.

Most used methods

  • isValidFile
  • setDebugFlags
  • addGlobalAttributes
  • addGroupToGroup
  • addVariableAttributes
  • addVariableToGroup
  • adjustDimensions
  • construct
  • factory
  • findUsedDimensions
  • isEos
  • makeAttribute
  • isEos,
  • makeAttribute,
  • makeDimension,
  • makeDimensionUnshared,
  • makeGroup,
  • makeImage,
  • makeVariable,
  • read,
  • readDDH,
  • tagid

Popular in Java

  • Running tasks concurrently on multiple threads
  • startActivity (Activity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • requestLocationUpdates (LocationManager)
  • Format (java.text)
    The base class for all formats. This is an abstract base class which specifies the protocol for clas
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • Collectors (java.util.stream)
  • JButton (javax.swing)
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now