Class SpectralAngleMapperUtils


  • public class SpectralAngleMapperUtils
    extends Object
    Utility class for performing spectral angle mapping between spectra.
    Author:
    Corey Sterling (csterlin at waikato dot ac dot nz)
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static TechnicalInformation getTechnicalInformation()
      Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.
      static double[] modify​(double[] input)
      Performs modification of array as in Oshigami et al.
      static double[] sam​(double[] test, double[][] references, boolean modified)
      Calculates the angles between a test spectrum and an array of reference spectra.
      static double sam​(double[] spectrum1, double[] spectrum2, boolean modified)
      Calculates the angle between two spectra.
    • Constructor Detail

      • SpectralAngleMapperUtils

        public SpectralAngleMapperUtils()
    • Method Detail

      • getTechnicalInformation

        public static TechnicalInformation getTechnicalInformation()
        Returns an instance of a TechnicalInformation object, containing detailed information about the technical background of this class, e.g., paper reference or book this class is based on.
        Returns:
        the technical information about this class
      • sam

        public static double sam​(double[] spectrum1,
                                 double[] spectrum2,
                                 boolean modified)
        Calculates the angle between two spectra.
        Parameters:
        spectrum1 - The first spectrum.
        spectrum2 - The second spectrum.
        modified - Whether to use the modified algorithm.
        Returns:
        The angle between the two spectra.
      • sam

        public static double[] sam​(double[] test,
                                   double[][] references,
                                   boolean modified)
        Calculates the angles between a test spectrum and an array of reference spectra.
        Parameters:
        test - The test spectrum.
        references - The reference spectra.
        modified - Whether to use the modified algorithm.
        Returns:
        The array of angles.
      • modify

        public static double[] modify​(double[] input)
        Performs modification of array as in Oshigami et al. by subtracting the mean of the array from each element.
        Parameters:
        input - The spectrum array to modify.
        Returns:
        The modified array.