/** * Get a {@link Variable} by name. * * @param varName the name of the {@link Variable} to pick. * @return the variable or <code>null</code>. */ public Variable getVariableByName(final String varName) { final List<Variable> varList = dataset.getVariables(); for (Variable var : varList) { if (var.getFullName().equals(varName)) return var; } return null; }
/** * Look for a CoordinateReferenceSystem defined into a variable * * @param dataset * @param defaultCrs * @return * @throws FactoryException */ public static CoordinateReferenceSystem lookForVariableCRS( NetcdfDataset dataset, CoordinateReferenceSystem defaultCrs) throws FactoryException { List<Variable> variables = dataset.getVariables(); CoordinateReferenceSystem crs = defaultCrs; for (Variable variable : variables) { CRSParser attrib = CRSParser.getCRSParser(variable); if (attrib != null) { // Referencing info found crs = NetCDFProjection.parseProjection(variable, attrib); if (LOGGER.isLoggable(Level.FINE)) { LOGGER.fine( "Detected NetCDFProjection through gridMapping variable: " + (crs != null ? crs.toWKT() : "null")); } break; } } return crs; }
List<Variable> variables = dataset.getVariables(); for (Variable var : variables) { Attribute gridMappingAttribute = var.findAttribute(NetCDFUtilities.GRID_MAPPING);
boolean isShared = datastoreConfig.isShared(); initCatalog(datastoreConfig); final List<Variable> variables = dataset.getVariables(); if (variables != null) {
public RadialDatasetSweepAdapter( NetcdfDataset ds) { super(ds); // look for radial data variables parseInfo.append("RadialDatasetAdapter look for RadialVariables\n"); List vars = ds.getVariables(); for (int i=0; i< vars.size(); i++) { // VariableEnhanced varDS = (VariableEnhanced) vars.get(i); addRadialVariable( ds, (Variable) vars.get(i)); } }
public RadialDatasetSweepAdapter( NetcdfDataset ds) { super(ds); // look for radial data variables parseInfo.append("RadialDatasetAdapter look for RadialVariables\n"); List vars = ds.getVariables(); for (int i=0; i< vars.size(); i++) { // VariableEnhanced varDS = (VariableEnhanced) vars.get(i); addRadialVariable( ds, (Variable) vars.get(i)); } }
/** * Get a {@link Variable} by name. * * @param varName the name of the {@link Variable} to pick. * @return the variable or <code>null</code>. */ public Variable getVariableByName(final String varName) { final List<Variable> varList = dataset.getVariables(); for (Variable var : varList) { if (var.getFullName().equals(varName)) return var; } return null; }
/** * Clear Coordinate System metadata, to allow them to be redone */ public void clearCoordinateSystems() { coordSys = new ArrayList<CoordinateSystem>(); coordAxes = new ArrayList<CoordinateAxis>(); coordTransforms = new ArrayList<CoordinateTransform>(); for (Variable v : getVariables()) { VariableEnhanced ve = (VariableEnhanced) v; ve.clearCoordinateSystems(); // ?? } enhanceMode.remove(Enhance.CoordSystems); }
/** * Clear Coordinate System metadata, to allow them to be redone */ public void clearCoordinateSystems() { coordSys = new ArrayList<>(); coordAxes = new ArrayList<>(); coordTransforms = new ArrayList<>(); for (Variable v : getVariables()) { VariableEnhanced ve = (VariableEnhanced) v; ve.clearCoordinateSystems(); // ?? } enhanceMode.remove(Enhance.CoordSystems); }
private boolean hasAxisType(NetcdfDataset ds, AxisType a) { List<Variable> varList = ds.getVariables(); for (Variable v : varList) { String axisType = ds.findAttValueIgnoreCase(v, "CoordinateAxisType", null); if ((axisType != null) && axisType.equals(a.toString())) return true; } return false; }
private boolean hasAxisType(NetcdfDataset ds, AxisType a) { List<Variable> varList = ds.getVariables(); for (Variable v : varList) { String axisType = ds.findAttValueIgnoreCase(v, "CoordinateAxisType", null); if ((axisType != null) && axisType.equals(a.toString())) return true; } return false; }
private boolean hasAxisType(NetcdfDataset ds, AxisType a) { List<Variable> varList = ds.getVariables(); for (Variable v : varList) { String axisType = ds.findAttValueIgnoreCase(v, "CoordinateAxisType", null); if ((axisType != null) && axisType.equals(a.toString())) return true; } return false; }
public void augmentDataset( NetcdfDataset ds, CancelTask cancelTask) throws IOException { List<Variable> vars = ds.getVariables(); findAxes(vars); ds.finish(); }
public void augmentDataset( NetcdfDataset ds, CancelTask cancelTask) throws IOException { List<Variable> vars = ds.getVariables(); findAxes(vars); ds.finish(); }
public void augmentDataset( NetcdfDataset ds, CancelTask cancelTask) throws IOException { List<Variable> vars = ds.getVariables(); findAxes(vars); ds.finish(); }
/** * Constructor. * * @param ds Source NetCDF dataset */ public CFRadialAdapter(NetcdfDataset ds) { this.ds = ds; desc = "CF/Radial radar dataset"; init(); for (Variable var : ds.getVariables()) { addRadialVariable(ds, var); } }
protected Variable findVariableWithStandardNameAndNotDimension(NetcdfDataset ds, String standard_name, Dimension outer, Formatter errlog) { for (Variable v : ds.getVariables()) { String stdName = ds.findAttValueIgnoreCase(v, CF.STANDARD_NAME, null); if ((stdName != null) && stdName.equals(standard_name) && v.getRank() > 0 && !v.getDimension(0).equals(outer)) return v; } return null; }
protected Variable findVariableWithAttributeAndDimension(NetcdfDataset ds, String att_name, String att_value, Dimension outer, Formatter errlog) { for (Variable v : ds.getVariables()) { String stdName = ds.findAttValueIgnoreCase(v, att_name, null); if ((stdName != null) && stdName.equalsIgnoreCase(att_value)) { if (v.getRank() > 0 && v.getDimension(0).equals(outer)) return v; if (isEffectivelyScaler(v) && (outer == null)) return v; } } return null; }
public void check(Formatter f) { for (Variable v : getVariables()) { VariableDS vds = (VariableDS) v; if (vds.getOriginalDataType() != vds.getDataType()) { f.format("Variable %s has type %s, org = %s%n", vds.getFullName(), vds.getOriginalDataType(), vds.getDataType()); } if (vds.getOriginalVariable() != null) { Variable orgVar = vds.getOriginalVariable(); if (orgVar.getRank() != vds.getRank()) f.format("Variable %s has rank %d, org = %d%n", vds.getFullName(), vds.getRank(), orgVar.getRank()); } } }
public void check(Formatter f) { for (Variable v : getVariables()) { VariableDS vds = (VariableDS) v; if (vds.getOriginalDataType() != vds.getDataType()) { f.format("Variable %s has type %s, org = %s%n", vds.getFullName(), vds.getOriginalDataType(), vds.getDataType()); } if (vds.getOriginalVariable() != null) { Variable orgVar = vds.getOriginalVariable(); if (orgVar.getRank() != vds.getRank()) f.format("Variable %s has rank %d, org = %d%n", vds.getFullName(), vds.getRank(), orgVar.getRank()); } } }