pystem.tools.metrics module

This module contains several metric functions.

pystem.tools.metrics.SNR(xhat, xref)

Computes the SNR metric.

Parameters
  • xhat (numpy array) – The noised data.

  • xref (numpy array) – The noise-free image.

Returns

The SNR value in dB.

Return type

float

pystem.tools.metrics.NMSE(xhat, xref)

Computes the normalized mean square metric.

Parameters
  • xhat (numpy array) – The noised data.

  • xref (numpy array) – The noise-free image.

Returns

The NMSE value in dB.

Return type

float

pystem.tools.metrics.aSAD(xhat, xref)

Computes the averaged Spectral Angle Distance metric.

The input data number of dimensions can be:

  • 1: the data are spectra,

  • 2: the data are matrices of shape (n, M),

  • 3: the data are matrices of shape (m, n, M)

where M is the spectrum size.

Parameters
  • xhat (numpy array) – The noised data.

  • xref (numpy array) – The noise-free image.

Returns

The SNR value in dB.

Return type

float