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:
FigureCanvasQTAggBase class for the canvases in corfunc
- clear()¶
Remove data from 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,ABCMetaMetaclass for both ABC and matplotlib figure
This is needed to enable the mixin of CorfuncCanvas
sas.qtgui.Perspectives.Corfunc.CorfuncPerspective module¶
- class sas.qtgui.Perspectives.Corfunc.CorfuncPerspective.CorfuncWindow(parent=None)¶
Bases:
QDialog,Ui_CorfuncDialog,PerspectiveDisplays the correlation function analysis of sas data.
- 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:
CorfuncCanvasCanvas for displaying real space representation
- 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:
CorfuncCanvasCanvas for displaying real space representation
- 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:
CorfuncCanvasCanvas for displaying input data and extrapolation parameters
- 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:
CorfuncCanvasCanvas for displaying real space representation
- 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_SaveExtrapolatedPanelDialogue window for saving extrapolated data
- 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
- exception sas.qtgui.Perspectives.Corfunc.SaveExtrapolatedPopup.UserInputInvalid(message, *args)¶
Bases:
Exception
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