sas.qtgui.Perspectives.Corfunc package

Subpackages

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'
__firstlineno__ = 23
__init__(corfunc_window: CorfuncWindow, width=5, height=4, dpi=100)
__module__ = 'sas.qtgui.Perspectives.Corfunc.CorfuncCanvas'
__static_attributes__ = ('_data', 'axes', 'corfunc_windows', 'fig')
clear()

Remove data from plots

property data: list[Data1D] | None

The data currently shown by the plots

abstractmethod 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": )
class sas.qtgui.Perspectives.Corfunc.CorfuncCanvas.CorfuncCanvasMeta

Bases: ObjectType, ABCMeta

Metaclass for both ABC and matplotlib figure

This is needed to enable the mixin of CorfuncCanvas

__annotations__ = {}
__doc__ = 'Metaclass for both ABC and matplotlib figure\n\nThis is needed to enable the mixin of CorfuncCanvas\n'
__firstlineno__ = 16
__module__ = 'sas.qtgui.Perspectives.Corfunc.CorfuncCanvas'
__static_attributes__ = ()

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.'
__firstlineno__ = 43
__init__(parent=None)
__module__ = 'sas.qtgui.Perspectives.Corfunc.CorfuncPerspective'
__static_attributes__ = ('_allow_close', '_calculator', '_extraction_plot', '_idf_plot', '_long_period_method', '_model_item', '_path', '_q_space_plot', '_real_space_plot', '_running', '_tangent_method', 'communicator', 'data', 'extrap', 'has_data', 'mapper', 'model', 'parent', 'slider', 'validity_flags')
_get_live_extrapolation_values() tuple[float, float, float]

Read current text box values without correcting them.

_run()
allowBatch()

We cannot perform corfunc analysis in batch at this time.

allowSwap()

We cannot swap data with corfunc analysis at this time.

allow_go(reason: str | None = None)

Disable Go button if reason is provided or if no data is loaded :param reason: Reason why Go button should be disabled

apply_parameters_from_ui()

Sets extrapolation parameters from the text boxes into the model and slider

check_extrapolation_entry(fits_enabled: list[str])

Disable Go button if extrapolation ranges empty or invalid

check_extrapolation_values()

Check validity of extrapolation values such that: data_q_min < point_1 < point_2 < point_3 < data_q_max If invalid, set text box background to red and disable Go button

closeEvent(event)

Overwrite QDialog close method to allow for custom widget close

correct_extrapolation_values()

Correct any invalid extrapolation values to be within valid ranges. Show dialog informing user of corrections made.

ext = 'crf'
property extraction_figure
property extrapolation_parameters: ExtrapolationParameters | None
format_sig_fig(value: float) str

Format a float to 7 significant figures as string

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'
on_extrapolation_slider_changed(state: ExtrapolationParameters)

Slider state changed

on_extrapolation_slider_changing(state: ExtrapolationInteractionState)

Slider is being moved about

on_extrapolation_text_edited()

Handle when user finishes editing any of the extrapolation text boxes

on_extrapolation_text_editing()

Handle when user edits any of the extrapolation text boxes

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

reset()

Reset the corfunc perspective to an empty state

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:   #41 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

update_readonly()

Disable text fields if the corresponding fit is enabled. Disable Go button if any of the text fields are empty.

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'
__firstlineno__ = 6
__init__(parent, width=5, height=4, dpi=100)
__module__ = 'sas.qtgui.Perspectives.Corfunc.ExtractionCanvas'
__static_attributes__ = ('_supplementary', 'axes')
_data: list[Data1D] | None
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'
__firstlineno__ = 5
__module__ = 'sas.qtgui.Perspectives.Corfunc.IDFCanvas'
__static_attributes__ = ('axes',)
_data: list[Data1D] | None
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'
__firstlineno__ = 16
__init__(corfunc_window: CorfuncWindow, width=5, height=4, dpi=100)
__module__ = 'sas.qtgui.Perspectives.Corfunc.QSpaceCanvas'
__static_attributes__ = ('axes', 'draggable', 'extrap', 'ghost_line', 'legend', 'line1', 'line2', 'line3')
_data: list[Data1D] | None
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'
__firstlineno__ = 6
__init__(parent, width=5, height=4, dpi=100)
__module__ = 'sas.qtgui.Perspectives.Corfunc.RealSpaceCanvas'
__static_attributes__ = ('_supplementary', 'axes', 'legend')
_data: list[Data1D] | None
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], background: float | None = None, parent=None)

Bases: QDialog, Ui_SaveExtrapolatedPanel

Dialogue window for saving extrapolated data

__doc__ = 'Dialogue window for saving extrapolated data'
__firstlineno__ = 24
__init__(input_qs: ndarray, interpolation_function: Callable[[ndarray], ndarray], background: float | None = None, parent=None)
__module__ = 'sas.qtgui.Perspectives.Corfunc.SaveExtrapolatedPopup'
__static_attributes__ = ('background', 'input_qs', 'interpolation_function', 'parent')
_confirm_overwrite(existing_paths: list[Path]) bool

Ask user whether existing output files should be overwritten.

_do_save(q: ndarray, intensity: ndarray)

Save data to a file

_input_validation()

Check input is valid, notify user if not

static _next_available_output_paths(base_path: Path) tuple[Path, Path]

Return output file paths that do not overwrite existing files.

_notify_error(title: str, message: str)

Message box for showing error

on_cancel()

Cancel button pressed

on_ok()

OK button pressed

staticMetaObject = PySide6.QtCore.QMetaObject("SaveExtrapolatedPopup" inherits "QDialog": )
exception sas.qtgui.Perspectives.Corfunc.SaveExtrapolatedPopup.SaveOutputPathExhausted(message, *args)

Bases: Exception

__doc__ = None
__firstlineno__ = 18
__init__(message, *args)
__module__ = 'sas.qtgui.Perspectives.Corfunc.SaveExtrapolatedPopup'
__static_attributes__ = ('message',)
__weakref__

list of weak references to the object

exception sas.qtgui.Perspectives.Corfunc.SaveExtrapolatedPopup.UserInputInvalid(message, *args)

Bases: Exception

__doc__ = None
__firstlineno__ = 12
__init__(message, *args)
__module__ = 'sas.qtgui.Perspectives.Corfunc.SaveExtrapolatedPopup'
__static_attributes__ = ('message',)
__weakref__

list of weak references to the object

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

Module contents