Distance Functions¶
This module supports functions to calculate the distance between two vectors. These distances are supported:
 Chebychev
 Normalized Cross Correlation (NormXCorr)
 Spectral Angle Mapper (SAM)
 Spectral Information Divergence (SID)
Chebychev¶
Normalized Cross Correlation (NormXCorr)¶

pysptools.distance.
NormXCorr
(s1, s2)[source]¶ Computes the normalized cross correlation distance between two vector.
Parameters:  s1 – numpy array The first vector.
 s2 – numpy array The second vector.
 Returns: float
 NormXCorr distance between s1 and s2, dist is between [1, 1]. A value of one indicate a perfect match.
Spectral Angle Mapper (SAM)¶
Spectral Information Divergence (SID)¶

pysptools.distance.
SID
(s1, s2)[source]¶ Computes the spectral information divergence between two vectors.
Parameters:  s1 – numpy array The first vector.
 s2 – numpy array The second vector.
 Returns: float
 Spectral information divergence between s1 and s2.
 Reference
 C.I. Chang, “An InformationTheoretic Approach to SpectralVariability, Similarity, and Discrimination for Hyperspectral Image” IEEE TRANSACTIONS ON INFORMATION THEORY, VOL. 46, NO. 5, AUGUST 2000.