crikit.measurement package — CRIKit2 0.4.3 documentation

# crikit.measurement package

## Subpackages

- crikit.measurement.tests package
  - Submodules
  - crikit.measurement.tests.test_measurement module
  - crikit.measurement.tests.test_measurements_complex module
  - crikit.measurement.tests.test_peakfind module
  - Module contents

## Submodules

## crikit.measurement.fftspatialnoise module

Created on Fri Jun 10 16:16:17 2016

@author: chc

class crikit.measurement.fftspatialnoise.FFTSignalMetric(img_shp, cutoff=0.5, img=None)

  Bases: `object`

  FFT Spatial Noise Metric (Ratio - 1)

  calc(img)

## crikit.measurement.peakamps module

Measurement methods to quantify peak relationships

Note

For complex-valued measurements, all methods perform the math separately for real and imag

class crikit.measurement.peakamps.AbstractMeasureThree(f1, f2, f3)

  Bases: `object`

  Abstract class for measurements that take 3 things

  calculate(signal)
  classmethod measure(signal, f1, f2, f3)

class crikit.measurement.peakamps.AbstractMeasureTwo(f1, f2)

  Bases: `object`

  Abstract class for measurements that take 2 things

  calculate(signal)
  classmethod measure(signal, f1, f2)

class crikit.measurement.peakamps.AbstractMeasureTwoOrdered(f1, f2)

  Bases: `crikit.measurement.peakamps.AbstractMeasureTwo`

  Abstract class for measurements that take 2 things, where f1 < f2

class crikit.measurement.peakamps.MeasurePeak(f1)

  Bases: `object`

  Meausure peak amplitude.

  Parameters

    f1 (int) – Peak location in pixel coordinates

  output

    Amplitude of peak

    Type

      float or ndarray

  calculate : Calculate the amplitude
  Static Methods
  --------------
  measure : Same as calculate but static (returns the amplitude directly)
  calculate(signal)
  classmethod measure(signal, f1)

class crikit.measurement.peakamps.MeasurePeakAdd(f1, f2)

  Bases: `crikit.measurement.peakamps.AbstractMeasureTwo`

  Meausure the addition of two peaks (f1 + f2).

  Parameters

    - f1 (int) – Peak location in pixel coordinates

    - f2 (int) – Peak location in pixel coordinates

  output

    Amplitude of peak

    Type

      float or ndarray

  calculate : Calculate the amplitude
  Static Methods
  --------------
  measure : Same as calculate but static (returns the amplitude directly)

class crikit.measurement.peakamps.MeasurePeakBWTroughs(pk, tr1, tr2)

  Bases: `crikit.measurement.peakamps.AbstractMeasureThree`

  Meausure the amplitude of a peak between troughs.

  Parameters

    - pk (int) – Peak location in pixel coordinates

    - tr1 (int) – Trough 1 location in pixel coordinates

    - tr2 (int) – Trough 2 location in pixel coordinates

  output

    Amplitude of peak

    Type

      float or ndarray

  calculate : Calculate the amplitude
  Static Methods
  --------------
  measure : Same as calculate but static (returns the amplitude directly)

class crikit.measurement.peakamps.MeasurePeakDivide(f1, f2)

  Bases: `crikit.measurement.peakamps.AbstractMeasureTwo`

  Meausure the ratio (division) of two peaks. f1/f2

  Parameters

    - f1 (int) – Peak location in pixel coordinates

    - f2 (int) – Peak location in pixel coordinates

  output

    Amplitude of peak

    Type

      float or ndarray

  calculate : Calculate the amplitude
  Static Methods
  --------------
  measure : Same as calculate but static (returns the amplitude directly)

class crikit.measurement.peakamps.MeasurePeakMax(f1, f2)

  Bases: `crikit.measurement.peakamps.AbstractMeasureTwoOrdered`

  Meausure the maximum across the range [f1,f2]. Note

    that real and imag are treated separately.

  Parameters

    - f1 (int) – Peak location in pixel coordinates

    - f2 (int) – Peak location in pixel coordinates

  output

    Amplitude

    Type

      float or ndarray

  calculate : Calculate the amplitude
  Static Methods
  --------------
  measure : Same as calculate but static (returns the amplitude directly)

class crikit.measurement.peakamps.MeasurePeakMaxAbs(f1, f2)

  Bases: `crikit.measurement.peakamps.AbstractMeasureTwoOrdered`

  Meausure the maximum across the absolute value across the range [f1,f2]. Note that real and imag are

  > treated separately.

  Parameters

    - f1 (int) – Peak location in pixel coordinates

    - f2 (int) – Peak location in pixel coordinates

  output

    Amplitude of peak

    Type

      float or ndarray

  calculate : Calculate the amplitude
  Static Methods
  --------------
  measure : Same as calculate but static (returns the amplitude directly)

class crikit.measurement.peakamps.MeasurePeakMin(f1, f2)

  Bases: `crikit.measurement.peakamps.AbstractMeasureTwoOrdered`

  Meausure the minimum across the range [f1,f2]. Note

    that real and imag are treated separately.

  Parameters

    - f1 (int) – Peak location in pixel coordinates

    - f2 (int) – Peak location in pixel coordinates

  output

    Amplitude of peak

    Type

      float or ndarray

  calculate : Calculate the amplitude
  Static Methods
  --------------
  measure : Same as calculate but static (returns the amplitude directly)

class crikit.measurement.peakamps.MeasurePeakMinAbs(f1, f2)

  Bases: `crikit.measurement.peakamps.AbstractMeasureTwoOrdered`

  Meausure the summation of all amplitudes between (inclusive) two peak locations. Note that real and imag are treated

  > separately.

  Parameters

    - f1 (int) – Peak location in pixel coordinates

    - f2 (int) – Peak location in pixel coordinates

  output

    Amplitude of peak

    Type

      float or ndarray

  calculate : Calculate the amplitude
  Static Methods
  --------------
  measure : Same as calculate but static (returns the amplitude directly)

class crikit.measurement.peakamps.MeasurePeakMinus(f1, f2)

  Bases: `crikit.measurement.peakamps.AbstractMeasureTwo`

  Meausure the difference (subtraction) of two peaks (f1 - f2).

  Parameters

    - f1 (int) – Peak location in pixel coordinates

    - f2 (int) – Peak location in pixel coordinates

  output

    Amplitude of peak

    Type

      float or ndarray

  calculate : Calculate the amplitude
  Static Methods
  --------------
  measure : Same as calculate but static (returns the amplitude directly)

class crikit.measurement.peakamps.MeasurePeakMultiply(f1, f2)

  Bases: `crikit.measurement.peakamps.AbstractMeasureTwo`

  Meausure the multiplication of two peak.

  Parameters

    - f1 (int) – Peak location in pixel coordinates

    - f2 (int) – Peak location in pixel coordinates

  output

    Amplitude of peak

    Type

      float or ndarray

  calculate : Calculate the amplitude
  Static Methods
  --------------
  measure : Same as calculate but static (returns the amplitude directly)

class crikit.measurement.peakamps.MeasurePeakSum(f1, f2)

  Bases: `crikit.measurement.peakamps.AbstractMeasureTwoOrdered`

  Meausure the summation of all amplitudes between (inclusive) two peak locations.

  Parameters

    - f1 (int) – Peak location in pixel coordinates

    - f2 (int) – Peak location in pixel coordinates

  output

    Amplitude of peak

    Type

      float or ndarray

  calculate : Calculate the amplitude
  Static Methods
  --------------
  measure : Same as calculate but static (returns the amplitude directly)

class crikit.measurement.peakamps.MeasurePeakSumAbsReImag(f1, f2)

  Bases: `crikit.measurement.peakamps.AbstractMeasureTwoOrdered`

  Meausure the summation of the absolute value of all amplitudes between (inclusive) two peak locations. Note that the absolute value is performed on the real and imaginary parts separately – it’s not a true absolute value.

  Parameters

    - f1 (int) – Peak location in pixel coordinates

    - f2 (int) – Peak location in pixel coordinates

  output

    Amplitude of peak

    Type

      float or ndarray

  calculate : Calculate the amplitude
  Static Methods
  --------------
  measure : Same as calculate but static (returns the amplitude directly)

## crikit.measurement.peakfind module

Peak-finding utilities

Notes

class crikit.measurement.peakfind.PeakFinder(noise_sigma, cwt_width=10, n_noise_tests=1000, cutoff_d1=None, cutoff_d2=None, verbose=True)

  Bases: `object`

  Find peaks and shoulders of a signal.

  Parameters

    QQ (int) – Peak location in pixel coordinates

  amp

    Amplitude of peak

    Type

      float or ndarray

  calculate : Calculate the amplitude
  Static Methods
  --------------
  measure : Same as calculate but static (returns the amplitude directly)
  calculate(y, x=None, recalc_cutoff=True, method='auto')

    Find peaks

  static cwt_diff(signal, wv_width, order=1, method='auto')

    Take a numerical derivative using a Haar wavelet (noise-supression)

    Parameters

      - signal (ndarray (1D)) – Signal data

      - wv_width (int) – Width of wavelet to use (balance noise suppression and distortion)

      - order (int, optional (default=1)) – Order of derivative (e.g., 1st-order derivative)

      - method (str {'auto' (default), 'fft', 'direct'}) –

    Returns

      deriv – Derivative of input signal

    Return type

      ndarray (1D)

  property cwt_width
  static haar(width)

    Create Haar wavelet (wv) with specified width (width)

  property noise_sigma

## Module contents