axis.setAxisType(AxisType.GeoZ); coordinates.put(axisName, CoordinateVariable.create(axis)); + "'."); axis.setAxisType(AxisType.Time); coordinates.put(axisName, CoordinateVariable.create(axis)); } else if (!ignored.contains(axisName)) {
axis.setAxisType(AxisType.GeoZ); coordinates.put(axisName, CoordinateVariable.create(axis)); + "'."); axis.setAxisType(AxisType.Time); coordinates.put(axisName, CoordinateVariable.create(axis)); } else if (!ignored.contains(axisName)) {
private void extractCoordinatesVariable( ) throws IOException { // get the coordinate variables for( CoordinateAxis axis : dataset.getCoordinateAxes() ) { if (axis instanceof CoordinateAxis1D && axis.getAxisType() != null) { coordinatesVariables.put(axis.getFullName(), CoordinateVariable.create((CoordinateAxis1D)axis)); } else { // Workaround for Unsupported Axes Set<String> unsupported = UnidataUtilities.getUnsupportedDimensions(); if (axis instanceof CoordinateAxis1D && unsupported.contains(axis.getFullName())) { axis.setAxisType(AxisType.GeoZ); coordinatesVariables.put(axis.getFullName(), CoordinateVariable.create((CoordinateAxis1D) axis)); // Workaround for files that have a time dimension, but in a format that could not be parsed } else if ("time".equals(axis.getFullName())) { LOGGER.warning("Detected unparseable unit string in time axis: '" + axis.getUnitsString() + "'."); axis.setAxisType(AxisType.Time); coordinatesVariables.put(axis.getFullName(), CoordinateVariable.create((CoordinateAxis1D) axis)); } else { LOGGER.warning("Unsupported axis: " + axis + " in input: " + this.getInput() + " has been found"); } } } initMapping(dataset.getCoordinateAxes()); }
/** * Turn the variable into a coordinate axis, if not already. Add to the dataset, replacing variable if needed. * * @return variable as a coordinate axis */ public CoordinateAxis makeIntoCoordinateAxis() { if (axis != null) return axis; // if not a CoordinateAxis, will turn into one v = axis = ds.addCoordinateAxis((VariableDS) v); if (axisType != null) { axis.setAxisType(axisType); axis.addAttribute(new Attribute(_Coordinate.AxisType, axisType.toString())); if (((axisType == AxisType.Height) || (axisType == AxisType.Pressure) || (axisType == AxisType.GeoZ)) && (positive != null)) { axis.setPositive(positive); axis.addAttribute(new Attribute(_Coordinate.ZisPositive, positive)); } } return axis; }
/** * Turn the variable into a coordinate axis, if not already. Add to the dataset, replacing variable if needed. * * @return variable as a coordinate axis */ public CoordinateAxis makeIntoCoordinateAxis() { if (axis != null) return axis; // if not a CoordinateAxis, will turn into one v = axis = ds.addCoordinateAxis((VariableDS) v); if (axisType != null) { axis.setAxisType(axisType); axis.addAttribute(new Attribute(_Coordinate.AxisType, axisType.toString())); if (((axisType == AxisType.Height) || (axisType == AxisType.Pressure) || (axisType == AxisType.GeoZ)) && (positive != null)) { axis.setPositive(positive); axis.addAttribute(new Attribute(_Coordinate.ZisPositive, positive)); } } return axis; }
/** * Turn the variable into a coordinate axis, if not already. Add to the dataset, replacing variable if needed. * * @return variable as a coordinate axis */ public CoordinateAxis makeIntoCoordinateAxis() { if (axis != null) return axis; // if not a CoordinateAxis, will turn into one v = axis = ds.addCoordinateAxis((VariableDS) v); if (axisType != null) { axis.setAxisType(axisType); axis.addAttribute(new Attribute(_Coordinate.AxisType, axisType.toString())); if (((axisType == AxisType.Height) || (axisType == AxisType.Pressure) || (axisType == AxisType.GeoZ)) && (positive != null)) { axis.setPositive(positive); axis.addAttribute(new Attribute(_Coordinate.ZisPositive, positive)); } } return axis; }
private CoordinateSystem findReplacementCs(CoordinateSystem protoCs, String timeDim, NetcdfDataset result) { CoordinateSystem replace = result.findCoordinateSystem(protoCs.getName()); if (replace != null) return replace; List<CoordinateAxis> axes = new ArrayList<CoordinateAxis>(); for (CoordinateAxis axis : protoCs.getCoordinateAxes()) { Variable v = result.findCoordinateAxis(axis.getFullNameEscaped()); CoordinateAxis ra; if (v instanceof CoordinateAxis) ra = (CoordinateAxis) v; else { // if not a CoordinateAxis, will turn into one ra = result.addCoordinateAxis((VariableDS) v); if (axis.getAxisType() != null) { ra.setAxisType(axis.getAxisType()); ra.addAttribute(new Attribute(_Coordinate.AxisType, axis.getAxisType().toString())); } } axes.add(ra); } // coord transforms are immutable and can be shared CoordinateSystem cs = new CoordinateSystem(result, axes, protoCs.getCoordinateTransforms()); result.addCoordinateSystem(cs); return cs; }
private CoordinateSystem findReplacementCs(CoordinateSystem protoCs, String timeDim, NetcdfDataset result) { CoordinateSystem replace = result.findCoordinateSystem(protoCs.getName()); if (replace != null) return replace; List<CoordinateAxis> axes = new ArrayList<CoordinateAxis>(); for (CoordinateAxis axis : protoCs.getCoordinateAxes()) { Variable v = result.findCoordinateAxis(axis.getFullNameEscaped()); CoordinateAxis ra; if (v instanceof CoordinateAxis) ra = (CoordinateAxis) v; else { // if not a CoordinateAxis, will turn into one ra = result.addCoordinateAxis((VariableDS) v); if (axis.getAxisType() != null) { ra.setAxisType(axis.getAxisType()); ra.addAttribute(new Attribute(_Coordinate.AxisType, axis.getAxisType().toString())); } } axes.add(ra); } // coord transforms are immutable and can be shared CoordinateSystem cs = new CoordinateSystem(result, axes, protoCs.getCoordinateTransforms()); result.addCoordinateSystem(cs); return cs; }