sas.qtgui.Perspectives.Inversion package

Subpackages

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)

Bases: QDialog, Ui_DmaxExplorer

__doc__ = None
__init__(self, parent: PySide6.QtWidgets.QWidget | None = None, f: PySide6.QtCore.Qt.WindowType = Default(Qt.WindowFlags)) None

Initialize self. See help(type(self)) for accurate signature.

__module__ = 'sas.qtgui.Perspectives.Inversion.DMaxExplorerWidget'
closeEvent(event)

Override close event

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

Add validators on relevant line edits

staticMetaObject = PySide6.QtCore.QMetaObject("DmaxWindow" inherits "QDialog": )

sas.qtgui.Perspectives.Inversion.InversionLogic module

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

Bases: object

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

__dict__ = mappingproxy({'__module__': 'sas.qtgui.Perspectives.Inversion.InversionLogic', '__doc__': '\n    All the data-related logic. This class deals exclusively with Data1D/2D\n    No QStandardModelIndex here.\n    ', '__init__': <function InversionLogic.__init__>, 'data': <property object>, 'isLoadedData': <function InversionLogic.isLoadedData>, 'new1DPlot': <function InversionLogic.new1DPlot>, 'newPRPlot': <function InversionLogic.newPRPlot>, 'add_errors': <function InversionLogic.add_errors>, 'computeDataRange': <function InversionLogic.computeDataRange>, 'computeRangeFromData': <function InversionLogic.computeRangeFromData>, '__dict__': <attribute '__dict__' of 'InversionLogic' objects>, '__weakref__': <attribute '__weakref__' of 'InversionLogic' objects>, '__annotations__': {}})
__doc__ = '\n    All the data-related logic. This class deals exclusively with Data1D/2D\n    No QStandardModelIndex here.\n    '
__init__(data=None)
__module__ = 'sas.qtgui.Perspectives.Inversion.InversionLogic'
__weakref__

list of weak references to the object

add_errors(sigma=0.05)

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

computeDataRange()

Wrapper for calculating the data range based on local dataset

computeRangeFromData(data)

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

property data
isLoadedData()

accessor

new1DPlot(out, pr, q=None)

Create a new 1D data instance based on fitting results

newPRPlot(out, pr, cov=None)

sas.qtgui.Perspectives.Inversion.InversionPerspective module

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

Bases: QDialog, Ui_PrInversion, Perspective

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

__doc__ = '\n    The main window for the P(r) Inversion perspective.\n    '
__init__(self, parent: PySide6.QtWidgets.QWidget | None = None, f: PySide6.QtCore.Qt.WindowType = Default(Qt.WindowFlags)) None

Initialize self. See help(type(self)) for accurate signature.

__module__ = 'sas.qtgui.Perspectives.Inversion.InversionPerspective'
_calculateCompleted(out, cov, pr, elapsed)

Send a signal to the main thread for model update

_calculateUpdate(output_tuple)

Method called with the results when the inversion is done

Parameters:
  • out – output coefficient for the base functions

  • cov – covariance matrix

  • pr – Invertor instance

  • elapsed – time spent computing

_estimateCompleted(alpha, message, elapsed)

Send a signal to the main thread for model update

_estimateDynamicCompleted(alpha, message, elapsed)

Send a signal to the main thread for model update

_estimateDynamicNTCompleted(nterms, alpha, message, elapsed)

Send a signal to the main thread for model update

_estimateDynamicNTUpdate(output_tuple)

Parameter estimation completed, display the results to the user

Parameters:
  • alpha – estimated best alpha

  • nterms – estimated number of terms

  • elapsed – computation time

_estimateDynamicUpdate(output_tuple)

Parameter estimation completed, display the results to the user

Parameters:
  • alpha – estimated best alpha

  • elapsed – computation time

_estimateNTCompleted(nterms, alpha, message, elapsed)

Send a signal to the main thread for model update

_estimateNTUpdate(output_tuple)

Parameter estimation completed, display the results to the user

Parameters:
  • alpha – estimated best alpha

  • nterms – estimated number of terms

  • elapsed – computation time

_estimateUpdate(output_tuple)

Parameter estimation completed, display the results to the user

Parameters:
  • alpha – estimated best alpha

  • elapsed – computation time

_threadError(error)

Call-back method for calculation errors

acceptAlpha()

Send estimated alpha to input

acceptNoTerms()

Send estimated no of terms to input

allowBatch()

Can this perspective handle batch processing, default no

allowSwap()

Tell the caller we don’t accept swapping data

calculateSignal
check_q_high(q_value=None)

Validate the value of high q sent by the slider

check_q_low(q_value=None)

Validate the low q value

closeBatchResults()
closeDMax()
closeEvent(event)

Overwrite QDialog close method to allow for custom widget close

communicator()
currentTabDataId()

Returns the data ID of the current tab

displayChange(data_index=0)

Switch to another item in the data list

enableButtons()

Enable buttons when data is present, else disable them

estimateDynamicNTSignal
estimateDynamicSignal
estimateNTSignal
estimateSignal
ext = 'pr'
getNFunc()

Get the n_func value from the GUI object

getPage()

serializes full state of this fit page

getState()

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

help()

Open the P(r) Inversion help browser

isClosable()

Allow outsiders close this widget

isSerializable()

Tell the caller that this perspective writes its state

model_changed()

Update the values when user makes changes

name = 'Inversion'
openExplorerWindow()

Open the Explorer window to see correlations between params and results

performEstimate()

Perform parameter estimation

performEstimateDynamic()

Perform parameter estimation

performEstimateDynamicNT()

Perform parameter estimation

performEstimateNT()

Perform parameter estimation

populateDataComboBox(name, data_ref)

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)

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

serializeAll()

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()
setClosable(value=True)

Allow outsiders close this widget

setCurrentData(data_ref)

Get the data by reference and display as necessary

setData(data_item=None, is_batch=False)

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)

Connect the use controls to their appropriate methods

setupMapper()
setupModel()

Update boxes with initial values

setupValidators()

Apply validators to editable line edits

setupWindow()

Initialize base window state on init

showBatchOutput()

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

startNextBatchItem()
startThread()

Start a calculation thread

startThreadAll()
staticMetaObject = PySide6.QtCore.QMetaObject("InversionWindow" inherits "QDialog": Methods:   #42 type=Signal, signature=estimateSignal(PyObject), parameters=PyObject   #43 type=Signal, signature=estimateNTSignal(PyObject), parameters=PyObject   #44 type=Signal, signature=estimateDynamicNTSignal(PyObject), parameters=PyObject   #45 type=Signal, signature=estimateDynamicSignal(PyObject), parameters=PyObject   #46 type=Signal, signature=calculateSignal(PyObject), parameters=PyObject )
stopCalcThread()

Stops a thread if it exists and is running

stopCalculation()

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

stopEstimateNTThread()
stopEstimationThread()

Stop the estimation thread if it exists and is running

property title: str

Window title

toggleBgd()

Toggle the background between manual and estimated

updateCalculator()

Update all p(r) params

updateDataList(dataRef)

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

updateDynamicGuiValues()
updateFromParameters(params)

Update the perspective using a dictionary of parameters e.g. those loaded via open project or open analysis menu items

updateGuiValues()
sas.qtgui.Perspectives.Inversion.InversionPerspective.str_to_float(string: str)

Converts text input values to float. Failure to parse string returns zero

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)

Bases: CalcThread

Compute P(r)

__annotations__ = {}
__doc__ = '\n    Compute P(r)\n    '
__init__(pr, nfunc=5, error_func=None, completefn=None, updatefn=None, yieldtime=0.01, worktime=0.01)
__module__ = 'sas.qtgui.Perspectives.Inversion.Thread'
compute()

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)

Bases: CalcThread

__annotations__ = {}
__doc__ = '\n    '
__init__(pr, nfunc=5, error_func=None, completefn=None, updatefn=None, yieldtime=0.01, worktime=0.01)
__module__ = 'sas.qtgui.Perspectives.Inversion.Thread'
compute()

Calculates the estimate

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

Bases: CalcThread

Estimate P(r)

__annotations__ = {}
__doc__ = '\n    Estimate P(r)\n    '
__init__(pr, nfunc=5, error_func=None, completefn=None, updatefn=None, yieldtime=0.01, worktime=0.01)
__module__ = 'sas.qtgui.Perspectives.Inversion.Thread'
compute()

Calculates the estimate

Module contents