class OWTClassificationOp extends PixelOperator {

    static String getBestBandName(String reflectancesPrefix, float wavelength, Band[] bands) {
        String bestBandName = null;
        double maxDistance = 10.0;
        double wavelengthDist = Double.MAX_VALUE;
        for (Band band : bands) {
            float spectralWavelength = band.getSpectralWavelength();
            boolean isSpectralBand = spectralWavelength > 0;
            if (isSpectralBand && band.getName().startsWith(reflectancesPrefix)) {
                float currentWavelengthDist = Math.abs(spectralWavelength - wavelength);
                if (currentWavelengthDist < wavelengthDist && currentWavelengthDist < maxDistance) {
                    wavelengthDist = currentWavelengthDist;
                    bestBandName = band.getName();
                }
            }
        }
        return bestBandName;
    }

}