private static void writedescription(PrintWriter out, RasterDataNode rasterDataNode) { assert rasterDataNode != null; String description = rasterDataNode.getDescription(); String unit = rasterDataNode.getUnit(); if (unit == null || unit.trim().length() == 0) { unit = "1"; } if (rasterDataNode.isLog10Scaled()) { unit = "log(" + unit + ")"; } unit = " - Unit: " + unit; String wavelength = ""; // String bandwidth = ""; if (rasterDataNode instanceof Band) { Band band = (Band) rasterDataNode; if (band.getSpectralWavelength() != 0.0) { wavelength = " - Wavelength: " + band.getSpectralWavelength() + "nm"; // bandwidth = " - Bandwidth: " + band.getSpectralBandwidth() + "nm"; } } if (description == null || description.trim().length() == 0) { description = rasterDataNode.getProduct().getDescription(); } out.println( "description = {" + description + unit + wavelength // + bandwidth + "}"); }
/** * Writes the wavelength value to the out stream if the given rasterDataNode is an instance of * <code>BAND</code> * * @param out - the tream to write to * @param rasterDataNode the <code>RasterDataNode</code> */ private static void writeWavelength(PrintWriter out, RasterDataNode rasterDataNode) { if (rasterDataNode instanceof Band) { final Band band = (Band) rasterDataNode; final float spectralWavelength = band.getSpectralWavelength(); if (spectralWavelength != 0) { out.println("wavelength = {" + spectralWavelength + "}"); } } }