crikit.ui package

Submodules

crikit.ui.classes_ui module

User Interface and Visualization Classes (crikit.ui.classes_ui)

BW : Grayscale images

SingleColor : Single-color images

_ColorMath : Container of math operations

class crikit.ui.classes_ui.BW(**kwargs)[source]

Bases: object

property grayscaleimage
property image

For image from property settings (limits, compression, etc)

property maxer
property mean
property minner
set_x(value, units=None)[source]
set_y(value, units=None)[source]
property std
property winextent
property x
property xlen
property y
property ylen
class crikit.ui.classes_ui.CompositeColor(sgl_color_list=None)[source]

Bases: crikit.ui.classes_ui.BW

property image

For image from property settings (limits, compression, etc)

property mode_txt
property xlen
property ylen
class crikit.ui.classes_ui.SingleColor[source]

Bases: crikit.ui.classes_ui.BW, crikit.ui.classes_ui._ColorMath

property image

For image from property settings (limits, compression, etc)

property imageGS

Returns self.grayscaleimage with limits applied

crikit.ui.dialog_AbstractFactorization module

Abstract Factorization Class

Created on Mon Jul 25 10:44:03 2016

@author: chc

class crikit.ui.dialog_AbstractFactorization.DialogAbstractFactorization(parent=None)[source]

Bases: PyQt5.QtWidgets.QDialog

SubUiSVD : SVD SubUI

advance()[source]

View next set of SVs

applyCheckBoxes()[source]

Add checked singular values (and remove un-checked SVs)

clear()[source]

Clear selected singular values (i.e., none will be selected)

combiner(factors=None)[source]
get_spatial_slice(num)[source]
get_spectral_slice(num)[source]
max_factors()[source]
mean_spatial(cube)[source]
mean_spectral(cube)[source]
runScript()[source]

Run “script” of singular value selection

Example

[1,2,3,5:7] = 1,2,3,5,6,7

setup(parent=None)[source]
setupData(img_shape)[source]
ui_changes()[source]

Any changes to ui labels or otherwise for particular implementation

property unselected_factors
updateCurrentRemainder()[source]

Update image reconstructed (mean over spectral vector) using remaining (unselected) singular values

updatePlots(startnum=0)[source]

Update images and spectra of set of singular values starting at SV number startnum

crikit.ui.dialog_AbstractPlotEffect module

Created on Thu Dec 22 10:04:39 2016

@author: chc

class crikit.ui.dialog_AbstractPlotEffect.AbstractPlotEffectPlugin[source]

Bases: PyQt5.QtWidgets.QWidget

changed
fcn(data_in)[source]
labels_affected = {'title': 'Affected', 'x_label': 'x', 'y_label': 'y'}
labels_orig = {'title': 'Original', 'x_label': 'x', 'y_label': 'y'}
parameters = {'long_name': 'Longer Name', 'name': 'Name'}

crikit.ui.dialog_AnscombeParams module

Calculate Anscombe Parameters

class crikit.ui.dialog_AnscombeParams.DialogCalcAnscombeParams(parent=None, dark_array=None, rep_array=None, axis=None, rng=None, dark_sub=None)[source]

Bases: PyQt5.QtWidgets.QDialog

References

static dialogCalcAnscombeParams(parent=None, dark_array=None, rep_array=None, axis=None, rng=None, dark_sub=None)[source]

Calculate Anscombe Parameters

Parameters

None (None) –

updateInputValues()[source]
updateOutputValues()[source]

crikit.ui.dialog_SVD module

Created on Mon Jul 25 13:57:24 2016

@author: chc

class crikit.ui.dialog_SVD.DialogSVD(data, img_shape, mask=None, use_imag=True, img_all=None, spect_all=None, parent=None)[source]

Bases: crikit.ui.dialog_AbstractFactorization.DialogAbstractFactorization

SVD Class

combiner(selections=None)[source]

Performs U*S*Vh

static dialogSVD(data, img_shape, mask=None, use_imag=True, img_all=None, spect_all=None, parent=None)[source]
get_spatial_slice(num)[source]
get_spectral_slice(num)[source]
max_factors()[source]

Return maximum number of factors. Since DialogAbstractFactorization (parent) is initialized first (before self.s), need to return None at first.

mean_spatial(cube)[source]
mean_spectral(cube)[source]
s_from_selected(selections=None)[source]

Return SVD S-matrix of SELECTED singular values

crikit.ui.dialog_kkOptions module

Kramers-Kronig phase retrieval

References

[1] C H Camp Jr, Y J Lee, and M T Cicerone, “Quantitative, Comparable Coherent Anti-Stokes Raman Scattering (CARS) Spectroscopy: Correcting Errors in Phase Retrieval,” Journal of Raman Spectroscopy (2016). arXiv:1507.06543.

class crikit.ui.dialog_kkOptions.DialogKKOptions(parent=None, data=None, conjugate=False)[source]

Bases: PyQt5.QtWidgets.QDialog

DialogKKOptions : Phase-Retrieval (only Kramers-Kronig currently supported) options dialog

dialogKKOptions : Used to call UI and retrieve results of dialog

References

[1] Y. Liu, Y. J. Lee, and M. T. Cicerone, “Broadband CARS spectral phase retrieval using a time-domain Kramers-Kronig transform,” Opt. Lett. 34, 1363-1365 (2009).

[2] C H Camp Jr, Y J Lee, and M T Cicerone, “Quantitative, Comparable Coherent Anti-Stokes Raman Scattering (CARS) Spectroscopy: Correcting Errors in Phase Retrieval,” Journal of Raman Spectroscopy (2016). arXiv:1507.06543.

CARS_AMP = 0.0
NORM_TO_NRB = True
NRB_AMP = 0.0
N_EDGE = 30
PAD_FACTOR = 1
PHASE_OFFSET = 0.0
static dialogKKOptions(parent=None, data=None, conjugate=False)[source]

Retrieve dark subtraction dialog results

Parameters

None (None) –

Returns

out – ‘phase_offset’float, ‘norm_to_nrb’bool,

’pad_factor’ : int}

In order: CARS amp offset, NRB amp offset, phase offset, normalize

by NRB, pad factor

Return type

dict{‘cars_amp’ : float, ‘nrb_amp’ : float,

goInteractive()[source]

crikit.ui.dialog_model module

Dialog for creating BCARS or Raman numerical phantom

class crikit.ui.dialog_model.DialogModel(cplx=True, parent=None)[source]

Bases: PyQt5.QtWidgets.QDialog

Dialog for creating BCARS or Raman numerical phantom

changeSize()[source]
static dialogModel(cplx=True, parent=None)[source]

crikit.ui.dialog_ploteffect module

Extensible Dialog that shows the effect of a plugin on input data.

Created on Wed Dec 21 21:36:00 2016

@author: chc

class crikit.ui.dialog_ploteffect.DialogPlotEffect(data, x=None, plugin=None, mpl_kwargs={'height': 2, 'width': 8}, parent=None)[source]

Bases: PyQt5.QtWidgets.QDialog

Extensible Dialog that shows the effect of a plugin on input data.

Parameters
  • data (ndarray (ND)) – Input data

  • x (ndarray (1D)) – Independent variable

  • plugin (sub-class of AbstractPlotEffectPlugin) – Plugin class instance

  • parent (QObject) – Parent

TRANSPOSE_ARR = True
static dialogPlotEffect(data, x=None, plugin=None, parent=None)[source]

Static method that is actually called

make_affected_plots(data, lw=1, ls='-')[source]
make_orig_plots(data, lw=1, ls='-')[source]
make_plots(canvas, data, lw=1, ls='-')[source]
plot_labels()[source]

Add axis labels and titles

widget_changed()[source]

Plugin widget has changed. Re-submit data to plugin function.

class crikit.ui.dialog_ploteffect.widgetDemoPlotEffectPlugin(offset=0.1, parent=None)[source]

Bases: crikit.ui.dialog_AbstractPlotEffect.AbstractPlotEffectPlugin

Very simple demo of a plugin

fcn(data_in)[source]

If return list, [0] goes to original, [1] goes to affected

labels_affected = {'title': 'Affected', 'x_label': 'Wavenumber (cm$^{-1}$)', 'y_label': 'Output Int (au)'}
labels_orig = {'title': 'Original', 'x_label': 'Wavenumber (cm$^{-1}$)', 'y_label': 'Input Int (au)'}
parameters = {'long_name': 'Demo of PlotEffectPlugins', 'name': 'DEMO'}

crikit.ui.dialog_save module

CRIkit Save Dialog (crikit.ui.dialog_save)

Classes that present dialog boxes that retrieve options

DialogSave : Save Dialog

class crikit.ui.dialog_save.DialogSave(current_filename=None, current_path=None, current_dataset_name=None, save_filename=None, save_path=None, save_dataset_name=None, suffix=None, parent=None)[source]

Bases: PyQt5.QtWidgets.QDialog

DialogDarkOptions : Dark subtraction options dialog

dialogSave : Used to call UI and retrieve results of dialog
changeDataset()[source]
changeFilename()[source]
changePath()[source]
static dialogSave(current_filename=None, current_path=None, current_dataset_name=None, save_filename=None, save_path=None, save_dataset_name=None, suffix=None, parent=None)[source]

Retrieve save dialog results

Parameters
  • current_filename (str) – Filename of HDF5 file from where current data resided

  • current_path (str) – Path to HDF5 file from where current data resided

  • current_dataset_name (str) – Dataset path and name where current data resided

  • save_filename (str) – Filename of HDF5 file where previously saved (if so)

  • save_path (str) – Path of HDF5 file where previously saved (if so)

  • save_dataset_name (str) – Dataset path and name where previously saved (if so)

  • suffix (str) – Suffix to append to _dataset_name based on processing steps

  • NOTE (save* parameters supercede current* parameters) –

Returns

out – Filename : str Path : str Dataset_name_path : str

Return type

(tuple)

generateDatasetName()[source]
generateFilename()[source]
getFilename()[source]
getPath()[source]

crikit.ui.dialog_subResidualOptions module

References

[1] C H Camp Jr, Y J Lee, and M T Cicerone, “Quantitative, Comparable Coherent Anti-Stokes Raman Scattering (CARS) Spectroscopy: Correcting Errors in Phase Retrieval,” Journal of Raman Spectroscopy (2016). arXiv:1507.06543.

class crikit.ui.dialog_subResidualOptions.DialogSubResidualOptions(parent=None)[source]

Bases: PyQt5.QtWidgets.QDialog

RESIDUAL_FREQ = [-1500, -400]
static dialogSubResidualOptions(parent=None, imgloaded=False, nrbloaded=False)[source]

Retrieve dark subtraction dialog results

Parameters
  • imgloaded ((bool)) – Is there an HSI image loaded?

  • nrbloaded ((bool)) – Is there an NRB loaded?

Returns

out – In order: subtract residual from image, subtract residual from NRB, range to subtract from.

Return type

dict{‘submain’ : bool, ‘subnrb’ : bool, ‘subrange’ : list}

crikit.ui.dialog_varstabAnscombeOptions module

Created on Sat Jul 23 21:38:08 2016

@author: chc

class crikit.ui.dialog_varstabAnscombeOptions.DialogAnscombeOptions(stddev=12.44, gain=1.4, parent=None)[source]

Bases: PyQt5.QtWidgets.QDialog

DialogAnscombeOptions : Anscombe Transformation options dialog

dialogAnscombeOptions : Used to call UI and retrieve results of dialog

References

[1] C H Camp Jr, Y J Lee, and M T Cicerone, “Quantitative, Comparable Coherent Anti-Stokes Raman Scattering (CARS) Spectroscopy: Correcting Errors in Phase Retrieval,” Journal of Raman Spectroscopy (2016). arXiv:1507.06543.

static dialogAnscombeOptions(stddev=12.44, gain=1.4, parent=None)[source]

Retrieve Anscombe Transform dialog results

Parameters

None (None) –

Returns

out – Standard deviation of Gaussian noise : (float) Detector gain of Poisson noise : (float)

Return type

dict{‘gain’ : float, ‘stddev’ : float}

crikit.ui.helper_plotOptions module

Created on Sun Oct 4 00:28:16 2015

@author: camp

class crikit.ui.helper_plotOptions.plotStyle(num_current_plots=0)[source]

Bases: object

COLOR_DICT = {'Blue': [0, 0, 1], 'Cyan': [0, 0.8, 0.8], 'Green': [0, 0.5, 0], 'Magenta': [1, 0, 1], 'Red': [1, 0, 0], 'Yellow': [0.8, 0.8, 0]}
COLOR_VEC = ['Blue', 'Green', 'Red', 'Magenta', 'Yellow', 'Cyan']
LINESTYLE_VEC = ['-', '--', '-.', ':', 'None']
LINESTYLE_VEC_STR = ['Solid', 'Dashed', 'Dash-Dot', 'Dotted', 'None']
LINEWIDTH = 1.0
MARKERSIZE = 5.0
MARKER_VEC = ['None', '.', ',', 'o', 'v', '^', '<', '>', '8', 's', 'p', '*', 'h', 'H', '+', 'x', 'D', 'd', '|', '_']
MARKER_VEC_STR = ['None', 'Point', 'Pixel', 'Circle', 'Triangle Down', 'Triangle Up', 'Triangle Left', 'Triangle Right', 'Octagon', 'Square', 'Pentagon', 'Star', 'Hexagon 1', 'Hexagon 2', 'Plus', 'X', 'Diamond', 'Thin Diamondd', 'Vert Line', 'Horiz Line']
getLineStyle(num_current_plots=0)[source]
property linestyle_str
property marker_str
property qcolor

crikit.ui.helper_roiselect module

class crikit.ui.helper_roiselect.ImageSelection(parent=None)[source]

Bases: object

append_selection(xpix, ypix, x=None, y=None)[source]
clear_all()[source]
property num_selections

crikit.ui.main_Mosaic module

MainWindow program that allows construction of stitched images from multiple dataset

class crikit.ui.main_Mosaic.DnDReorderListWidget(parent)[source]

Bases: PyQt5.QtWidgets.QListWidget

List widget with drag-n-drop reordering

dropEvent(self, QDropEvent)[source]
reordered
class crikit.ui.main_Mosaic.MainWindowMosaic(parent=None)[source]

Bases: PyQt5.QtWidgets.QMainWindow

addDataset()[source]
check_for_spatial_calib(dset)[source]

See if dataset has spatial calibration meta data

check_for_spectral_calib(dset)[source]

See if dataset has spectral calibration meta data

closeEvent(self, QCloseEvent)[source]
config = {'allow_duplicates': False}
deleteDataset()[source]
frequency_calib = {'Calib_WL': 700.0, 'Center_WL': 700.0, 'Intercept': 832.5510120093941, 'Probe': 771.461, 'Slope': -0.165955456}
init_internals()[source]

Initialize internal variables

is_duplicate_import(to_open)[source]
lineEditPixChange()[source]

Frequency manually entered in frequency-slider-display

list_reordered()[source]
promote_demote_list_item()[source]
save()[source]
setupListWidget()[source]
updateDatasets()[source]

Update the listWidget of datasets

updateFrequency(calib_vec=None)[source]
updateMosaicImage()[source]
updateParams()[source]

Update Mosaic object parameters

updateSlider()[source]

crikit.ui.widget_ALS module

Widget for PlotEffect that adjusts the parameters appropriate for asymmetric least squares (ALS)

Created on Thu Dec 22 01:16:01 2016

@author: chc

class crikit.ui.widget_ALS.widgetALS(x=None, rng=None, smoothness_param=1, asym_param=0.001, redux=10, order=2, fix_end_points=True, fix_const=1, fix_rng=None, max_iter=100, min_diff=1e-06, verbose=False, sub_asym_list=None, sub_w_list=None, parent=None)[source]

Bases: crikit.ui.dialog_AbstractPlotEffect.AbstractPlotEffectPlugin

Widget for PlotEffect that adjusts the parameters appropriate for asymmetric least squares (ALS)

Parameters
  • smoothness_param (float, optional (default, 1e3)) – Smoothness parameter

  • asym_param (float, optional (default, 1e-4)) – Assymetry parameter

  • redux (int, optional (default, 1)) – Reduction parameter to sub-sample input signal

  • order (int, optional (default, 2)) – Derivative regularization term. Order=2 for Whittaker-smoother

  • fix_end_points (bool, optional (default, False)) – Weight the baseline endpoints to approach equally the end-points of the data.

  • max_iter (int, optional (default, 100)) – Maximum number of least-squares iterations to perform

  • min_diff (float, optional (default, 1e-5)) – Break iterative calculations if difference is less than min_diff

  • parent (QObject) – Parent

fcn : Perform ALS detrending
Signals:

changed : a value in the UI has changed

asym_sub_val_change()[source]

P Subsections spinbox has changed value

asymspinboxchanged()[source]

Asymetry parameter-related values have changed

fcn(data_in)[source]

If return list, [0] goes to original, [1] goes to affected

labels_affected = {'title': 'Detrended', 'x_label': 'Wavenumber (cm$^{-1}$)', 'y_label': 'Output Int (au)'}
labels_orig = {'title': 'Original', 'x_label': 'Wavenumber (cm$^{-1}$)', 'y_label': 'Input Int (au)'}
parameters = {'long_name': 'Asymmetric least squares', 'name': 'ALS'}
selectFixedEnds()[source]

Check selection of fixed end-points

setup_asym()[source]

P/asymmetry parameter related

setup_smoothness()[source]

Lambda/smoothness parameter rlated

spinBoxChanged()[source]

Controller for all spinBoxes

weight_sub_val_change()[source]

Weights Subsections spinbox has changed value

weightspinboxchanged()[source]

Weight parameter-related values have changed

property x

crikit.ui.widget_ArPLS module

Widget for PlotEffect that adjusts the parameters appropriate for asymmetrically reweights penalized least squares (arPLS)

Created on Thu Dec 22 01:16:01 2016

@author: chc

class crikit.ui.widget_ArPLS.widgetArPLS(smoothness_param=1, redux=1, fix_end_points=True, max_iter=100, min_diff=1e-06, parent=None)[source]

Bases: crikit.ui.dialog_AbstractPlotEffect.AbstractPlotEffectPlugin

Widget for PlotEffect that adjusts the parameters appropriate for asymmetrically reweights penalized least squares (arPLS)

Parameters
  • smoothness_param (float, optional (default, 1e3)) – Smoothness parameter

  • redux (int, optional (default, 1)) – Reduction parameter to sub-sample input signal

  • order (int, optional (default, 2)) – Derivative regularization term. Order=2 for Whittaker-smoother

  • fix_end_points (bool, optional (default, False)) – Weight the baseline endpoints to approach equally the end-points of the data.

  • max_iter (int, optional (default, 100)) – Maximum number of least-squares iterations to perform

  • min_diff (float, optional (default, 1e-5)) – Break iterative calculations if difference is less than min_diff

  • parent (QObject) – Parent

fcn : Perform arPLS detrending
Signals:

changed : a value in the UI has changed

fcn(data_in)[source]

If return list, [0] goes to original, [1] goes to affected

labels_affected = {'title': 'Detrended', 'x_label': 'Wavenumber (cm$^{-1}$)', 'y_label': 'Output Int (au)'}
labels_orig = {'title': 'Original', 'x_label': 'Wavenumber (cm$^{-1}$)', 'y_label': 'Input Int (au)'}
parameters = {'long_name': 'Asymmetrically reweighted penalized least squares', 'name': 'arPLS'}
selectFixedEnds()[source]

Check selection of fixed end-points

spinBoxChanged()[source]

Controller for all spinBoxes

crikit.ui.widget_Calibrate module

Widget for PlotEffect that adjusts the parameters appropriate for calibration

Created on Thu Dec 22 14:27:46 2016

@author: chc

class crikit.ui.widget_Calibrate.widgetCalibrate(calib_dict, parent=None)[source]

Bases: crikit.ui.dialog_AbstractPlotEffect.AbstractPlotEffectPlugin

Widget for PlotEffect that adjusts the parameters appropriate for calibration

Parameters

calib_dict (dict) – Calibration dictionary

fcn : Perform arPLS detrending
Signals:

changed : a value in the UI has changed

fcn(data_in)[source]

Returns a shifted version of the input spectrum to mimic the effect of calibration. (Real calibration doesn’t shift the spectrum, but rather the independent variable)

labels_affected = {'title': 'Calibrated', 'x_label': 'Wavenumber (cm$^{-1}$)', 'y_label': 'Output Int (au)'}
labels_orig = {'title': 'Uncalibrated', 'x_label': 'Wavenumber (cm$^{-1}$)', 'y_label': 'Input Int (au)'}
meas_vs_ideal()[source]
parameters = {'long_name': 'Spectral Calibration', 'name': 'Calibrate'}
setup_calib()[source]
spinBoxChanged()[source]

Controller for all spinBoxes

crikit.ui.widget_Cut_every_n_spectra module

Widget for PlotEffect that sets the parameters to cut M spectra of every N spectra

class crikit.ui.widget_Cut_every_n_spectra.widgetCutEveryNSpectra(offset=0, cut_m=1, every_n=100, action='cut', parent=None)[source]

Bases: crikit.ui.dialog_AbstractPlotEffect.AbstractPlotEffectPlugin

Widget for PlotEffect that adjusts the parameters appropriate for the Cutting Every N Spectra.

cars_amp_offset

DC offset applied to CARS spectrum(a) prior to KK relation.

Type

float, optional (default=0.0)

nrb_amp_offset

DC offset applied to NRB spectrum(a) prior to KK relation.

Type

float, optional (default=0.0)

phase_offset

Phase constant or ndarray applied to retrieved phase prior to separating the real and imaginary components.

Type

float or ndarray, optional (default=0.0)

norm_to_nrb

Normalize the amplitude by sqrt(NRB). This effectively removes several system reponse functions.

Type

bool, optional (default=True)

pad_factor

Multiple size of spectral-length to pad the ends of each spectra with. Padded with a constant value corresponding to the value at that end of the spectrum.

Type

int, optional (default=1)

fcn : Performs the KK
Signals:

changed : a value in the UI has changed

comboBoxChanged()[source]

Action comboBox box changed

fcn(data_in)[source]

Return the plot with the appropriate cuts

labels_affected = {'title': 'Cropped Spectra', 'x_label': 'Repetition Number', 'y_label': 'Intensity (au)'}
labels_orig = {'title': 'Original', 'x_label': 'Repetition Number', 'y_label': 'Intensity (au)'}
parameters = {'long_name': 'Cut M Spectra Every N Spectra', 'name': 'CutEveryNSpectra'}
setupOptions()[source]
spinBoxChanged()[source]

Controller for all spinBoxes

crikit.ui.widget_DeTrending module

Widget for PlotEffect that contains and presents different detrending algorithms. Whichever algorithm is plugged in effectively acts as the widget as far as PlotEffect is concerned.

Created on Wed Dec 7 13:36:48 2016

@author: chc

class crikit.ui.widget_DeTrending.widgetDeTrending(parent=None)[source]

Bases: crikit.ui.dialog_AbstractPlotEffect.AbstractPlotEffectPlugin

Widget for PlotEffect that contains and presents different detrending algorithms. Whichever algorithm is plugged in effectively acts as the widget as far as PlotEffect is concerned.

changeWidget(buttonId)[source]

Change active widget

widgetOptionsChanged()[source]

Options within the active widget were changed

crikit.ui.widget_Jupyter module

Created on Wed Mar 2 17:12:54 2016

@author: chc

class crikit.ui.widget_Jupyter.QJupyterWidget(*args, **kwargs)[source]

Bases: qtconsole.rich_jupyter_widget.RichJupyterWidget

Convenience class for a live IPython console widget. We can replace the standard banner using the customBanner argument

clearTerminal()[source]

Clears the terminal

executeCommand(command)[source]

Execute a command in the frame of the console widget

printText(text)[source]

Prints some plain text to the console

pushVariables(variableDict)[source]

Given a dictionary containing name / value pairs, push those variables to the IPython console widget

crikit.ui.widget_KK module

Widget for PlotEffect that adjusts the parameters appropriate for the Kramers-Kronig relation

Created on Thu Dec 22 11:43:42 2016

@author: chc

class crikit.ui.widget_KK.widgetKK(cars_amp_offset=0.0, nrb_amp_offset=0.0, conjugate=False, phase_offset=0.0, norm_to_nrb=True, pad_factor=1, n_edge=30, parent=None)[source]

Bases: crikit.ui.dialog_AbstractPlotEffect.AbstractPlotEffectPlugin

Widget for PlotEffect that adjusts the parameters appropriate for the Kramers-Kronig (KK) relation phase retrieval.

cars_amp_offset

DC offset applied to CARS spectrum(a) prior to KK relation.

Type

float, optional (default=0.0)

nrb_amp_offset

DC offset applied to NRB spectrum(a) prior to KK relation.

Type

float, optional (default=0.0)

phase_offset

Phase constant or ndarray applied to retrieved phase prior to separating the real and imaginary components.

Type

float or ndarray, optional (default=0.0)

norm_to_nrb

Normalize the amplitude by sqrt(NRB). This effectively removes several system reponse functions.

Type

bool, optional (default=True)

pad_factor

Multiple size of spectral-length to pad the ends of each spectra with. Padded with a constant value corresponding to the value at that end of the spectrum.

Type

int, optional (default=1)

fcn : Performs the KK
Signals:

changed : a value in the UI has changed

changeCheckBoxConjugate()[source]
changeCheckBoxLockBias()[source]
changeCheckBoxNRBNorm()[source]
changeShowReal()[source]
fcn(data_in)[source]

If return list, [0] goes to original, [1] goes to affected

labels_affected = {'title': 'KK-Raman', 'x_label': 'Wavenumber (cm$^{-1}$)', 'y_label': 'Raman-Like Int (au)'}
labels_orig = {'title': 'Original', 'x_label': 'Wavenumber (cm$^{-1}$)', 'y_label': 'Input Int (au)'}
parameters = {'long_name': 'Kramers-Kronig Relation', 'name': 'KK'}
setupKK()[source]
spinBoxChanged()[source]

Controller for all spinBoxes

crikit.ui.widget_SG module

Widget for PlotEffect that adjusts the parameters appropriate for Savitky-Golay filtering

Created on Thu Dec 22 11:18:36 2016

@author: chc

class crikit.ui.widget_SG.widgetSG(window_length=601, polyorder=2, parent=None)[source]

Bases: crikit.ui.dialog_AbstractPlotEffect.AbstractPlotEffectPlugin

Widget for PlotEffect that adjusts the parameters appropriate for Savitky-Golay filtering

Parameters
  • window_length (int) – Window length

  • polyorder (int) – Polynomial order

  • parent (QObject) – Parent

fcn : Performs the Savitky-Golay
Signals:

changed : a value in the UI has changed

changeOrder()[source]
changeWinSize()[source]
fcn(data_in)[source]

If return list, [0] goes to original, [1] goes to affected

labels_affected = {'title': 'Difference', 'x_label': 'Wavenumber (cm$^{-1}$)', 'y_label': 'Difference (au)'}
labels_orig = {'title': 'Original', 'x_label': 'Wavenumber (cm$^{-1}$)', 'y_label': 'Input Int (au)'}
parameters = {'long_name': 'Savitky-Golay filtering', 'name': 'SG'}

crikit.ui.widget_images module

Visualization Widgets (crikit.ui.widget_images)

widgetColorMath : Mathematical operations on raw data leading to color images

widgetBWImg : Grayscale imagery

widgetSglColor : Single-color imagery

widgetCompositeColor : Composite-color imagery

_mplWin : Matplotlib window container

class crikit.ui.widget_images.widgetBWImg(parent=None, **kwargs)[source]

Bases: PyQt5.QtWidgets.QWidget

Grayscale image widget

checkBoxFixed()[source]

See if the min and max are identified as being fixed by checkbox

checkBoxRemOutliers()[source]
comboBoxCompress()[source]

See if compression is activated via the comboBoxAboveMax

createImg(img, xunits=None, yunits=None, extent=None, cmap=<matplotlib.colors.LinearSegmentedColormap object>)[source]
createImg_Ext(img, xunits=None, yunits=None, extent=None, showcbar=True, axison=True, cmap=<matplotlib.colors.LinearSegmentedColormap object>, parent=None)[source]

Create new figure window and show image of img

initData()[source]

(Re)-initialize self.data

spinBoxMinMaxSet()[source]
class crikit.ui.widget_images.widgetColorMode(parent=None, **kwargs)[source]

Bases: PyQt5.QtWidgets.QWidget

Color mode selector

class crikit.ui.widget_images.widgetCompositeColor(sgl_color_widget_list=None, parent=None, **kwargs)[source]

Bases: PyQt5.QtWidgets.QWidget

changeMode()[source]
createImg(img, xunits=None, yunits=None, extent=None, cmap=<matplotlib.colors.LinearSegmentedColormap object>)[source]
createImg_Ext(img, xunits=None, yunits=None, extent=None, showcbar=True, axison=True, cmap=<matplotlib.colors.LinearSegmentedColormap object>, parent=None)[source]

Create new figure window and show image of img

initData(sgl_color_widget_list)[source]

(Re)-initialize self.data

class crikit.ui.widget_images.widgetGrayScaleInfoBar(parent=None, **kwargs)[source]

Bases: PyQt5.QtWidgets.QWidget

Grayscale image info bar

class crikit.ui.widget_images.widgetImageGainMath(parent=None, **kwargs)[source]

Bases: PyQt5.QtWidgets.QWidget

Panel that controle image gain and applies math

COND_TYPE_STRINGS = ['>', '<', '=', '<=', '>=']
OPERATION_FREQ_COUNT = [1, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 2]
OPERATION_STRINGS = ['', '+', '-', '*', '/', 'Peak b/w troughs', 'SUM', 'SUM(ABS(Re) + 1j*ABS(Im))', 'Max', 'Min', 'MaxAbs', 'MinAbs']
clear()[source]

Resets the ui to it’s initial state

condOpsChange()[source]
operationchange()[source]
class crikit.ui.widget_images.widgetPopSpectrumGS(parent=None, **kwargs)[source]

Bases: PyQt5.QtWidgets.QWidget

Panel that let’s user pop the current image, an average spectrum, or a grayscale image to SciPlot

class crikit.ui.widget_images.widgetSglColor(parent=None, **kwargs)[source]

Bases: crikit.ui.widget_images.widgetBWImg

Single-color widget

applyGain()[source]
changeColor()[source]
disabled()[source]
gain1()[source]
initData()[source]

(Re)-initialize self.data

crikit.ui.widget_mergeNRBs module

Widget for PlotEffect that adjusts the parameters appropriate for merging 2 NRBs

Created on Thu Dec 22 22:20:06 2016

@author: chc

class crikit.ui.widget_mergeNRBs.widgetMergeNRBs(wn_vec, nrb_left, nrb_right, scale_left=False, wn_switchpt=2800.0, parent=None)[source]

Bases: crikit.ui.dialog_AbstractPlotEffect.AbstractPlotEffectPlugin

Widget for PlotEffect that adjusts the parameters appropriate for merging 2 NRBs

fcn(data_in)[source]

If return list, [0] goes to original, [1] goes to affected

property fullRange
kkChanged()[source]
labels_affected = {'title': 'KK-Raman', 'x_label': 'Wavenumber (cm$^{-1}$)', 'y_label': 'Raman-Like Int (au)'}
labels_orig = {'title': 'Original', 'x_label': 'Wavenumber (cm$^{-1}$)', 'y_label': 'Input Int (au)'}
parameters = {'long_name': 'Merge 2 NRBs', 'name': 'mergeNRBs'}
pixChanged()[source]
rangeChanged()[source]
scaleChanged()[source]
wnChanged()[source]

crikit.ui.widget_scientificspin module

From https://gist.github.com/jdreaver – scientificspin.py

Created on Wed Dec 7 10:39:26 2016

@author: chc

class crikit.ui.widget_scientificspin.FloatValidator[source]

Bases: PyQt5.QtGui.QValidator

fixup(self, str)str[source]
validate(self, str, int) → Tuple[QValidator.State, str, int][source]
class crikit.ui.widget_scientificspin.ScientificDoubleSpinBox(*args, **kwargs)[source]

Bases: PyQt5.QtWidgets.QDoubleSpinBox

fixup(self, str)str[source]
stepBy(self, int)[source]
textFromValue(self, float)str[source]
validate(self, str, int) → Tuple[QValidator.State, str, int][source]
valueFromText(self, str)float[source]
crikit.ui.widget_scientificspin.format_float(value)[source]

Modified form of the ‘g’ format specifier.

crikit.ui.widget_scientificspin.valid_float_string(string)[source]

Module contents