public void show(Formatter f) { f.format(" %s", getLocation()); if (coordValue != null) f.format(" coordValue='%s'", coordValue); if (coordValueDate != null) f.format(" coordValueDate='%s'", dateFormatter.toDateTimeString(coordValueDate)); f.format(" range=[%d:%d) (%d)%n", aggStart, aggEnd, ncoord); }
public void show(Formatter f) { f.format(" %s", getLocation()); if (coordValue != null) f.format(" coordValue='%s'", coordValue); if (coordValueDate != null) f.format(" coordValueDate='%s'", dateFormatter.toDateTimeString(coordValueDate)); f.format(" range=[%d:%d) (%d)%n", aggStart, aggEnd, ncoord); }
public void show(Formatter f) { f.format(" %s", getLocation()); if (coordValue != null) f.format(" coordValue='%s'", coordValue); if (coordValueDate != null) f.format(" coordValueDate='%s'", dateFormatter.toDateTimeString(coordValueDate)); f.format(" range=[%d:%d) (%d)%n", aggStart, aggEnd, ncoord); }
logger.error("readAggCoord incorrect number of coordinates dataset=" + dset.getLocation()); throw new IllegalArgumentException("readAggCoord incorrect number of coordinates dataset=" + dset.getLocation());
logger.error("readAggCoord incorrect number of coordinates dataset=" + dset.getLocation()); throw new IllegalArgumentException("readAggCoord incorrect number of coordinates dataset=" + dset.getLocation());
logger.error("readAggCoord incorrect number of coordinates dataset=" + dset.getLocation()); throw new IllegalArgumentException("readAggCoord incorrect number of coordinates dataset=" + dset.getLocation());
this.coordValue = extractCoordNameFromFilename(this.getLocation()); this.isStringValued = true; } else {
this.coordValue = extractCoordNameFromFilename(this.getLocation()); this.isStringValued = true; } else {
this.coordValue = extractCoordNameFromFilename(this.getLocation()); this.isStringValued = true; } else {
@Override protected Array read(Variable mainv, CancelTask cancelTask, List<Range> section) throws IOException, InvalidRangeException { NetcdfFile ncd = null; try { ncd = acquireFile(cancelTask); if ((cancelTask != null) && cancelTask.isCancel()) return null; Variable v = findVariable(ncd, mainv); if (v == null) { logger.error("AggOuterDimension cant find " + mainv.getFullName() + " in " + ncd.getLocation() + "; return all zeroes!!!"); return Array.factory(mainv.getDataType(), new Section(section).getShape()); // all zeros LOOK need missing value } if (debugRead) { Section want = new Section(section); System.out.printf("AggOuter.read(%s) %s from %s in %s%n", want, mainv.getNameAndDimensions(), v.getNameAndDimensions(), getLocation()); } // its possible that we are asking for more of the time coordinate than actually exists (fmrc ragged time) // so we need to read only what is there Range fullRange = v.getRanges().get(0); Range want = section.get(0); if (fullRange.last() < want.last()) { Range limitRange = new Range(want.first(), fullRange.last(), want.stride()); section = new ArrayList<Range>(section); // make a copy section.set(0, limitRange); } return v.read(section); } finally { close(ncd); } }
@Override protected Array read(Variable mainv, CancelTask cancelTask, List<Range> section) throws IOException, InvalidRangeException { NetcdfFile ncd = null; try { ncd = acquireFile(cancelTask); if ((cancelTask != null) && cancelTask.isCancel()) return null; Variable v = findVariable(ncd, mainv); if (v == null) { logger.error("AggOuterDimension cant find " + mainv.getFullName() + " in " + ncd.getLocation() + "; return all zeroes!!!"); return Array.factory(mainv.getDataType(), new Section(section).getShape()); // all zeros LOOK need missing value } if (debugRead) { Section want = new Section(section); System.out.printf("AggOuter.read(%s) %s from %s in %s%n", want, mainv.getNameAndDimensions(), v.getNameAndDimensions(), getLocation()); } // its possible that we are asking for more of the time coordinate than actually exists (fmrc ragged time) // so we need to read only what is there Range fullRange = v.getRanges().get(0); Range want = section.get(0); if (fullRange.last() < want.last()) { Range limitRange = new Range(want.first(), fullRange.last(), want.stride()); section = new ArrayList<>(section); // make a copy section.set(0, limitRange); } return v.read(section); } finally { close(ncd); } }
@Override protected Array read(Variable mainv, CancelTask cancelTask, List<Range> section) throws IOException, InvalidRangeException { NetcdfFile ncd = null; try { ncd = acquireFile(cancelTask); if ((cancelTask != null) && cancelTask.isCancel()) return null; Variable v = findVariable(ncd, mainv); if (v == null) { logger.error("AggOuterDimension cant find " + mainv.getFullName() + " in " + ncd.getLocation() + "; return all zeroes!!!"); return Array.factory(mainv.getDataType(), new Section(section).getShape()); // all zeros LOOK need missing value } if (debugRead) { Section want = new Section(section); System.out.printf("AggOuter.read(%s) %s from %s in %s%n", want, mainv.getNameAndDimensions(), v.getNameAndDimensions(), getLocation()); } // its possible that we are asking for more of the time coordinate than actually exists (fmrc ragged time) // so we need to read only what is there Range fullRange = v.getRanges().get(0); Range want = section.get(0); if (fullRange.last() < want.last()) { Range limitRange = new Range(want.first(), fullRange.last(), want.stride()); section = new ArrayList<Range>(section); // make a copy section.set(0, limitRange); } return v.read(section); } finally { close(ncd); } }
DatasetOuterDimension(MFile cd) { super(cd); if ((type == Type.joinNew) || (type == Type.joinExistingOne)) { this.ncoord = 1; } // default is that the coordinates are just the filenames // this can be overriden by an explicit declaration, which will replace the variable afte ther agg is processed in NcMLReader if ((type == Type.joinNew) || (type == Type.joinExistingOne) || (type == Type.forecastModelRunCollection)) { this.coordValue = extractCoordNameFromFilename(this.getLocation()); this.isStringValued = true; this.isStringValued = true; } if (null != dateFormatMark) { String filename = cd.getName(); // LOOK operates on name, not path coordValueDate = DateFromString.getDateUsingDemarkatedCount(filename, dateFormatMark, '#'); coordValue = dateFormatter.toDateTimeStringISO(coordValueDate); if (debugDateParse) System.out.println(" adding " + cd.getPath() + " date= " + coordValue); } else { if (debugDateParse) System.out.println(" adding " + cd.getPath()); } if ((coordValue == null) && (type == Type.joinNew)) // use filename as coord value coordValue = cd.getName(); }
DatasetOuterDimension(MFile cd) { super(cd); if ((type == Type.joinNew) || (type == Type.joinExistingOne)) { this.ncoord = 1; } // default is that the coordinates are just the filenames // this can be overriden by an explicit declaration, which will replace the variable afte ther agg is processed in NcMLReader if ((type == Type.joinNew) || (type == Type.joinExistingOne) || (type == Type.forecastModelRunCollection)) { this.coordValue = extractCoordNameFromFilename(this.getLocation()); this.isStringValued = true; this.isStringValued = true; } if (null != dateFormatMark) { String filename = cd.getName(); // LOOK operates on name, not path coordValueDate = DateFromString.getDateUsingDemarkatedCount(filename, dateFormatMark, '#'); coordValue = dateFormatter.toDateTimeStringISO(coordValueDate); if (debugDateParse) System.out.println(" adding " + cd.getPath() + " date= " + coordValue); } else { if (debugDateParse) System.out.println(" adding " + cd.getPath()); } if ((coordValue == null) && (type == Type.joinNew)) // use filename as coord value coordValue = cd.getName(); }
DatasetOuterDimension(MFile cd) { super(cd); if ((type == Type.joinNew) || (type == Type.joinExistingOne)) { this.ncoord = 1; } // default is that the coordinates are just the filenames // this can be overriden by an explicit declaration, which will replace the variable afte ther agg is processed in NcMLReader if ((type == Type.joinNew) || (type == Type.joinExistingOne) || (type == Type.forecastModelRunCollection)) { this.coordValue = extractCoordNameFromFilename(this.getLocation()); this.isStringValued = true; this.isStringValued = true; } if (null != dateFormatMark) { String filename = cd.getName(); // LOOK operates on name, not path coordValueDate = DateFromString.getDateUsingDemarkatedCount(filename, dateFormatMark, '#'); coordValue = dateFormatter.toDateTimeStringISO(coordValueDate); if (debugDateParse) System.out.println(" adding " + cd.getPath() + " date= " + coordValue); } else { if (debugDateParse) System.out.println(" adding " + cd.getPath()); } if ((coordValue == null) && (type == Type.joinNew)) // use filename as coord value coordValue = cd.getName(); }