/** * Amend the given NetcdfFile with metadata from HDF-EOS structMetadata. * All Variables named StructMetadata.n, where n= 1, 2, 3 ... are read in and their contents concatenated * to make the structMetadata String. * * @param ncfile Amend this file * @param eosGroup the group containing variables named StructMetadata.* * @throws IOException on read error * @return true if HDF-EOS info was found */ static public boolean amendFromODL(NetcdfFile ncfile, Group eosGroup) throws IOException { String smeta = getStructMetadata(eosGroup); if (smeta == null) return false; HdfEos fixer = new HdfEos(); fixer.fixAttributes(ncfile.getRootGroup()); fixer.amendFromODL(ncfile, smeta); return true; }
/** * Amend the given NetcdfFile with metadata from HDF-EOS structMetadata. * All Variables named StructMetadata.n, where n= 1, 2, 3 ... are read in and their contents concatenated * to make the structMetadata String. * * @param ncfile Amend this file * @param eosGroup the group containing variables named StructMetadata.* * @throws IOException on read error * @return true if HDF-EOS info was found */ static public boolean amendFromODL(NetcdfFile ncfile, Group eosGroup) throws IOException { String smeta = getStructMetadata(eosGroup); if (smeta == null) return false; HdfEos fixer = new HdfEos(); fixer.amendFromODL(ncfile, smeta); fixer.fixAttributes(ncfile.getRootGroup()); return true; }
/** * Amend the given NetcdfFile with metadata from HDF-EOS structMetadata. * All Variables named StructMetadata.n, where n= 1, 2, 3 ... are read in and their contents concatenated * to make the structMetadata String. * * @param ncfile Amend this file * @param eosGroup the group containing variables named StructMetadata.* * @return true if HDF-EOS info was found * @throws IOException on read error */ static public boolean amendFromODL(NetcdfFile ncfile, Group eosGroup) throws IOException { String smeta = getStructMetadata(eosGroup); if (smeta == null) { return false; } HdfEos fixer = new HdfEos(); fixer.fixAttributes(ncfile.getRootGroup()); fixer.amendFromODL(ncfile, smeta); return true; }
public void open(RandomAccessFile raf, ucar.nc2.NetcdfFile ncfile, ucar.nc2.util.CancelTask cancelTask) throws IOException { super.open(raf, ncfile, cancelTask); headerParser = new H5header(this.raf, ncfile, this); headerParser.read(null); // check if its an HDF5-EOS file Group eosInfo = ncfile.getRootGroup().findGroup(HdfEos.HDF5_GROUP); if (eosInfo != null && !skipEos) { isEos = HdfEos.amendFromODL(ncfile, eosInfo); } ncfile.finish(); }
public void open(RandomAccessFile raf, ucar.nc2.NetcdfFile ncfile, ucar.nc2.util.CancelTask cancelTask) throws IOException { super.open(raf, ncfile, cancelTask); headerParser = new H5header(this.raf, ncfile, this); headerParser.read(null); // check if its an HDF5-EOS file Group eosInfo = ncfile.getRootGroup().findGroup(HdfEos.HDF5_GROUP); if (eosInfo != null && !skipEos) { isEos = HdfEos.amendFromODL(ncfile, eosInfo); } ncfile.finish(); }
public void open(RandomAccessFile raf, ucar.nc2.NetcdfFile ncfile, ucar.nc2.util.CancelTask cancelTask) throws IOException { super.open(raf, ncfile, cancelTask); headerParser = new H5header(this.raf, ncfile, this); headerParser.read(null); // check if its an HDF5-EOS file Group eosInfo = ncfile.getRootGroup().findGroup(HdfEos.HDF5_GROUP); if (eosInfo != null && useHdfEos) { isEos = HdfEos.amendFromODL(ncfile, eosInfo); } ncfile.finish(); }
private void _open(RandomAccessFile raf, NetcdfFile ncfile, boolean readOnly) throws IOException { if (!isClibraryPresent()) { throw new UnsupportedOperationException("Couldn't load NetCDF C library (see log for details)."); } if (raf != null) raf.close(); // not used // open // netcdf-c can't handle "file:" prefix. Must remove it. String location = NetcdfFile.canonicalizeUriString(ncfile.getLocation()); log.debug("open {}", location); IntByReference ncidp = new IntByReference(); int ret = nc4.nc_open(location, readOnly ? NC_NOWRITE : NC_WRITE, ncidp); if (ret != 0) throw new IOException(ret + ": " + nc4.nc_strerror(ret)); isClosed = false; ncid = ncidp.getValue(); // format IntByReference formatp = new IntByReference(); ret = nc4.nc_inq_format(ncid, formatp); if (ret != 0) throw new IOException(ret + ": " + nc4.nc_strerror(ret)); format = formatp.getValue(); log.debug("open {} id={} format={}", ncfile.getLocation(), ncid, format); // read root group makeGroup(new Group4(ncid, ncfile.getRootGroup(), null)); // check if its an HDF5-EOS file Group eosInfo = ncfile.getRootGroup().findGroup(HdfEos.HDF5_GROUP); if (eosInfo != null && useHdfEos) { isEos = HdfEos.amendFromODL(ncfile, eosInfo); } ncfile.finish(); }
isEos = HdfEos.amendFromODL(ncfile, ncfile.getRootGroup()); if (isEos) { adjustDimensions();
isEos = HdfEos.amendFromODL(ncfile, ncfile.getRootGroup()); if (isEos) { adjustDimensions();
isEos = HdfEos.amendFromODL(ncfile, ncfile.getRootGroup()); if (isEos) { adjustDimensions();
private void _open(RandomAccessFile raf, NetcdfFile ncfile, boolean readOnly) throws IOException { if (!isClibraryPresent()) { throw new UnsupportedOperationException("Couldn't load NetCDF C library (see log for details)."); } if(raf != null) raf.close(); // not used this.ncfile = ncfile; // open if (debug) System.out.println("open " + ncfile.getLocation()); IntByReference ncidp = new IntByReference(); int ret = nc4.nc_open(ncfile.getLocation(), readOnly ? NC_NOWRITE : NC_WRITE, ncidp); if (ret != 0) throw new IOException(ret + ": " + nc4.nc_strerror(ret)); ncid = ncidp.getValue(); // format IntByReference formatp = new IntByReference(); ret = nc4.nc_inq_format(ncid, formatp); if (ret != 0) throw new IOException(ret + ": " + nc4.nc_strerror(ret)); format = formatp.getValue(); if (debug) System.out.printf("open %s id=%d format=%d %n", ncfile.getLocation(), ncid, format); // read root group makeGroup(new Group4(ncid, ncfile.getRootGroup(), null)); // check if its an HDF5-EOS file Group eosInfo = ncfile.getRootGroup().findGroup(HdfEos.HDF5_GROUP); if (eosInfo != null && !skipEos) { isEos = HdfEos.amendFromODL(ncfile, eosInfo); } ncfile.finish(); }