sas.sasgui.perspectives.corfunc package

Submodules

sas.sasgui.perspectives.corfunc.corfunc module

Corfunc perspective

class sas.sasgui.perspectives.corfunc.corfunc.Plugin[source]

Bases: sas.sasgui.guiframe.plugin_base.PluginBase

This class defines the interface for a plugin class for a correlation function perspective

clear_data()[source]
delete_data(data)[source]

Delete the data from the perspective

get_context_menu(plotpanel=None)[source]

Get the context menu items available for Corfunc.

Parameters:plotpanel – A Plotter1D panel
Returns:a list of menu items with call-back function
Note:if Data1D was generated from Theory1D the fitting option is not allowed
get_panels(parent)[source]

Define the GUI panels

set_data(data_list=None)[source]

Load the data that’s been selected

Parameters:data_list – The data to load in
set_state(state=None, datainfo=None)[source]

Callback for CorfuncState reader. Called when a .crf file is loaded

show_data(data, label, reset=False, active_ctrl=None)[source]

Show data read from a file

Parameters:
  • data – The data to plot (Data1D)
  • label – What to label the plot. Also used as the plot ID
  • reset – If True, all other plottables will be cleared

sas.sasgui.perspectives.corfunc.corfunc_panel module

class sas.sasgui.perspectives.corfunc.corfunc_panel.CorfuncPanel(parent, data=None, manager=None, *args, **kwds)[source]

Bases: wx.lib.scrolledpanel.ScrolledPanel, sas.sasgui.guiframe.panel_base.PanelBase

CENTER_PANE = True
compute_extrapolation(event=None)[source]

Compute and plot the extrapolated data. Called when Extrapolate button is pressed.

compute_transform(event=None)[source]

Compute and plot the transformed data. Called when Transform button is pressed.

extract_parameters(event=None)[source]

Called when “Extract Parameters” is clicked

get_data()[source]
get_save_flag()[source]
get_state()[source]

Return the state of the panel

onSetFocus(evt)[source]
on_help(event=None)[source]

Show the corfunc documentation

on_save(event=None)[source]

Save corfunc state into a file

on_set_focus(event=None)[source]
plot_qrange(active=None, leftdown=False)[source]
radio_changed(event=None)[source]

Called when the “Transform type” radio button are changed

save_project(doc=None)[source]

Return an XML node containing the state of the panel

Parameters:doc – Am xml node to attach the project state to (optional)
set_background(bg)[source]
set_data(data=None, set_qrange=True)[source]

Update the GUI to reflect new data that has been loaded in

Parameters:data – The data that has been loaded
set_extracted_params(params=None, reset=False)[source]

Displays the values of the parameters extracted from the Fourier transform

set_extrapolation_params(params=None)[source]

Displays the value of the parameters calculated in the extrapolation

set_qmax(qmax)[source]
set_qmin(qmin)[source]
set_state(state=None, data=None)[source]

Set the state of the panel. If no state is provided, the panel will be set to the default state.

Parameters:
  • state – A CorfuncState object
  • data – A Data1D object
transform_complete(transforms=None)[source]

Called from FourierThread when calculation has completed

transform_update(msg='')[source]

Called from FourierThread to update on status of calculation

window_caption = 'Correlation Function'
window_name = 'Correlation Function'

sas.sasgui.perspectives.corfunc.corfunc_state module

class sas.sasgui.perspectives.corfunc.corfunc_state.CorfuncState[source]

Bases: object

Stores information about the state of CorfuncPanel

fromXML(node)[source]

Load corfunc states from a file

Parameters:node – node of an XML document to read from (optional)
set_saved_state(name, value)[source]

Set a value in the current state.

Parameters:
  • name – The name of the parameter to set
  • value – The value to set the parameter to
toXML(filename='corfunc_state.crf', doc=None, entry_node=None)[source]

Writes the state of the CorfuncPanel panel to file, as XML.

Compatible with standalone writing, or appending to an already existing XML document. In that case, the XML document is required. An optional entry node in the XML document may also be given.

Parameters:
  • file – file to write to
  • doc – XML document object [optional]
  • entry_node – XML node within the XML document at which we will append the data [optional]
Returns:

None if no doc is provided, modified XML document if doc!=None

class sas.sasgui.perspectives.corfunc.corfunc_state.Reader(callback)[source]

Bases: sas.sascalc.dataloader.readers.cansas_reader.Reader

Reads a CanSAS file containing the state of a CorfuncPanel

ext = ['.crf', '.CRF', '.svs', '.SVS']
get_state()[source]
read(path)[source]

Load data and corfunc information frmo a CanSAS file.

Parameters:

path – The file path to read from

Returns:

Data1D object, a list of Data1D objects, or None

Raises:
  • IOError – When the file can’t be found
  • IOError – When the file is an invalid file type
  • ValueError – When the length of the data vectors are inconsistent
type = ['Corfunc file (*.crf)|*.crf', 'SASView file (*.svs)|*.svs']
type_name = 'Corfunc'
write(filename, datainfo=None, state=None)[source]

Write the content of a Data1D as a CanSAS file.

: param filename: Name of the file to write : param datainfo: Data1D object : param state: CorfuncState object

sas.sasgui.perspectives.corfunc.plot_labels module

Module contents