sas.perspectives.calculator package

Submodules

sas.perspectives.calculator.aperture_editor module

class sas.perspectives.calculator.aperture_editor.ApertureDialog(parent=None, manager=None, aperture=None, *args, **kwds)[source]

Bases: wx._windows.Dialog

get_aperture()[source]

return the current aperture

get_notes()[source]

return notes

on_change_distance()[source]

Change distance of the aperture

on_change_name()[source]

Change name

on_change_size()[source]

Change aperture size

on_change_size_name()[source]

Change the size’s name

on_change_type()[source]

Change aperture type

on_click_apply(event)[source]

Apply user values to the aperture

on_click_cancel(event)[source]

reset the current aperture to its initial values

reset_aperture()[source]

put the default value of the detector back to the current aperture

set_manager(manager)[source]

Set manager of this window

set_values()[source]

take the aperture values of the current data and display them through the panel

sas.perspectives.calculator.calculator module

Calculator Module

class sas.perspectives.calculator.calculator.Plugin(standalone=True)[source]

Bases: sas.guiframe.plugin_base.PluginBase

This class defines the interface for a Plugin class for calculator perspective

get_python_panel(filename=None)[source]

Get the python shell panel

Parameters:filename – file name to open in editor
get_tools()[source]

Returns a set of menu entries for tools

help(evt)[source]

Show a general help dialog.

TODO:replace the text with a nice image provide more hint on the SLD calculator
on_calculate_dv(event)[source]

Compute the mass density or molar voulme

on_calculate_kiessig(event)[source]

Compute the Kiessig thickness

on_calculate_resoltuion(event)[source]

Estimate the instrumental resolution

on_calculate_sld(event)[source]

Compute the scattering length density of molecula

on_calculate_slit_size(event)[source]

Compute the slit size a given data

on_data_operation(event)[source]

Data operation

on_edit_data(event)[source]

Edit meta data

on_gen_model(event)[source]

On Generic model menu event

on_image_viewer(event)[source]

Get choose an image file dialog

Parameters:event – menu event
on_python_console(event)[source]

Open Python Console

Parameters:event – menu event
put_icon(frame)[source]

Put icon in the frame title bar

sas.perspectives.calculator.calculator_widgets module

This software was developed by the University of Tennessee as part of the Distributed Data Analysis of Neutron Scattering Experiments (DANSE) project funded by the US National Science Foundation.

See the license text in license.txt

copyright 2009, University of Tennessee

class sas.perspectives.calculator.calculator_widgets.InputTextCtrl(parent=None, *args, **kwds)[source]

Bases: wx._controls.TextCtrl

Text control for model and fit parameters. Binds the appropriate events for user interactions.

class sas.perspectives.calculator.calculator_widgets.InterActiveOutputTextCtrl(*args, **kwds)[source]

Bases: wx._controls.TextCtrl

Text control used to display outputs. No editing allowed. The background is grayed out. User can’t select text.

class sas.perspectives.calculator.calculator_widgets.OutputTextCtrl(*args, **kwds)[source]

Bases: sas.perspectives.calculator.calculator_widgets.InterActiveOutputTextCtrl

Text control used to display outputs. No editing allowed. The background is grayed out. User can’t select text.

sas.perspectives.calculator.collimation_editor module

class sas.perspectives.calculator.collimation_editor.CollimationDialog(parent=None, manager=None, collimation=[], *args, **kwds)[source]

Bases: wx._windows.Dialog

add_aperture(event)[source]

Append empty aperture to data’s list of aperture

add_collimation(event)[source]

Append empty collimation to data’s list of collimation

edit_aperture(event)[source]

Edit the selected aperture

enable_aperture()[source]

Enable /disable widgets crelated to aperture

enable_collimation()[source]

Enable /disable widgets related to collimation

fill_aperture_combox()[source]

fill the current combobox with the available aperture

fill_collimation_combox()[source]

fill the current combobox with the available collimation

get_collimation()[source]

return the current collimation

get_current_collimation()[source]
get_notes()[source]

return notes

on_change_length()[source]

Change the length

on_change_name()[source]

Change name

on_click_apply(event)[source]

Apply user values to the collimation

on_click_cancel(event)[source]

leave the collimation as it is and close

on_select_collimation(event)[source]

fill the control on the panel according to the current selected collimation

remove_aperture(event)[source]

Remove aperture to data’s list of aperture

remove_collimation(event)[source]

Remove collimation to data’s list of collimation

reset_aperture_combobox(edited_aperture)[source]

take all edited editor and reset clientdata of aperture combo box

reset_collimation_combobox(edited_collimation)[source]

take all edited editor and reset clientdata of collimation combo box

set_aperture(aperture)[source]

set aperture for data

set_manager(manager)[source]

Set manager of this window

set_values()[source]

take the collimation values of the current data and display them through the panel

sas.perspectives.calculator.console module

Console Module display message of a dialog

class sas.perspectives.calculator.console.ConsoleDialog(parent=None, manager=None, data=None, title='Data Summary', size=(530, 560))[source]

Bases: wx._windows.Dialog

Data summary dialog

set_manager(manager)[source]

Set the manager of this window

set_message(msg='')[source]

Display the message received

sas.perspectives.calculator.data_editor module

class sas.perspectives.calculator.data_editor.DataEditorPanel(parent, data=[], *args, **kwds)[source]

Bases: wx._windows.ScrolledWindow

Parameters:data
when not empty the class can
same information into a dat object

and post event containing the changed data object to some other frame

choose_data_file(location=None)[source]

Open a file dialog to allow loading a file

complete_loading(data=None, filename='')[source]

Complete the loading and compute the slit size

edit_collimation()[source]

Edit the selected collimation

edit_detector()[source]

Edit the selected detector

edit_sample()[source]

Open the dialog to edit the sample of the current data

edit_source()[source]

Open the dialog to edit the saource of the current data

enable_data_cbox()[source]
fill_data_combox()[source]

fill the current combobox with the available data

get_current_data()[source]
get_data()[source]

return the current data

get_notes()[source]

return notes

on_change_run(event=None)[source]

Change run

on_change_title(event=None)[source]

Change title

on_click_apply(event)[source]

changes are saved in data object imported to edit

on_click_browse(event)[source]

Open a file dialog to allow the user to select a given file. Display the loaded data if available.

on_click_reset(event)[source]
on_click_save(event)[source]

Save change into a file

on_click_view(event)[source]

Display data info

on_close(event)[source]

leave data as it is and close

on_edit(event)[source]
on_select_data(event=None)[source]
reset_panel()[source]
reset_radiobox()[source]
set_collimation(collimation, notes=None)[source]

set collimation for data

set_detector(detector, notes=None)[source]

set detector for data

set_sample(sample, notes=None)[source]

set sample for data

set_source(source, notes=None)[source]

set source for data

set_values()[source]

take the aperture values of the current data and display them through the panel

class sas.perspectives.calculator.data_editor.DataEditorWindow(parent, manager, data=None, *args, **kwds)[source]

Bases: wx._windows.Frame

get_data()[source]

return the current data

sas.perspectives.calculator.data_editor.load_error(error=None)[source]

Pop up an error message.

@param error: details error message to be displayed

sas.perspectives.calculator.data_operator module

GUI for the data operation

class sas.perspectives.calculator.data_operator.DataOperPanel(parent, *args, **kwds)[source]

Bases: wx._windows.ScrolledWindow

check_data_inputs()[source]

Check data1 and data2 whether or not they are ready for operation

disconnect_panels()[source]
draw_output(output)[source]

Draw output data(temp)

fill_data_combox()[source]

fill the current combobox with the available data

fill_oprator_combox()[source]

fill the current combobox with the operator

get_datalist()[source]
make_data_out(data1, data2)[source]

Make a temp. data output set

on_click_apply(event)[source]

changes are saved in data object imported to edit

on_close(event)[source]

leave data as it is and close

on_name(event=None)[source]

On data name typing

on_number(event=None)[source]

On selecting Number for Data2

on_select_data1(event=None)[source]

On select data1

on_select_data2(event=None)[source]

On Selecting Data2

on_select_operator(event=None)[source]

On Select an Operator

put_text_pic(pic=None, content='')[source]

Put text to the pic

send_warnings(msg='', info='info')[source]

Send warning to status bar

set_panel_on_focus(event)[source]

On Focus at this window

set_plot_unfocus()[source]

Unfocus on right click

class sas.perspectives.calculator.data_operator.DataOperatorWindow(parent, manager, *args, **kwds)[source]

Bases: wx._windows.MDIChildFrame

OnClose(event=None)[source]

On close event

class sas.perspectives.calculator.data_operator.SmallPanel(parent, id=-1, is_number=False, content='?', **kwargs)[source]

Bases: sas.plottools.PlotPanel.PlotPanel

PlotPanel for Quick plot and masking plot

add_image(plot)[source]

Add Image

add_text()[source]

Text in the plot

add_toolbar()[source]

Add toolbar

draw()[source]

Draw

erase_legend()[source]

Remove Legend

onContextMenu(event)[source]

Default context menu for a plot panel

onLeftDown(event)[source]

Disables LeftDown

onMouseMotion(event)[source]

Disable dragging 2D image

onPick(event)[source]

Remove Legend

onWheel(event)[source]
on_set_focus(event)[source]

send to the parenet the current panel on focus

ontogglescale(event)[source]

On toggle 2d scale

set_content(content='')[source]

Set text content

sas.perspectives.calculator.density_panel module

This module provide GUI for the mass density calculator

class sas.perspectives.calculator.density_panel.DensityPanel(parent, base=None, *args, **kwds)[source]

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

Provides the mass density calculator GUI.

CENTER_PANE = True
calculate(event)[source]

Calculate the mass Density/molar Volume of the molecules

check_inputs()[source]

Check validity user inputs

clear_outputs()[source]

Clear the outputs textctrl

get_input()[source]

Return the current input and output combobox values

on_select_input(event)[source]

On selection of input combobox, update units and output combobox

on_select_output(event)[source]

On selection of output combobox, update units and input combobox

set_values()[source]

Sets units and combobox values

window_caption = 'Mass Density Calculator'
window_name = 'Mass Density Calculator'
class sas.perspectives.calculator.density_panel.DensityWindow(parent=None, title='Density/Volume Calculator', base=None, manager=None, size=(460, 270.5882352941177), *args, **kwds)[source]

Bases: wx._windows.MDIChildFrame

on_close(event)[source]

On close event

class sas.perspectives.calculator.density_panel.ViewApp(redirect=False, filename=None, useBestVisual=False, clearSigInt=True)[source]

Bases: wx._core.App

OnInit()[source]

sas.perspectives.calculator.detector_editor module

class sas.perspectives.calculator.detector_editor.DetectorDialog(parent=None, manager=None, detector=None, title='Detector Editor', size=(550, 480))[source]

Bases: wx._windows.Dialog

add_detector(event)[source]

Append empty detector to data’s list of detector

enable_detector()[source]

Enable /disable widgets crelated to detector

fill_detector_combox()[source]

fill the current combobox with the available detector

get_current_detector()[source]
get_detector()[source]

return the current detector

get_notes()[source]

return notes

on_change_beam_center()[source]

Change the detector beam center

on_change_distance()[source]

Change distance of the sample to the detector

on_change_instrument()[source]

Change instrument

on_change_offset()[source]

Change the detector offset

on_change_orientation()[source]

Change the detector orientation

on_change_pixel_size()[source]

Change the detector pixel size

on_change_slit_length()[source]

Change slit length of the detector

on_click_apply(event)[source]

Apply user values to the detector

on_click_cancel(event)[source]

reset the current detector to its initial values

remove_detector(event)[source]

Remove detector to data’s list of detector

reset_detector()[source]

put the default value of the detector back to the current detector

reset_detector_combobox(edited_detector)[source]

take all edited editor and reset clientdata of detector combo box

set_detector(detector)[source]

set detector for data

set_manager(manager)[source]

Set manager of this window

set_values()[source]

take the detector values of the current data and display them through the panel

sas.perspectives.calculator.gen_scatter_panel module

Generic Scattering panel. This module relies on guiframe manager.

class sas.perspectives.calculator.gen_scatter_panel.CalcGen(id=-1, input=None, completefn=None, updatefn=None, yieldtime=0.01, worktime=0.01)[source]

Bases: sas.data_util.calcthread.CalcThread

Computation

compute()[source]

excuting computation

class sas.perspectives.calculator.gen_scatter_panel.OmfPanel(parent, *args, **kwds)[source]

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

Provides the sas gen calculator GUI.

CENTER_PANE = False
check_inputs()[source]

check if the inputs are valid

display_npts(nop)[source]

Displays Npts ctrl

get_pix_volumes()[source]

Get the pixel volume

get_sld_val()[source]

Set sld_n of slddata on sld input

on_save(event)[source]

Close the window containing this panel

on_sld_draw(event)[source]

Draw sld profile as scattered plot

set_npts_from_slddata()[source]

Set total n. of points form the sld data

set_sld_ctr(sld_data)[source]

Set sld textctrls

set_slddata(slddata)[source]

Set sld data related items

window_caption = 'SLD Pixel Info '
window_name = 'SLD Pixel Info'
class sas.perspectives.calculator.gen_scatter_panel.SasGenPanel(parent, *args, **kwds)[source]

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

Provides the sas gen calculator GUI.

CENTER_PANE = True
choose_data_file(location=None)[source]

Choosing a dtata file

complete(input, update=None)[source]

Gen compute complete function :Param input: input list [qx_data, qy_data, i_out]

complete_loading(data=None, filename='')[source]

Complete the loading

estimate_ctime()[source]

Calculation time estimation

load_update()[source]

print update on the status bar

on_compute(event)[source]

Compute I(qx, qy)

on_load_data(event)[source]

Open a file dialog to allow the user to select a given file. The user is only allow to load file with extension .omf, .txt, .sld. Display the slit size corresponding to the loaded data.

on_panel_close(event)[source]

On Close SLD panel

set_est_time()[source]

Set text for est. computation time

set_input_params()[source]

Set model parameters

set_scale2d(scale)[source]

Set SLD plot scale

set_volume_ctl_val(val)[source]

Set volume txtctrl value

sld_draw(event=None, has_arrow=True)[source]

Draw 3D sld profile

window_caption = 'Generic SAS '
window_name = 'Generic SAS Calculator'
class sas.perspectives.calculator.gen_scatter_panel.SasGenWindow(parent=None, manager=None, title='Generic Scattering Calculator', size=(806.0, 610.5), *args, **kwds)[source]

Bases: wx._windows.MDIChildFrame

GEN SAS main window

build_panels()[source]
check_omfpanel_inputs()[source]

Check OMF panel inputs

draw_graph(plot, title='')[source]
get_npix()[source]

Get no. of pixels from omf panel

get_path()[source]

File location

get_pix_volumes()[source]

Get a pixel volume

get_sld_data()[source]

Return slddata

get_sld_data_from_omf()[source]
get_sld_from_omf()[source]
on_close(event)[source]

Close

on_help(event)[source]

Gen scatter angle help panel

on_open_file(event)[source]

On Open

on_panel_close(event)[source]
on_save_file(event)[source]

On Close

set_etime()[source]

Sets est. computation time on panel

set_file_location(path)[source]

File location

set_main_panel_sld_data(sld_data)[source]
set_omfpanel_default_shap(shape)[source]

Set default_shape in omfpanel

set_omfpanel_npts()[source]

Set Npts in omf panel

set_scale2d(scale)[source]
set_schedule_full_draw(panel=None, func='del')[source]

Send full draw to gui frame

set_sld_data(data)[source]

Set omfdata

set_sld_n(sld)[source]
set_volume_ctr_val(val)[source]

Set volume txtctl value

sld_draw()[source]

sld draw

sas.perspectives.calculator.gen_scatter_panel.add_icon(parent, frame)[source]

Add icon in the frame

sas.perspectives.calculator.help_panel module

Help panel for calculator

class sas.perspectives.calculator.help_panel.HelpWindow(parent, id=-1, title='Tool Help', pageToOpen=None, size=(700, 450))[source]

Bases: wx._windows.Frame

OnLinkClicked(event)[source]

Function to diplay html page related to the hyperlinktext selected

class sas.perspectives.calculator.help_panel.ViewApp(redirect=False, filename=None, useBestVisual=False, clearSigInt=True)[source]

Bases: wx._core.App

OnInit()[source]

sas.perspectives.calculator.image_viewer module

class sas.perspectives.calculator.image_viewer.ImageFrame(parent, id, title, image=None, scale='log_{10}', size=wx.Size(550, 470))[source]

Bases: sas.guiframe.local_perspectives.plotting.SimplePlot.PlotFrame

Frame for simple plot

on_help(event)[source]

Image Viewer help panel

on_set_data(event)[source]

Rescale the x y range, make 2D data and send it to data explore

class sas.perspectives.calculator.image_viewer.ImageView(parent=None)[source]

Open a file dialog to allow the user to select a given file. Display the loaded data if available.

choose_data_file(location=None)[source]

Open a file dialog to allow loading a file

load()[source]

load image files

class sas.perspectives.calculator.image_viewer.SetDialog(parent, id=-1, title='Convert to Data', image=None, size=(480, 270))[source]

Bases: wx._windows.Dialog

Dialog for Data Set

OnClose(event)[source]

Close event

convert_image(rgb, xmin, xmax, ymin, ymax, zscale)[source]

Convert image to data2D

on_set(event)[source]

Set image as data

rgb2gray(rgb)[source]

RGB to Grey

sas.perspectives.calculator.kiessig_calculator_panel module

This software was developed by the University of Tennessee as part of the Distributed Data Analysis of Neutron Scattering Experiments (DANSE) project funded by the US National Science Foundation.

See the license text in license.txt

copyright 2008, 2009, University of Tennessee

class sas.perspectives.calculator.kiessig_calculator_panel.KiessigThicknessCalculatorPanel(parent, *args, **kwds)[source]

Bases: wx._windows.Panel, sas.guiframe.panel_base.PanelBase

Provides the Kiessig thickness calculator GUI.

CENTER_PANE = True
format_number(value=None)[source]

Return a float in a standardized, human-readable formatted string

on_close(event)[source]

close the window containing this panel

on_compute(event)[source]

Execute the computation of thickness

window_caption = 'Kiessig Thickness Calculator'
window_name = 'Kiessig Thickness Calculator'
class sas.perspectives.calculator.kiessig_calculator_panel.KiessigWindow(parent=None, manager=None, title='Kiessig Thickness Calculator', size=(560, 230), *args, **kwds)[source]

Bases: wx._windows.MDIChildFrame

on_close(event)[source]

Close event

sas.perspectives.calculator.load_thread module

Thread handler used to load data

class sas.perspectives.calculator.load_thread.DataReader(path, completefn=None, updatefn=None, yieldtime=0.01, worktime=0.01)[source]

Bases: sas.data_util.calcthread.CalcThread

Load a data given a filename

compute()[source]

read some data

isquit()[source]

@raise KeyboardInterrupt: when the thread is interrupted

class sas.perspectives.calculator.load_thread.GenReader(path, loader, completefn=None, updatefn=None, yieldtime=0.01, worktime=0.01)[source]

Bases: sas.data_util.calcthread.CalcThread

Load a sld data given a filename

compute()[source]

read some data

isquit()[source]

@raise KeyboardInterrupt: when the thread is interrupted

sas.perspectives.calculator.model_editor module

class sas.perspectives.calculator.model_editor.EditorPanel(parent, base, path, title, *args, **kwds)[source]

Bases: wx._windows.ScrolledWindow

Custom model function editor

check_name()[source]

Check name if exist already

get_notes()[source]

return notes

get_warning()[source]

Get the warning msg

on_change_name(event=None)[source]

Change name

on_click_apply(event)[source]

Changes are saved in data object imported to edit

on_close(event)[source]

leave data as it is and close

on_over_cb(event)[source]

Set overwrite name flag on cb event

set_function_helper(line)[source]

Get string in line to define the local params

Parameters:line – one line of string got from the param_str
set_param_helper(line)[source]

Get string in line to define the params dictionary

Parameters:line – one line of string got from the param_str
write_file(fname, desc_str, param_str, func_str)[source]

Write content in file

Parameters:
  • fname – full file path
  • desc_str – content of the description strings
  • param_str – content of params; Strings
  • func_str – content of func; Strings
class sas.perspectives.calculator.model_editor.EditorWindow(parent, base, path, title, size=(800, 735), *args, **kwds)[source]

Bases: wx._windows.Frame

Editor Window

OnClose(event)[source]

On close event

class sas.perspectives.calculator.model_editor.TextDialog(parent=None, base=None, id=None, title='', model_list=[], plugin_dir=None)[source]

Bases: wx._windows.Dialog

Dialog for easy custom sum models

check_name(event=None)[source]

Check name if exist already

compile_file(path)[source]

Compile the file in the path

delete_file(path)[source]

Delete file in the path

fill_oprator_combox()[source]

fill the current combobox with the operator

getText()[source]

Returns model name string as list

on_apply(path)[source]

On Apply

on_change_name(event=None)[source]

Change name

on_model1(event)[source]

Set model1

on_model2(event)[source]

Set model2

on_select_operator(event=None)[source]

On Select an Operator

update_cm_list()[source]

Update custom model list

write_string(fname, name1, name2)[source]

Write and Save file

sas.perspectives.calculator.pyconsole module

Console Module display Python console

class sas.perspectives.calculator.pyconsole.PyConsole(parent=None, base=None, manager=None, panel=None, title='Python Shell/Editor', filename=None, size=(830, 730))[source]

Bases: wx.py.editor.EditorNotebookFrame

CENTER_PANE = False
OnAbout(event)[source]

On About

OnCompile(event)[source]

Compile

OnHelp(event)[source]

Show a help dialog.

OnNewFile(event)[source]

OnFileOpen

OnOpenFile(event)[source]

OnFileOpen

OnRun(event)[source]

Run

OnSaveAsFile(event)[source]

OnFileSaveAs overwrite

OnSaveFile(event)[source]

OnFileSave overwrite

OnUpdateCompileMenu(event)[source]

Update Compile menu items based on current tap.

bufferOpen()[source]

Open file in buffer, bypassing editor bufferOpen

bufferSaveAs()[source]

Save buffer to a new filename: Bypassing editor bufferSaveAs

on_close(event)[source]

Close event

set_manager(manager)[source]

Set the manager of this window

window_caption = 'Custom Model Editor'
window_name = 'Custom Model Editor'
sas.perspectives.calculator.pyconsole.compile_file(path)[source]

Compile a python file

sas.perspectives.calculator.resolcal_thread module

Thread for Resolution computation

class sas.perspectives.calculator.resolcal_thread.CalcRes(id=-1, func=None, qx=None, qy=None, qx_min=None, qx_max=None, qy_min=None, qy_max=None, image=None, completefn=None, updatefn=None, elapsed=0, yieldtime=0.01, worktime=0.01)[source]

Bases: sas.data_util.calcthread.CalcThread

Compute Resolution

compute()[source]

excuting computation

sas.perspectives.calculator.resolution_calculator_panel module

This software was developed by the University of Tennessee as part of the Distributed Data Analysis of Neutron Scattering Experiments (DANSE) project funded by the US National Science Foundation.

See the license text in license.txt

copyright 2008, 2009, 2010 University of Tennessee

class sas.perspectives.calculator.resolution_calculator_panel.ResolutionCalculatorPanel(parent, *args, **kwds)[source]

Bases: wx.lib.scrolledpanel.ScrolledPanel

Provides the Resolution calculator GUI.

CENTER_PANE = True
complete(image, elapsed=None)[source]

Callafter complete: wx call after needed for stable output

complete_cal(image, elapsed=None)[source]

Complete computation

format_number(value=None)[source]

Return a float in a standardized, human-readable formatted string

on_close(event)[source]

close the window containing this panel

on_compute(event=None)[source]

Execute the computation of resolution

on_compute_call(event=None)[source]

Execute the computation of resolution

on_reset(event)[source]

Execute the reset

window_caption = ''
window_name = 'SAS Resolution Estimator'
class sas.perspectives.calculator.resolution_calculator_panel.ResolutionWindow(parent=None, manager=None, title='SAS Resolution Estimator', size=(1080, 662), *args, **kwds)[source]

Bases: wx._windows.MDIChildFrame

Resolution Window

OnClose(event)[source]

On close event

sas.perspectives.calculator.sample_editor module

class sas.perspectives.calculator.sample_editor.SampleDialog(parent=None, manager=None, sample=None, size=(550, 430), title='Sample Editor')[source]

Bases: wx._windows.Dialog

get_notes()[source]

return notes

get_sample()[source]

return the current sample

on_change_details()[source]

Change details

on_change_id()[source]

Change id of the sample

on_change_name()[source]

Change name

on_change_orientation()[source]

Change orientation

on_change_position()[source]

Change position

on_change_temperature()[source]

Change temperature

on_change_thickness()[source]

Change thickness

on_change_transmission()[source]

Change transmission

on_click_apply(event)[source]

Apply user values to the sample

on_click_cancel(event)[source]

leave the sample as it is and close

reset_sample()[source]

Put initial values of the sample back to the current sample

set_details(sample)[source]

print details on the current sample

set_manager(manager)[source]

Set manager of this window

set_values()[source]

take the sample values of the current data and display them through the panel

sas.perspectives.calculator.sld_panel module

This module provide GUI for the neutron scattering length density calculator

class sas.perspectives.calculator.sld_panel.SldPanel(parent, base=None, *args, **kwds)[source]

Bases: wx._windows.Panel, sas.guiframe.panel_base.PanelBase

Provides the SLD calculator GUI.

CENTER_PANE = True
calculateSld(event)[source]

Calculate the neutron scattering density length of a molecule

calculate_sld_helper(element, density, molecule_formula)[source]

Get an element and compute the corresponding SLD for a given formula

Parameters:element – elements a string of existing atom
calculate_xray_sld(element)[source]

Get an element and compute the corresponding SLD for a given formula

Parameters:element – elements a string of existing atom
check_inputs()[source]

Check validity user inputs

clear_outputs()[source]

Clear the outputs textctrl

window_caption = 'SLD Calculator'
window_name = 'SLD Calculator'
class sas.perspectives.calculator.sld_panel.SldWindow(parent=None, title='SLD Calculator', base=None, manager=None, size=(410, 410), *args, **kwds)[source]

Bases: wx._windows.MDIChildFrame

on_close(event)[source]

On close event

class sas.perspectives.calculator.sld_panel.ViewApp(redirect=False, filename=None, useBestVisual=False, clearSigInt=True)[source]

Bases: wx._core.App

OnInit()[source]

sas.perspectives.calculator.slit_length_calculator_panel module

This software was developed by the University of Tennessee as part of the Distributed Data Analysis of Neutron Scattering Experiments (DANSE) project funded by the US National Science Foundation.

See the license text in license.txt

copyright 2008, 2009, University of Tennessee

class sas.perspectives.calculator.slit_length_calculator_panel.SlitLengthCalculatorPanel(parent, *args, **kwds)[source]

Bases: wx._windows.Panel, sas.guiframe.panel_base.PanelBase

Provides the slit length calculator GUI.

CENTER_PANE = True
choose_data_file(location=None)[source]
complete_loading(data=None, filename='')[source]

Complete the loading and compute the slit size

load_update()[source]

print update on the status bar

on_close(event)[source]

close the window containing this panel

on_load_data(event)[source]

Open a file dialog to allow the user to select a given file. The user is only allow to load file with extension .DAT or .dat. Display the slit size corresponding to the loaded data.

window_caption = 'Slit Size Calculator'
window_name = 'Slit Size Calculator'
class sas.perspectives.calculator.slit_length_calculator_panel.SlitLengthCalculatorWindow(parent=None, manager=None, title='Slit Size Calculator', size=(530, 210), *args, **kwds)[source]

Bases: wx._windows.MDIChildFrame

on_close(event)[source]

Close event

sas.perspectives.calculator.source_editor module

class sas.perspectives.calculator.source_editor.SourceDialog(parent=None, manager=None, source=None, *args, **kwds)[source]

Bases: wx._windows.Dialog

get_notes()[source]

return notes

get_source()[source]

return the current source

on_change_beam_shape()[source]

Change beams shape

on_change_beam_size()[source]

Change beam size

on_change_beam_size_name()[source]

Change beam size name

on_change_name()[source]

Change name

on_change_radiation()[source]

Change radiation of the sample

on_change_wavelength()[source]

Change the wavelength

on_change_wavelength_max()[source]

Change the wavelength maximum

on_change_wavelength_min()[source]

Change the wavelength minimum

on_change_wavelength_spread()[source]

Change the wavelength spread

on_click_apply(event)[source]

Apply user values to the source

on_click_cancel(event)[source]

reset the current source

reset_source()[source]

put back initial values of the source

set_manager(manager)[source]

Set manager of this window

set_values()[source]

take the source values of the current data and display them through the panel

Module contents

sas.perspectives.calculator.data_files()[source]

Return the data files associated with media calculator.

The format is a list of (directory, [files...]) pairs which can be used directly in setup(...,data_files=...) for setup.py.

sas.perspectives.calculator.get_data_path(media)[source]