/** * Cache a variable (for efficiency). * Useful for Variables that are used a lot, and not too large, like coordinate variables. * * @param varName name of variable to cache. must exist. * @param dtype datatype of variable */ void addCacheVariable(String varName, DataType dtype) { if (findCacheVariable(varName) != null) return; // no duplicates cacheList.add(new CacheVar(varName, dtype)); }
protected void buildCoords(CancelTask cancelTask) throws IOException { List<Dataset> nestedDatasets = getDatasets(); if (type == Type.forecastModelRunCollection) { for (Dataset nested : nestedDatasets) { DatasetOuterDimension dod = (DatasetOuterDimension) nested; dod.ncoord = 1; } } totalCoords = 0; for (Dataset nested : nestedDatasets) { DatasetOuterDimension dod = (DatasetOuterDimension) nested; totalCoords += dod.setStartEnd(totalCoords, cancelTask); } }
@Override public void getDetailInfo(Formatter f) { super.getDetailInfo(f); if (runMatcher != null) f.format(" runMatcher=%s%n", runMatcher); /* if (forecastMatcher != null) f.format(" forecastMatcher=%s%n", forecastMatcher); if (offsetMatcher != null) f.format(" offsetMatcher=%s%n", offsetMatcher); */ }
aggo.setTimeUnitsChange(timeUnitsChange.equalsIgnoreCase("true")); for (Element vaggElem : list) { String varName = vaggElem.getAttributeValue("name"); aggo.addVariable(varName); String varName = gattElem.getAttributeValue("name"); String orgName = gattElem.getAttributeValue("orgName"); aggo.addVariableFromGlobalAttribute(varName, orgName); String format = gattElem.getAttributeValue("format"); String orgName = gattElem.getAttributeValue("orgName"); aggo.addVariableFromGlobalAttributeCompose(varName, format, orgName); for (Element gattElem : list) { String varName = gattElem.getAttributeValue("name"); aggo.addCacheVariable(varName, null);
protected void rebuildDataset() throws IOException { buildCoords(null); aggDim.setLength(getTotalCoords()); Dataset typicalDataset = getTypicalDataset(); for (Variable var : ncDataset.getRootGroup().getVariables()) { VariableDS varDS = (VariableDS) var; readTimeCoordinates(joinAggCoord, null);
protected void rebuildDataset() throws IOException { buildCoords(null); // reset dimension length Dimension aggDim = ncDataset.findDimension(dimName); // LOOK use group aggDim.setLength(getTotalCoords()); // reset coordinate var VariableDS joinAggCoord = (VariableDS) ncDataset.getRootGroup().findVariable(dimName); joinAggCoord.setDimensions(dimName); // reset its dimension joinAggCoord.invalidateCache(); // get rid of any cached data, since its now wrong // reset agg variables for (Variable aggVar : aggVars) { //aggVar.setDimensions(dimName); // reset its dimension aggVar.resetDimensions(); // reset its dimensions aggVar.invalidateCache(); // get rid of any cached data, since its now wrong } // reset the typical dataset, where non-agg variables live Dataset typicalDataset = getTypicalDataset(); for (Variable var : ncDataset.getRootGroup().getVariables()) { VariableDS varDS = (VariableDS) var; if (aggVars.contains(varDS) || dimName.equals(var.getShortName())) continue; DatasetProxyReader proxy = new DatasetProxyReader(typicalDataset); var.setProxyReader(proxy); } // reset cacheVars for (CacheVar cv : cacheList) { cv.reset(); } }
logger.error("readAgg " + getLocation(), e); throw new IllegalArgumentException("readAgg " + getLocation(), e); int destPos = 0; List<Dataset> nestedDatasets = getDatasets(); if (executor != null) { CompletionService<Result> completionService = new ExecutorCompletionService<Result>(executor);
return reallyRead(mainv, cancelTask); List<Dataset> nestedDatasets = getDatasets(); for (Dataset nested : nestedDatasets) { DatasetOuterDimension dod = (DatasetOuterDimension) nested;
aggo.setTimeUnitsChange(timeUnitsChange.equalsIgnoreCase("true")); for (Element vaggElem : list) { String varName = vaggElem.getAttributeValue("name"); aggo.addVariable(varName); String varName = gattElem.getAttributeValue("name"); String orgName = gattElem.getAttributeValue("orgName"); aggo.addVariableFromGlobalAttribute(varName, orgName); String format = gattElem.getAttributeValue("format"); String orgName = gattElem.getAttributeValue("orgName"); aggo.addVariableFromGlobalAttributeCompose(varName, format, orgName); for (Element gattElem : list) { String varName = gattElem.getAttributeValue("name"); aggo.addCacheVariable(varName, null);
protected void rebuildDataset() throws IOException { buildCoords(null); // reset dimension length Dimension aggDim = ncDataset.findDimension(dimName); // LOOK use group aggDim.setLength(getTotalCoords()); // reset coordinate var VariableDS joinAggCoord = (VariableDS) ncDataset.getRootGroup().findVariable(dimName); joinAggCoord.setDimensions(dimName); // reset its dimension joinAggCoord.invalidateCache(); // get rid of any cached data, since its now wrong // reset agg variables for (Variable aggVar : aggVars) { //aggVar.setDimensions(dimName); // reset its dimension aggVar.resetDimensions(); // reset its dimensions aggVar.invalidateCache(); // get rid of any cached data, since its now wrong } // reset the typical dataset, where non-agg variables live Dataset typicalDataset = getTypicalDataset(); for (Variable var : ncDataset.getRootGroup().getVariables()) { VariableDS varDS = (VariableDS) var; if (aggVars.contains(varDS) || dimName.equals(var.getShortName())) continue; DatasetProxyReader proxy = new DatasetProxyReader(typicalDataset); var.setProxyReader(proxy); } // reset cacheVars for (CacheVar cv : cacheList) { cv.reset(); } }
logger.error("readAgg " + getLocation(), e); throw new IllegalArgumentException("readAgg " + getLocation(), e); int destPos = 0; List<Dataset> nestedDatasets = getDatasets(); if (executor != null) { CompletionService<Result> completionService = new ExecutorCompletionService<Result>(executor);
return reallyRead(mainv, cancelTask); List<Dataset> nestedDatasets = getDatasets(); for (Dataset nested : nestedDatasets) { DatasetOuterDimension dod = (DatasetOuterDimension) nested;
aggo.setTimeUnitsChange(timeUnitsChange.equalsIgnoreCase("true")); for (Element vaggElem : list) { String varName = vaggElem.getAttributeValue("name"); aggo.addVariable(varName); String varName = gattElem.getAttributeValue("name"); String orgName = gattElem.getAttributeValue("orgName"); aggo.addVariableFromGlobalAttribute(varName, orgName); String format = gattElem.getAttributeValue("format"); String orgName = gattElem.getAttributeValue("orgName"); aggo.addVariableFromGlobalAttributeCompose(varName, format, orgName); for (Element gattElem : list) { String varName = gattElem.getAttributeValue("name"); aggo.addCacheVariable(varName, null);
logger.error("readAgg " + getLocation(), e); throw new IllegalArgumentException("readAgg " + getLocation(), e); int destPos = 0; List<Dataset> nestedDatasets = getDatasets(); if (executor != null) { CompletionService<Result> completionService = new ExecutorCompletionService<>(executor);
return reallyRead(mainv, cancelTask); List<Dataset> nestedDatasets = getDatasets(); for (Dataset nested : nestedDatasets) { DatasetOuterDimension dod = (DatasetOuterDimension) nested;
protected void buildCoords(CancelTask cancelTask) throws IOException { List<Dataset> nestedDatasets = getDatasets(); if (type == Type.forecastModelRunCollection) { for (Dataset nested : nestedDatasets) { DatasetOuterDimension dod = (DatasetOuterDimension) nested; dod.ncoord = 1; } } totalCoords = 0; for (Dataset nested : nestedDatasets) { DatasetOuterDimension dod = (DatasetOuterDimension) nested; totalCoords += dod.setStartEnd(totalCoords, cancelTask); } }
/** * Cache a variable (for efficiency). * Useful for Variables that are used a lot, and not too large, like coordinate variables. * * @param varName name of variable to cache. must exist. * @param dtype datatype of variable */ void addCacheVariable(String varName, DataType dtype) { if (findCacheVariable(varName) != null) return; // no duplicates cacheList.add(new CacheVar(varName, dtype)); }
@Override public void getDetailInfo(Formatter f) { super.getDetailInfo(f); if (runMatcher != null) f.format(" runMatcher=%s%n", runMatcher); /* if (forecastMatcher != null) f.format(" forecastMatcher=%s%n", forecastMatcher); if (offsetMatcher != null) f.format(" offsetMatcher=%s%n", offsetMatcher); */ }
protected void buildCoords(CancelTask cancelTask) throws IOException { List<Dataset> nestedDatasets = getDatasets(); if (type == Type.forecastModelRunCollection) { for (Dataset nested : nestedDatasets) { DatasetOuterDimension dod = (DatasetOuterDimension) nested; dod.ncoord = 1; } } totalCoords = 0; for (Dataset nested : nestedDatasets) { DatasetOuterDimension dod = (DatasetOuterDimension) nested; totalCoords += dod.setStartEnd(totalCoords, cancelTask); } }
/** * Cache a variable (for efficiency). * Useful for Variables that are used a lot, and not too large, like coordinate variables. * * @param varName name of variable to cache. must exist. * @param dtype datatype of variable */ void addCacheVariable(String varName, DataType dtype) { if (findCacheVariable(varName) != null) return; // no duplicates cacheList.add(new CacheVar(varName, dtype)); }