sas.qtgui.Perspectives.Corfunc package¶
Subpackages¶
- sas.qtgui.Perspectives.Corfunc.UI package
- sas.qtgui.Perspectives.Corfunc.UnitTesting package
- Submodules
- sas.qtgui.Perspectives.Corfunc.UnitTesting.CorfuncTest module
CorfuncTest
CorfuncTest.__dict__
CorfuncTest.__doc__
CorfuncTest.__module__
CorfuncTest.__weakref__
CorfuncTest.checkFakeDataState()
CorfuncTest.testDefaults()
CorfuncTest.testLoadParams()
CorfuncTest.testOnCalculate()
CorfuncTest.testProcess()
CorfuncTest.testRemoveData()
CorfuncTest.testSerialization()
CorfuncTest.widget()
- Module contents
Submodules¶
sas.qtgui.Perspectives.Corfunc.CorfuncCanvas module¶
- class sas.qtgui.Perspectives.Corfunc.CorfuncCanvas.CorfuncCanvas(corfunc_window: CorfuncWindow, width=5, height=4, dpi=100)¶
Bases:
FigureCanvasQTAgg
Base class for the canvases in corfunc
- __doc__ = ' Base class for the canvases in corfunc'¶
- __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.Corfunc.CorfuncCanvas'¶
- clear()¶
Remove data from plots
- abstract draw_data()¶
- parent()¶
Parent function is needed by the toolbar, and needs to return the appropriate figure canvas object, which is self
- staticMetaObject = PySide6.QtCore.QMetaObject("CorfuncCanvas" inherits "FigureCanvasQTAgg": )¶
sas.qtgui.Perspectives.Corfunc.CorfuncPerspective module¶
- class sas.qtgui.Perspectives.Corfunc.CorfuncPerspective.CorfuncWindow(parent=None)¶
Bases:
QDialog
,Ui_CorfuncDialog
,Perspective
Displays the correlation function analysis of sas data.
- __doc__ = 'Displays the correlation function analysis of sas data.'¶
- __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.Corfunc.CorfuncPerspective'¶
- _run()¶
- allowBatch()¶
We cannot perform corfunc analysis in batch at this time.
- allowSwap()¶
We cannot swap data with corfunc analysis at this time.
- closeEvent(event)¶
Overwrite QDialog close method to allow for custom widget close
- ext = 'crf'¶
- property extraction_figure¶
- property extrapolation_paramameters: ExtrapolationParameters | None¶
- getPage()¶
Serializes full state of this corfunc page Called by Save Analysis :return: {corfunc-state}
- getReport() ReportData | None ¶
A string containing the HTML to be shown in the report
- getState()¶
Collects all active params into a dictionary of {name: value} :return: {name: value}
- property idf_figure¶
- isSerializable()¶
Tell the caller that this perspective writes its state
- model_changed(_)¶
Actions to perform when the data is updated
- name = 'Corfunc'¶
- notify_extrapolation_text_box_validity(params)¶
Set the colour of the text boxes to red if they have bad parameter definitions
- on_extrapolation_slider_changed(state: ExtrapolationParameters)¶
Slider state changed
- on_extrapolation_slider_changing(state: ExtrapolationInteractionState)¶
Slider is being moved about
- on_extrapolation_text_changed_1(text)¶
Text in LowerQMax changed
- on_extrapolation_text_changed_2(text)¶
Text in UpperQMin changed
- on_extrapolation_text_changed_3(text)¶
Text in UpperQMax changed
- on_save_extrapolation()¶
- on_save_transformed()¶
Save corfunc state into a file
- property q_space_figure¶
- property real_space_figure¶
- removeData(data_list=None)¶
Remove the existing data reference from the Invariant Persepective
- serializeAll()¶
Serialize the corfunc state so data can be saved Corfunc is not batch-ready so this will only effect a single page :return: {data-id: {self.name: {corfunc-state}}}
- serializeCurrentPage()¶
Serialize and return a dictionary of {data_id: corfunc-state} Return empty dictionary if no data :return: {data-id: {self.name: {corfunc-state}}}
- setClosable(value=True)¶
Allow outsiders close this widget
- setData(data_item: List[QStandardItem], is_batch=False)¶
Obtain a QStandardItem object and dissect it to get Data1D/2D Pass it over to the calculator
- set_background_warning()¶
- set_long_period_method(value: LongPeriodMethod | None) Callable[[bool], None] ¶
Function to set the long period method
- set_tangent_method(value: TangentMethod | None) Callable[[bool], None] ¶
Function to set the tangent method
- set_text_enable(state: bool)¶
- setup_mapper()¶
Creating mapping between model and gui elements.
- setup_model()¶
Populate the model with default data.
- setup_slots()¶
Connect the buttons to their appropriate slots.
- showHelp()¶
Opens a webpage with help on the perspective
- staticMetaObject = PySide6.QtCore.QMetaObject("CorfuncWindow" inherits "QDialog": Methods: #42 type=Signal, signature=trigger(PyObject), parameters=PyObject )¶
- property supports_reports: bool¶
Does this perspective have a report functionality (currently used by menus and toolbar)
- property title¶
Window title
- trigger¶
- updateFromParameters(params)¶
Called by Open Project, Open Analysis, and removeData :param params: {param_name: value} -> Default values used if not valid :return: None
sas.qtgui.Perspectives.Corfunc.CorfuncSlider module¶
- class sas.qtgui.Perspectives.Corfunc.CorfuncSlider.CorfuncSlider(parameters: ExtrapolationParameters = (1, 2, 4, 8, 16), enabled: bool = False, *args, **kwargs)¶
Bases:
QWidget
- __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.Corfunc.CorfuncSlider'¶
- property _dragging: bool¶
Are we dragging?
- _mouse_inside(x, y)¶
Is the mouse inside the window
- _nearest_line(x: float) int ¶
Get id of the nearest line
- _paint_label(position: float, text: str, centre_justify=True)¶
- _sanitise_new_position(line_id: int, new_position: int, delta=1) int ¶
Returns a revised position for a line position that prevents the bounds being exceeded
- property data_label_centre: float¶
Centre of the interpolation region
- property data_width: float¶
Length of range spanned by the data
- enterEvent(self, event: PySide6.QtGui.QEnterEvent) None ¶
- property extrapolation_parameters¶
- static find_parameter_problems(params: ExtrapolationParameters) str | None ¶
Check an extratpolation prarameters object for consistency
- Parameters:
params – An extrapolation parameters object describing a desired state
- Returns:
A description of the problem if it exists, otherwise None
- property guinier_label_position: float¶
Position to put the text for the guinier region
- property input_width: float¶
Width of the part of the widget representing input data
- property interaction_state: ExtrapolationInteractionState¶
The current state of the slider, including temporary data about how it is being moved
- inverse_transform(px_value: float) float ¶
Convert a value from draw coordinates to input value
- leaveEvent(self, event: PySide6.QtCore.QEvent) None ¶
- property line_paint_positions: Tuple[float, float, float]¶
x coordinate of the painted lines
- mouseMoveEvent(self, event: PySide6.QtGui.QMouseEvent) None ¶
- mousePressEvent(self, event: PySide6.QtGui.QMouseEvent) None ¶
- mouseReleaseEvent(self, event: PySide6.QtGui.QMouseEvent) None ¶
- paintEvent(self, event: PySide6.QtGui.QPaintEvent) None ¶
- property porod_label_centre: float¶
Centre of the Porod region
- property scale: float¶
Scale factor from input to draw scale e.g. A^-1 -> px
- set_boundaries(q_point_1: float, q_point_2: float, q_point_3: float)¶
Set the boundaries between the sections
- set_boundary(index: int, q: float)¶
Set the value of the boundary points by (0-)index
- sizeHint(self) PySide6.QtCore.QSize ¶
- staticMetaObject = PySide6.QtCore.QMetaObject("CorfuncSlider" inherits "QWidget": Methods: #34 type=Signal, signature=valueEdited(PyObject), parameters=PyObject #35 type=Signal, signature=valueEditing(PyObject), parameters=PyObject )¶
- transform(q_value: float) float ¶
Convert a value from input to draw coordinates
- property transition_label_centre: float¶
Centre of the data-porod transition
- valueEdited¶
- valueEditing¶
- sas.qtgui.Perspectives.Corfunc.CorfuncSlider.main()¶
Show a demo of the slider
- sas.qtgui.Perspectives.Corfunc.CorfuncSlider.mix_colours(a: QColor, b: QColor, k: float) QColor ¶
sas.qtgui.Perspectives.Corfunc.ExtractionCanvas module¶
- class sas.qtgui.Perspectives.Corfunc.ExtractionCanvas.ExtractionCanvas(parent, width=5, height=4, dpi=100)¶
Bases:
CorfuncCanvas
Canvas for displaying real space representation
- __doc__ = ' Canvas for displaying real space representation'¶
- __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.Corfunc.ExtractionCanvas'¶
- draw_data()¶
This function draws the real space data onto the plot
The 1d correlation function in self.data, the 3d correlation function in self.data3, and the interface distribution function in self.data_idf are all draw in on the plot in linear cooredinates.
- staticMetaObject = PySide6.QtCore.QMetaObject("ExtractionCanvas" inherits "CorfuncCanvas": )¶
- property supplementary¶
sas.qtgui.Perspectives.Corfunc.IDFCanvas module¶
- class sas.qtgui.Perspectives.Corfunc.IDFCanvas.IDFCanvas(corfunc_window: CorfuncWindow, width=5, height=4, dpi=100)¶
Bases:
CorfuncCanvas
Canvas for displaying real space representation
- __doc__ = ' Canvas for displaying real space representation'¶
- __module__ = 'sas.qtgui.Perspectives.Corfunc.IDFCanvas'¶
- draw_data()¶
This function draws the real space data onto the plot
The 1d correlation function in self.data, the 3d correlation function in self.data3, and the interface distribution function in self.data_idf are all draw in on the plot in linear cooredinates.
- staticMetaObject = PySide6.QtCore.QMetaObject("IDFCanvas" inherits "CorfuncCanvas": )¶
sas.qtgui.Perspectives.Corfunc.QSpaceCanvas module¶
- class sas.qtgui.Perspectives.Corfunc.QSpaceCanvas.QSpaceCanvas(corfunc_window: CorfuncWindow, width=5, height=4, dpi=100)¶
Bases:
CorfuncCanvas
Canvas for displaying input data and extrapolation parameters
- __doc__ = ' Canvas for displaying input data and extrapolation parameters'¶
- __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.Corfunc.QSpaceCanvas'¶
- draw_data()¶
Draw the Q space data in the plot window
This draws the q space data in self.data, as well as the bounds set by self.qmin, self.qmax1, and self.qmax2. It will also plot the extrpolation in self.extrap, if it exists.
- property interactive_lines¶
- staticMetaObject = PySide6.QtCore.QMetaObject("QSpaceCanvas" inherits "CorfuncCanvas": )¶
- update_lines(parameters: ExtrapolationInteractionState)¶
Update the plots vertical lines based on the position of the slider and/or text box values
sas.qtgui.Perspectives.Corfunc.RealSpaceCanvas module¶
- class sas.qtgui.Perspectives.Corfunc.RealSpaceCanvas.RealSpaceCanvas(parent, width=5, height=4, dpi=100)¶
Bases:
CorfuncCanvas
Canvas for displaying real space representation
- __doc__ = ' Canvas for displaying real space representation'¶
- __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.Corfunc.RealSpaceCanvas'¶
- draw_data()¶
This function draws the real space data onto the plot
The 1d correlation function in self.data, the 3d correlation function in self.data3, and the interface distribution function in self.data_idf are all draw in on the plot in linear cooredinates.
- staticMetaObject = PySide6.QtCore.QMetaObject("RealSpaceCanvas" inherits "CorfuncCanvas": )¶
sas.qtgui.Perspectives.Corfunc.SaveExtrapolatedPopup module¶
- class sas.qtgui.Perspectives.Corfunc.SaveExtrapolatedPopup.SaveExtrapolatedPopup(input_qs: ndarray, interpolation_function: Callable[[ndarray], ndarray], parent=None)¶
Bases:
QDialog
,Ui_SaveExtrapolatedPanel
- __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.Corfunc.SaveExtrapolatedPopup'¶
- _do_save(q: ndarray, intensity: ndarray)¶
Save data to a file
- _input_validation()¶
Check input is valid, notify user if not
- _notify_user_error(message: str)¶
Message box for showing error
- on_cancel()¶
Cancel button pressed
- on_ok()¶
OK button pressed
- staticMetaObject = PySide6.QtCore.QMetaObject("SaveExtrapolatedPopup" inherits "QDialog": )¶
sas.qtgui.Perspectives.Corfunc.util module¶
- sas.qtgui.Perspectives.Corfunc.util.safe_float(x: str)¶
String to float method that returns zero if parsing failed