sas.qtgui.Perspectives.Inversion package

Submodules

sas.qtgui.Perspectives.Inversion.DMaxExplorerWidget module

Dialog panel to explore the P(r) inversion results for a range of D_max value. User picks a number of points and a range of distances, then can toggle between inversion outputs and see their distribution as a function of D_max.

class sas.qtgui.Perspectives.Inversion.DMaxExplorerWidget.DmaxWindow(pr_state, nfunc, parent=None)[source]

Bases: PyQt5.QtWidgets.QDialog, sas.qtgui.Perspectives.Inversion.UI.DMaxExplorer.Ui_DmaxExplorer

closeEvent(event)[source]

Override close event

modelChanged(item)[source]
name = 'Dmax Explorer'
setupMapper()[source]
setupModel()[source]
setupSlots()[source]
setupValidators()[source]

Add validators on relevant line edits

sas.qtgui.Perspectives.Inversion.InversionLogic module

class sas.qtgui.Perspectives.Inversion.InversionLogic.InversionLogic(data=None)[source]

Bases: object

All the data-related logic. This class deals exclusively with Data1D/2D No QStandardModelIndex here.

add_errors(sigma=0.05)[source]

Adds errors to data set is they are not available. Uses \(\Delta y = \sigma | y |\).

computeDataRange()[source]

Wrapper for calculating the data range based on local dataset

computeRangeFromData(data)[source]

Compute the minimum and the maximum range of the data return the npts contains in data

data
isLoadedData()[source]

accessor

new1DPlot(out, pr, q=None)[source]

Create a new 1D data instance based on fitting results

newPRPlot(out, pr, cov=None)[source]

sas.qtgui.Perspectives.Inversion.InversionPerspective module

class sas.qtgui.Perspectives.Inversion.InversionPerspective.InversionWindow(parent=None, data=None)[source]

Bases: PyQt5.QtWidgets.QDialog, sas.qtgui.Perspectives.Inversion.UI.TabbedInversionUI.Ui_PrInversion

The main window for the P(r) Inversion perspective.

acceptAlpha()[source]

Send estimated alpha to input

acceptNoTerms()[source]

Send estimated no of terms to input

allowBatch()[source]
allowSwap()[source]

Tell the caller we don’t accept swapping data

calculateSignal
check_q_high(q_value=None)[source]

Validate the value of high q sent by the slider

check_q_low(q_value=None)[source]

Validate the low q value

closeBatchResults()[source]
closeDMax()[source]
closeEvent(event)[source]

Overwrite QDialog close method to allow for custom widget close

communicator()[source]
currentTabDataId()[source]

Returns the data ID of the current tab

displayChange(data_index=0)[source]

Switch to another item in the data list

enableButtons()[source]

Enable buttons when data is present, else disable them

estimateDynamicNTSignal
estimateDynamicSignal
estimateNTSignal
estimateSignal
ext = 'pr'
getNFunc()[source]

Get the n_func value from the GUI object

getPage()[source]

serializes full state of this fit page

getState()[source]

Collects all active params into a dictionary of {name: value} :return: {name: value}

help()[source]

Open the P(r) Inversion help browser

isClosable()[source]

Allow outsiders close this widget

isSerializable()[source]

Tell the caller that this perspective writes its state

model_changed()[source]

Update the values when user makes changes

name = 'Inversion'
openExplorerWindow()[source]

Open the Explorer window to see correlations between params and results

performEstimate()[source]

Perform parameter estimation

performEstimateDynamic()[source]

Perform parameter estimation

performEstimateDynamicNT()[source]

Perform parameter estimation

performEstimateNT()[source]

Perform parameter estimation

populateDataComboBox(name, data_ref)[source]

Append a new name to the data combobox :param name: data name :param data_ref: QStandardItem reference for data set to be added

removeData(data_list=None)[source]

Remove the existing data reference from the P(r) Persepective

serializeAll()[source]

Serialize the inversion state so data can be saved Inversion is not batch-ready so this will only effect a single page :return: {data-id: {self.name: {inversion-state}}}

serializeCurrentPage()[source]
setClosable(value=True)[source]

Allow outsiders close this widget

setCurrentData(data_ref)[source]

Get the data by reference and display as necessary

setData(data_item=None, is_batch=False)[source]

Assign new data set(s) to the P(r) perspective Obtain a QStandardItem object and parse it to get Data1D/2D Pass it over to the calculator

set_background(value)[source]

Connect the use controls to their appropriate methods

setupMapper()[source]
setupModel()[source]

Update boxes with initial values

setupValidators()[source]

Apply validators to editable line edits

setupWindow()[source]

Initialize base window state on init

showBatchOutput()[source]

Display the batch output in tabular form :param output_data: Dictionary mapping name -> P(r) instance

startNextBatchItem()[source]
startThread()[source]

Start a calculation thread

startThreadAll()[source]
stopCalcThread()[source]

Stops a thread if it exists and is running

stopCalculation()[source]

Stop all threads, return to the base state and update GUI

stopEstimateNTThread()[source]
stopEstimationThread()[source]

Stop the estimation thread if it exists and is running

toggleBgd()[source]

Toggle the background between manual and estimated

updateCalculator()[source]

Update all p(r) params

updateDataList(dataRef)[source]

Save the current data state of the window into self._data_list

updateDynamicGuiValues()[source]
updateFromParameters(params)[source]
updateGuiValues()[source]
sas.qtgui.Perspectives.Inversion.InversionPerspective.is_float(value)[source]

Converts text input values to floats. Empty strings throw ValueError

sas.qtgui.Perspectives.Inversion.InversionUtils module

sas.qtgui.Perspectives.Inversion.Thread module

class sas.qtgui.Perspectives.Inversion.Thread.CalcPr(pr, nfunc=5, error_func=None, completefn=None, updatefn=None, yieldtime=0.01, worktime=0.01)[source]

Bases: sas.sascalc.data_util.calcthread.CalcThread

Compute P(r)

compute()[source]

Perform P(r) inversion

class sas.qtgui.Perspectives.Inversion.Thread.EstimateNT(pr, nfunc=5, error_func=None, completefn=None, updatefn=None, yieldtime=0.01, worktime=0.01)[source]

Bases: sas.sascalc.data_util.calcthread.CalcThread

compute()[source]

Calculates the estimate

isquit()[source]
class sas.qtgui.Perspectives.Inversion.Thread.EstimatePr(pr, nfunc=5, error_func=None, completefn=None, updatefn=None, yieldtime=0.01, worktime=0.01)[source]

Bases: sas.sascalc.data_util.calcthread.CalcThread

Estimate P(r)

compute()[source]

Calculates the estimate

Module contents