crikit.measurement package

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)[source]

Bases: object

FFT Spatial Noise Metric (Ratio - 1)

_calc_mtxs()[source]

Calculate binary spatial weight maxtrix, wij.

Note: Currently only supports 1st-order “rook’s” case continuity

calc(img)[source]

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)[source]

Bases: object

Abstract class for measurements that take 3 things

_calc(signal)[source]
calculate(signal)[source]
classmethod measure(signal, f1, f2, f3)[source]
class crikit.measurement.peakamps.AbstractMeasureTwo(f1, f2)[source]

Bases: object

Abstract class for measurements that take 2 things

_calc(signal)[source]
calculate(signal)[source]
classmethod measure(signal, f1, f2)[source]
class crikit.measurement.peakamps.AbstractMeasureTwoOrdered(f1, f2)[source]

Bases: crikit.measurement.peakamps.AbstractMeasureTwo

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

class crikit.measurement.peakamps.MeasurePeak(f1)[source]

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)
_calc(signal)[source]
calculate(signal)[source]
classmethod measure(signal, f1)[source]
class crikit.measurement.peakamps.MeasurePeakAdd(f1, f2)[source]

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)
_calc(signal)[source]
class crikit.measurement.peakamps.MeasurePeakBWTroughs(pk, tr1, tr2)[source]

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)
_calc(signal)[source]
class crikit.measurement.peakamps.MeasurePeakDivide(f1, f2)[source]

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)
_calc(signal)[source]
class crikit.measurement.peakamps.MeasurePeakMax(f1, f2)[source]

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)
_calc(signal)[source]
class crikit.measurement.peakamps.MeasurePeakMaxAbs(f1, f2)[source]

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)
_calc(signal)[source]
class crikit.measurement.peakamps.MeasurePeakMin(f1, f2)[source]

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)
_calc(signal)[source]
class crikit.measurement.peakamps.MeasurePeakMinAbs(f1, f2)[source]

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)
_calc(signal)[source]
class crikit.measurement.peakamps.MeasurePeakMinus(f1, f2)[source]

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)
_calc(signal)[source]
class crikit.measurement.peakamps.MeasurePeakMultiply(f1, f2)[source]

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)
_calc(signal)[source]
class crikit.measurement.peakamps.MeasurePeakSum(f1, f2)[source]

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)
_calc(signal)[source]
class crikit.measurement.peakamps.MeasurePeakSumAbsReImag(f1, f2)[source]

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)
_calc(signal)[source]

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)[source]

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)
_calc_cutoff(recalc_cutoff=True, method='auto')[source]
calculate(y, x=None, recalc_cutoff=True, method='auto')[source]

Find peaks

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

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)[source]

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

property noise_sigma

Module contents