sas.sasgui.guiframe.local_perspectives.plotting package
Submodules
sas.sasgui.guiframe.local_perspectives.plotting.AnnulusSlicer module
-
class
sas.sasgui.guiframe.local_perspectives.plotting.AnnulusSlicer.
AnnulusInteractor
(base, axes, color='black', zorder=3)[source] Bases:
sas.sasgui.guiframe.local_perspectives.plotting.BaseInteractor._BaseInteractor
Select an annulus through a 2D plot. This interactor is used to average 2D data with the region defined by 2 radius. this class is defined by 2 Ringinterators.
-
clear
()[source] Clear the slicer and all connected events related to this slicer
-
draw
()[source]
-
freeze_axes
()[source]
-
get_params
()[source] Store a copy of values of parameters of the slicer into a dictionary.
Return params: the dictionary created
-
move
(x, y, ev)[source] Process move to a new position, making sure that the move is allowed.
-
moveend
(ev)[source] Called when any dragging motion ends. Post an event (type =SlicerParameterEvent) to plotter 2D with a copy slicer parameters Call _post_data method
-
restore
()[source] Restore the roughness for this layer.
-
save
(ev)[source] Remember the roughness for this layer and the next so that we can restore on Esc.
-
set_cursor
(x, y)[source]
-
set_layer
(n)[source] Allow adding plot to the same panel
Parameters: n – the number of layer
-
set_params
(params)[source] Receive a dictionary and reset the slicer with values contained in the values of the dictionary.
Parameters: params – a dictionary containing name of slicer parameters and values the user assigned to the slicer.
-
thaw_axes
()[source]
-
update
()[source] Respond to changes in the model by recalculating the profiles and resetting the widgets.
-
-
class
sas.sasgui.guiframe.local_perspectives.plotting.AnnulusSlicer.
CircularMask
(base, axes, color='grey', zorder=3, side=None)[source] Bases:
sas.sasgui.guiframe.local_perspectives.plotting.BaseInteractor._BaseInteractor
Draw a ring Given a radius
-
clear
()[source] Clear the slicer and all connected events related to this slicer
-
draw
()[source]
-
freeze_axes
()[source]
-
get_params
()[source] Store a copy of values of parameters of the slicer into a dictionary.
Return params: the dictionary created
-
move
(x, y, ev)[source] Process move to a new position, making sure that the move is allowed.
-
moveend
(ev)[source] Called when any dragging motion ends. Post an event (type =SlicerParameterEvent) to plotter 2D with a copy slicer parameters Call _post_data method
-
restore
()[source] Restore the roughness for this layer.
-
save
(ev)[source] Remember the roughness for this layer and the next so that we can restore on Esc.
-
set_cursor
(x, y)[source]
-
set_layer
(n)[source] Allow adding plot to the same panel
Parameters: n – the number of layer
-
set_params
(params)[source] Receive a dictionary and reset the slicer with values contained in the values of the dictionary.
Parameters: params – a dictionary containing name of slicer parameters and values the user assigned to the slicer.
-
thaw_axes
()[source]
-
update
()[source] Respond to changes in the model by recalculating the profiles and resetting the widgets.
-
-
class
sas.sasgui.guiframe.local_perspectives.plotting.AnnulusSlicer.
RingInteractor
(base, axes, color='black', zorder=5, r=1.0, sign=1)[source] Bases:
sas.sasgui.guiframe.local_perspectives.plotting.BaseInteractor._BaseInteractor
Draw a ring Given a radius
-
clear
()[source] Clear the slicer and all connected events related to this slicer
-
get_params
()[source] Store a copy of values of parameters of the slicer into a dictionary.
Return params: the dictionary created
-
get_radius
()[source] Return self._inner_mouse_x: the current radius of the ring
-
move
(x, y, ev)[source] Process move to a new position, making sure that the move is allowed.
-
moveend
(ev)[source] Called after a dragging motion
-
restore
()[source] Restore the roughness for this layer.
-
save
(ev)[source] Remember the roughness for this layer and the next so that we can restore on Esc.
-
set_cursor
(x, y)[source] draw the ring given x, y value
-
set_layer
(n)[source] Allow adding plot to the same panel
Parameters: n – the number of layer
-
set_params
(params)[source] Receive a dictionary and reset the slicer with values contained in the values of the dictionary.
Parameters: params – a dictionary containing name of slicer parameters and values the user assigned to the slicer.
-
update
()[source] Draw the new roughness on the graph.
-
sas.sasgui.guiframe.local_perspectives.plotting.Arc module
Arc slicer for 2D data
-
class
sas.sasgui.guiframe.local_perspectives.plotting.Arc.
ArcInteractor
(base, axes, color='black', zorder=5, r=1.0, theta1=0.39269908169872414, theta2=0.7853981633974483)[source] Bases:
sas.sasgui.guiframe.local_perspectives.plotting.BaseInteractor._BaseInteractor
Select an annulus through a 2D plot
-
clear
()[source] Clear this slicer and its markers
-
get_params
()[source]
-
get_radius
()[source] Return arc radius
-
move
(x, y, ev)[source] Process move to a new position, making sure that the move is allowed.
-
moveend
(ev)[source] After a dragging motion reset the flag self.has_move to False :param ev: event
-
restore
()[source] Restore the roughness for this layer.
-
save
(ev)[source] Remember the roughness for this layer and the next so that we can restore on Esc.
-
set_cursor
(radius, phi_min, phi_max, nbins)[source]
-
set_layer
(n)[source] Allow adding plot to the same panel :param n: the number of layer
-
set_params
(params)[source]
-
update
(theta1=None, theta2=None, nbins=None, r=None)[source] Update the plotted arc :param theta1: starting angle of the arc :param theta2: ending angle of the arc :param nbins: number of points along the arc :param r: radius of the arc
-
sas.sasgui.guiframe.local_perspectives.plotting.AzimutSlicer module
-
class
sas.sasgui.guiframe.local_perspectives.plotting.AzimutSlicer.
SectorInteractor
(base, axes, color='black', zorder=3)[source] Bases:
sas.sasgui.guiframe.local_perspectives.plotting.BaseInteractor._BaseInteractor
Select an annulus through a 2D plot
-
clear
()[source]
-
draw
()[source]
-
freeze_axes
()[source]
-
get_params
()[source]
-
move
(x, y, ev)[source] Process move to a new position, making sure that the move is allowed.
-
moveend
(ev)[source]
-
post_data
(new_sector)[source] post data averaging in Q
-
restore
()[source] Restore the roughness for this layer.
-
save
(ev)[source] Remember the roughness for this layer and the next so that we can restore on Esc.
-
set_cursor
(x, y)[source]
-
set_layer
(n)[source]
-
set_params
(params)[source]
-
thaw_axes
()[source]
-
update
()[source] Respond to changes in the model by recalculating the profiles and resetting the widgets.
-
-
class
sas.sasgui.guiframe.local_perspectives.plotting.AzimutSlicer.
SectorInteractorPhi
(base, axes, color='black', zorder=3)[source] Bases:
sas.sasgui.guiframe.local_perspectives.plotting.AzimutSlicer.SectorInteractor
-
class
sas.sasgui.guiframe.local_perspectives.plotting.AzimutSlicer.
SectorInteractorQ
(base, axes, color='black', zorder=3)[source] Bases:
sas.sasgui.guiframe.local_perspectives.plotting.AzimutSlicer.SectorInteractor
sas.sasgui.guiframe.local_perspectives.plotting.BaseInteractor module
sas.sasgui.guiframe.local_perspectives.plotting.Edge module
-
class
sas.sasgui.guiframe.local_perspectives.plotting.Edge.
RadiusInteractor
(base, axes, color='black', zorder=5, arc1=None, arc2=None, theta=0.39269908169872414)[source] Bases:
sas.sasgui.guiframe.local_perspectives.plotting.BaseInteractor._BaseInteractor
Select an annulus through a 2D plot
-
clear
()[source]
-
get_angle
()[source]
-
get_params
()[source]
-
move
(x, y, ev)[source] Process move to a new position, making sure that the move is allowed.
-
moveend
(ev)[source]
-
restore
(ev)[source] Restore the roughness for this layer.
-
save
(ev)[source] Remember the roughness for this layer and the next so that we can restore on Esc.
-
set_cursor
(r_min, r_max, theta)[source]
-
set_layer
(n)[source]
-
set_params
(params)[source]
-
update
(r1=None, r2=None, theta=None)[source] Draw the new roughness on the graph.
-
sas.sasgui.guiframe.local_perspectives.plotting.Plotter1D module
-
class
sas.sasgui.guiframe.local_perspectives.plotting.Plotter1D.
ModelPanel1D
(parent, id=-1, color=None, dpi=None, style=0, **kwargs)[source] Bases:
sas.sasgui.plottools.PlotPanel.PlotPanel
,sas.sasgui.guiframe.panel_base.PanelBase
Plot panel for use with the GUI manager
-
ALWAYS_ON
= True
-
createAppDialog
(event)[source] Create the custom dialog for fit appearance modification
-
cusor_line
(event)[source] Move the cursor line to write Q range
-
draw_plot
()[source] Draw plot
-
get_color_label
()[source] Associates label to a specific color
-
get_data_xy_vals
(xval)[source] Get x, y data values near x = x_val
-
get_symbol_label
()[source] Associates label to symbol
-
group_id
= None
-
modifyGraphAppearance
(event)[source] On Modify Graph Appearance
-
onContextMenu
(event)[source] 1D plot context menu
Parameters: event – wx context event
-
onFreeze
(event)[source] on Freeze data
-
onLeftDown
(event)[source] left button down and ready to drag Display the position of the mouse on the statusbar
-
onSetRange
(event)[source]
-
on_AppDialog_close
(event)[source] on_Modify Plot Property_close
-
on_close
(event)[source] On Close Event
-
on_graphApp_close
(event)[source] Gets values from graph appearance dialog and sends them off to modify the plot
-
on_plot_qrange
(event=None)[source] On Qmin Qmax vertical line event
-
plot_data
(data)[source] Data is ready to be displayed
Parameters: event – data event
-
remove_data_by_id
(id)[source] Remove data from plot
-
schedule_full_draw
(func='append')[source] Put self in schedule to full redraw list
-
set_data
(list=None)[source]
-
set_resizing
(resizing=False)[source] Set the resizing (True/False)
-
window_name
= 'plotpanel'
-
-
sas.sasgui.guiframe.local_perspectives.plotting.Plotter1D.
find_key
(dic, val)[source] return the key of dictionary dic given the value
sas.sasgui.guiframe.local_perspectives.plotting.Plotter2D module
-
class
sas.sasgui.guiframe.local_perspectives.plotting.Plotter2D.
ModelPanel2D
(parent, id=-1, data2d=None, color=None, dpi=None, style=0, **kwargs)[source] Bases:
sas.sasgui.guiframe.local_perspectives.plotting.Plotter1D.ModelPanel1D
Plot panel for use with the GUI manager
-
ALWAYS_ON
= True
-
add_toolbar
()[source] add toolbar
-
freeze_axes
()[source]
-
group_id
= None
-
modifyGraphAppearance
(e)[source]
-
onBoxSum
(event)[source]
-
onBoxavgX
(event)[source] Perform 2D data averaging on Qx Create a new slicer .
Parameters: event – wx.menu event
-
onBoxavgY
(event)[source] Perform 2D data averaging on Qy Create a new slicer .
Parameters: event – wx.menu event
-
onCircular
(event, ismask=False)[source] perform circular averaging on Data2D
Parameters: event – wx.menu event
-
onClearSlicer
(event)[source] Clear the slicer on the plot
-
onContextMenu
(event)[source] 2D plot context menu
Parameters: event – wx context event
-
onEditLabels
(event)[source] Edit legend label
-
onLeftDown
(event)[source] left button down and ready to drag
-
onMaskedCircular
(event)[source] perform circular averaging on Data2D with mask if it exists
Parameters: event – wx.menu event
-
onMouseMotion
(event)[source]
-
onSectorPhi
(event)[source] Perform sector averaging on Phi and draw annulus slicer
-
onSectorQ
(event)[source] Perform sector averaging on Q and draw sector slicer
-
onWheel
(event)[source]
-
on_graphApp_close
(e)[source] Gets values from graph appearance dialog and sends them off to modify the plot
-
on_plot_qrange
(event=None)[source] On Qmin Qmax vertical line event
-
plot_data
(data)[source] Data is ready to be displayed
TODO: this name should be changed to something more appropriate Don’t forget that changing this name will mean changing code in plotting.py Parameters: event – data event
-
thaw_axes
()[source]
-
update
(draw=True)[source] Respond to changes in the model by recalculating the profiles and resetting the widgets.
-
window_name
= 'plotpanel'
-
Bases:
sas.sasgui.plottools.toolbar.NavigationToolBar
add item to the toolbar
remove default toolbar item
-
sas.sasgui.guiframe.local_perspectives.plotting.Plotter2D.
find_key
(dic, val)[source] return the key of dictionary dic given the value
sas.sasgui.guiframe.local_perspectives.plotting.SectorSlicer module
Sector interactor
-
class
sas.sasgui.guiframe.local_perspectives.plotting.SectorSlicer.
LineInteractor
(base, axes, color='black', zorder=5, r=1.0, theta=0.7853981633974483)[source] Bases:
sas.sasgui.guiframe.local_perspectives.plotting.BaseInteractor._BaseInteractor
Select an annulus through a 2D plot
-
clear
()[source]
-
get_params
()[source]
-
move
(x, y, ev)[source] Process move to a new position, making sure that the move is allowed.
-
moveend
(ev)[source]
-
restore
()[source] Restore the roughness for this layer.
-
save
(ev)[source] Remember the roughness for this layer and the next so that we can restore on Esc.
-
set_cursor
(x, y)[source]
-
set_layer
(n)[source]
-
set_params
(params)[source]
-
update
(theta=None)[source] Draw the new roughness on the graph.
-
-
class
sas.sasgui.guiframe.local_perspectives.plotting.SectorSlicer.
SectorInteractor
(base, axes, color='black', zorder=3)[source] Bases:
sas.sasgui.guiframe.local_perspectives.plotting.BaseInteractor._BaseInteractor
Draw a sector slicer.Allow to performQ averaging on data 2D
-
clear
()[source] Clear the slicer and all connected events related to this slicer
-
draw
()[source]
-
freeze_axes
()[source]
-
get_params
()[source] Store a copy of values of parameters of the slicer into a dictionary.
Return params: the dictionary created
-
move
(x, y, ev)[source] Process move to a new position, making sure that the move is allowed.
-
moveend
(ev)[source] Called a dragging motion ends.Get slicer event
-
restore
()[source] Restore the roughness for this layer.
-
save
(ev)[source] Remember the roughness for this layer and the next so that we can restore on Esc.
-
set_cursor
(x, y)[source]
-
set_layer
(n)[source] - Allow adding plot to the same panel
Parameters: n – the number of layer
-
set_params
(params)[source] Receive a dictionary and reset the slicer with values contained in the values of the dictionary.
Parameters: params – a dictionary containing name of slicer parameters and values the user assigned to the slicer.
-
thaw_axes
()[source]
-
update
()[source] Respond to changes in the model by recalculating the profiles and resetting the widgets.
-
-
class
sas.sasgui.guiframe.local_perspectives.plotting.SectorSlicer.
SideInteractor
(base, axes, color='black', zorder=5, r=1.0, phi=0.7853981633974483, theta2=1.0471975511965976)[source] Bases:
sas.sasgui.guiframe.local_perspectives.plotting.BaseInteractor._BaseInteractor
Draw an oblique line
Parameters: - phi – the phase between the middle line and one side line
- theta2 – the angle between the middle line and x- axis
-
clear
()[source] Clear the slicer and all connected events related to this slicer
-
get_params
()[source]
-
move
(x, y, ev)[source] Process move to a new position, making sure that the move is allowed.
-
moveend
(ev)[source]
-
restore
()[source] Restore the roughness for this layer.
-
save
(ev)[source] Remember the roughness for this layer and the next so that we can restore on Esc.
-
set_cursor
(x, y)[source]
-
set_layer
(n)[source] Allow adding plot to the same panel
Parameters: n – the number of layer
-
set_params
(params)[source]
-
update
(phi=None, delta=None, mline=None, side=False, left=False, right=False)[source] Draw oblique line
Parameters: - phi – the phase between the middle line and the current line
- delta – phi/2 applied only when the mline was moved
sas.sasgui.guiframe.local_perspectives.plotting.SimplePlot module
Simple Plot Frame : supporting only copy, print, scale
-
class
sas.sasgui.guiframe.local_perspectives.plotting.SimplePlot.
PlotFrame
(parent, id, title, scale='log_{10}', size=wx.Size(550, 470), show_menu_icons=True)[source] Bases:
wx._windows.Frame
Frame for simple plot
-
add_plot
(plot)[source] Add Image
-
im_show
(img)[source] Show background image :Param img: [imread(path) from matplotlib.pyplot]
-
on_close
(event)[source] On Close
-
on_copy_image
(event)[source] Save image
-
on_print_image
(event)[source] Save image
-
on_print_preview
(event)[source] Save image
-
on_save_file
(event)[source] Save image
-
set_plot_unfocus
()[source] un focusing
-
set_schedule
(schedule=False)[source]
-
set_schedule_full_draw
(panel, func)[source]
-
-
class
sas.sasgui.guiframe.local_perspectives.plotting.SimplePlot.
SimplePlotPanel
(parent, id=-1, color=None, dpi=None, style=0, **kwargs)[source] Bases:
sas.sasgui.guiframe.local_perspectives.plotting.Plotter2D.ModelPanel2D
PlotPanel for 1d and 2d
-
add_toolbar
()[source]
-
draw
()[source]
-
onContextMenu
(event)[source] 2D plot context menu
Parameters: event – wx context event
-
onLeftDown
(event)[source] left button down and ready to drag
-
on_grid_onoff
(event)[source] On grid on/off
-
on_kill_focus
(event)[source] Reset the panel color
-
on_set_focus
(event)[source] By pass default boundary blue color drawing
-
show_plot
(plot)[source] Show the plot
-
sas.sasgui.guiframe.local_perspectives.plotting.SlicerParameters module
-
class
sas.sasgui.guiframe.local_perspectives.plotting.SlicerParameters.
SlicerParameterPanel
(parent, *args, **kwargs)[source] Bases:
wx._windows.Dialog
Panel class to show the slicer parameters
-
onEVT_SLICER
(event)[source] Process EVT_SLICER events When the slicer changes, update the panel
Parameters: event – EVT_SLICER event
-
onParamChange
(evt)[source] receive an event end reset value text fields inside self.parameters
-
onTextEnter
(evt)[source] Parameters have changed
-
set_slicer
(type, params)[source] Rebuild the panel
-
sas.sasgui.guiframe.local_perspectives.plotting.appearanceDialog module
Dialog for appearance of plot symbols, color, size etc.
This software was developed by Institut Laue-Langevin as part of Distributed Data Analysis of Neutron Scattering Experiments (DANSE).
Copyright 2012 Institut Laue-Langevin
-
class
sas.sasgui.guiframe.local_perspectives.plotting.appearanceDialog.
appearanceDialog
(parent, title)[source] Bases:
wx._windows.Frame
Appearance dialog
-
close_dlg
(event)[source] On Close Dlg
-
combo_click
(event)[source] Combox on click
-
custom_size
(event)[source] On custom size
-
static
find_key
(dic, val)[source] Find key
-
get_current_values
()[source] Get Current Values :returns : (size, color, symbol, dataname)
-
init_ui
()[source] Create spacing needed
-
on_ok
(event)[source] On OK button clicked
-
populate_color
()[source] Populate Colors
-
populate_size
()[source] Populate Size
-
populate_symbol
()[source] Populate Symbols
-
set_defaults
(size, color, symbol, label)[source] Set Defaults
-
sas.sasgui.guiframe.local_perspectives.plotting.binder module
Extension to MPL to support the binding of artists to key/mouse events.
-
class
sas.sasgui.guiframe.local_perspectives.plotting.binder.
BindArtist
(figure)[source] Bases:
object
Track keyboard modifiers for events. TODO: Move keyboard modifier support into the backend. We cannot TODO: properly support it from outside the windowing system since there TODO: is no way to recognized whether shift is held down when the mouse TODO: first clicks on the the application window.
-
alt
= False
-
clear
(h1, h2, ...)[source] Remove connections for artists h1, h2, ...
Use clearall() to reset all connections.
-
clearall
()[source] Clear connections to all artists.
Use clear(h1,h2,...) to reset specific artists.
-
control
= False
-
dclick_threshhold
= 0.25
-
disconnect
()[source] In case we need to disconnect from the canvas...
-
events
= ['enter', 'leave', 'motion', 'click', 'dclick', 'drag', 'release', 'scroll', 'key', 'keyup']
-
meta
= False
-
shift
= False
-
trigger
(actor, action, ev)[source] Trigger a particular event for the artist. Fallback to axes, to figure, and to ‘all’ if the event is not processed.
-
-
class
sas.sasgui.guiframe.local_perspectives.plotting.binder.
Selection
(artist=None, prop={})[source] Bases:
object
Store and compare selections.
-
artist
= None
-
prop
= {}
-
sas.sasgui.guiframe.local_perspectives.plotting.boxMask module
-
class
sas.sasgui.guiframe.local_perspectives.plotting.boxMask.
BoxMask
(base, axes, color='black', zorder=3, side=None, x_min=0.008, x_max=0.008, y_min=0.0025, y_max=0.0025)[source] Bases:
sas.sasgui.guiframe.local_perspectives.plotting.BaseInteractor._BaseInteractor
BoxMask Class: determine 2 rectangular area to find the pixel of a Data inside of box.
Uses PointerInteractor , VerticalDoubleLine,HorizontalDoubleLine.
Parameters: - zorder – Artists with lower zorder values are drawn first.
- x_min – the minimum value of the x coordinate
- x_max – the maximum value of the x coordinate
- y_min – the minimum value of the y coordinate
- y_max – the maximum value of the y coordinate
-
clear
()[source] Clear the slicer and all connected events related to this slicer
-
draw
()[source]
-
freeze_axes
()[source]
-
get_mask
()[source] return mask as a result of boxcut
-
get_params
()[source] Store a copy of values of parameters of the slicer into a dictionary.
Return params: the dictionary created
-
move
(x, y, ev)[source] Process move to a new position, making sure that the move is allowed.
-
moveend
(ev)[source] After a dragging motion this function is called to compute the error and the sum of pixel of a given data 2D
-
restore
()[source] Restore the roughness for this layer.
-
save
(ev)[source] Remember the roughness for this layer and the next so that we can restore on Esc.
-
set_cursor
(x, y)[source]
-
set_params
(params)[source] Receive a dictionary and reset the slicer with values contained in the values of the dictionary.
Parameters: params – a dictionary containing name of slicer parameters and values the user assigned to the slicer.
-
thaw_axes
()[source]
-
update
()[source] Respond to changes in the model by recalculating the profiles and resetting the widgets.
-
class
sas.sasgui.guiframe.local_perspectives.plotting.boxMask.
inner_BoxMask
(base, axes, color='black', zorder=3, side=None, x_min=0.008, x_max=0.008, y_min=0.0025, y_max=0.0025)[source] Bases:
sas.sasgui.guiframe.local_perspectives.plotting.boxMask.BoxMask
sas.sasgui.guiframe.local_perspectives.plotting.boxSlicer module
-
class
sas.sasgui.guiframe.local_perspectives.plotting.boxSlicer.
BoxInteractor
(base, axes, color='black', zorder=3)[source] Bases:
sas.sasgui.guiframe.local_perspectives.plotting.BaseInteractor._BaseInteractor
BoxInteractor define a rectangle that return data1D average of Data2D in a rectangle area defined by -x, x ,y, -y
-
clear
()[source] Clear the slicer and all connected events related to this slicer
-
draw
()[source]
-
freeze_axes
()[source]
-
get_params
()[source] Store a copy of values of parameters of the slicer into a dictionary.
Return params: the dictionary created
-
move
(x, y, ev)[source] Process move to a new position, making sure that the move is allowed.
-
moveend
(ev)[source] Called after a dragging event. Post the slicer new parameters and creates a new Data1D corresponding to the new average
-
post_data
(new_slab=None, nbins=None, direction=None)[source] post data averaging in Qx or Qy given new_slab type
Parameters: - new_slab – slicer that determine with direction to average
- nbins – the number of points plotted when averaging
- direction – the direction of averaging
-
restore
()[source] Restore the roughness for this layer.
-
save
(ev)[source] Remember the roughness for this layer and the next so that we can restore on Esc.
-
set_cursor
(x, y)[source]
-
set_layer
(n)[source] Allow adding plot to the same panel
Parameters: n – the number of layer
-
set_params
(params)[source] Receive a dictionary and reset the slicer with values contained in the values of the dictionary.
Parameters: params – a dictionary containing name of slicer parameters and values the user assigned to the slicer.
-
thaw_axes
()[source]
-
update
()[source] Respond to changes in the model by recalculating the profiles and resetting the widgets.
-
update_and_post
()[source] Update the slicer and plot the resulting data
-
-
class
sas.sasgui.guiframe.local_perspectives.plotting.boxSlicer.
BoxInteractorX
(base, axes, color='black', zorder=3)[source] Bases:
sas.sasgui.guiframe.local_perspectives.plotting.boxSlicer.BoxInteractor
Average in Qx direction
-
class
sas.sasgui.guiframe.local_perspectives.plotting.boxSlicer.
BoxInteractorY
(base, axes, color='black', zorder=3)[source] Bases:
sas.sasgui.guiframe.local_perspectives.plotting.boxSlicer.BoxInteractor
Average in Qy direction
-
class
sas.sasgui.guiframe.local_perspectives.plotting.boxSlicer.
HorizontalLines
(base, axes, color='black', zorder=5, x=0.5, y=0.5)[source] Bases:
sas.sasgui.guiframe.local_perspectives.plotting.BaseInteractor._BaseInteractor
Draw 2 Horizontal lines centered on (0,0) that can move on the x- direction and in opposite direction
-
clear
()[source] Clear this slicer and its markers
-
move
(x, y, ev)[source] Process move to a new position, making sure that the move is allowed.
-
moveend
(ev)[source] Called after a dragging this edge and set self.has_move to False to specify the end of dragging motion
-
restore
()[source] Restore the roughness for this layer.
-
save
(ev)[source] Remember the roughness for this layer and the next so that we can restore on Esc.
-
set_layer
(n)[source] Allow adding plot to the same panel
Parameters: n – the number of layer
-
update
(x=None, y=None)[source] Draw the new roughness on the graph.
Parameters: - x – x-coordinates to reset current class x
- y – y-coordinates to reset current class y
-
-
class
sas.sasgui.guiframe.local_perspectives.plotting.boxSlicer.
VerticalLines
(base, axes, color='black', zorder=5, x=0.5, y=0.5)[source] Bases:
sas.sasgui.guiframe.local_perspectives.plotting.BaseInteractor._BaseInteractor
Select an annulus through a 2D plot
-
clear
()[source] Clear this slicer and its markers
-
move
(x, y, ev)[source] Process move to a new position, making sure that the move is allowed.
-
moveend
(ev)[source] Called after a dragging this edge and set self.has_move to False to specify the end of dragging motion
-
restore
()[source] Restore the roughness for this layer.
-
save
(ev)[source] Remember the roughness for this layer and the next so that we can restore on Esc.
-
set_layer
(n)[source] Allow adding plot to the same panel
Parameters: n – the number of layer
-
update
(x=None, y=None)[source] Draw the new roughness on the graph.
Parameters: - x – x-coordinates to reset current class x
- y – y-coordinates to reset current class y
-
sas.sasgui.guiframe.local_perspectives.plotting.boxSum module
Boxsum Class: determine 2 rectangular area to compute the sum of pixel of a Data.
-
class
sas.sasgui.guiframe.local_perspectives.plotting.boxSum.
BoxSum
(base, axes, color='black', zorder=3, x_min=0.008, x_max=0.008, y_min=0.0025, y_max=0.0025)[source] Bases:
sas.sasgui.guiframe.local_perspectives.plotting.BaseInteractor._BaseInteractor
Boxsum Class: determine 2 rectangular area to compute the sum of pixel of a Data. Uses PointerInteractor , VerticalDoubleLine,HorizontalDoubleLine. @param zorder: Artists with lower zorder values are drawn first. @param x_min: the minimum value of the x coordinate @param x_max: the maximum value of the x coordinate @param y_min: the minimum value of the y coordinate @param y_max: the maximum value of the y coordinate
-
clear
()[source] Clear the slicer and all connected events related to this slicer
-
draw
()[source]
-
freeze_axes
()[source]
-
get_params
()[source] Store a copy of values of parameters of the slicer into a dictionary. :return params: the dictionary created
-
get_result
()[source] return the result of box summation
-
move
(x, y, ev)[source] Process move to a new position, making sure that the move is allowed.
-
moveend
(ev)[source] After a dragging motion this function is called to compute the error and the sum of pixel of a given data 2D
-
restore
()[source] Restore the roughness for this layer.
-
save
(ev)[source] Remember the roughness for this layer and the next so that we can restore on Esc.
-
set_cursor
(x, y)[source]
-
set_layer
(n)[source] Allow adding plot to the same panel :param n: the number of layer
-
set_panel_name
(name)[source] Store the name of the panel associated to this slicer @param name: the name of this panel
-
set_params
(params)[source] Receive a dictionary and reset the slicer with values contained in the values of the dictionary. :param params: a dictionary containing name of slicer parameters and values the user assigned to the slicer.
-
thaw_axes
()[source]
-
update
()[source] Respond to changes in the model by recalculating the profiles and resetting the widgets.
-
-
class
sas.sasgui.guiframe.local_perspectives.plotting.boxSum.
HorizontalDoubleLine
(base, axes, color='black', zorder=5, x=0.5, y=0.5, center_x=0.0, center_y=0.0)[source] Bases:
sas.sasgui.guiframe.local_perspectives.plotting.BaseInteractor._BaseInteractor
Select an annulus through a 2D plot
-
clear
()[source] Clear this figure and its markers
-
move
(x, y, ev)[source] Process move to a new position, making sure that the move is allowed.
-
moveend
(ev)[source] After a dragging motion reset the flag self.has_move to False
-
restore
()[source] Restore the roughness for this layer.
-
save
(ev)[source] Remember the roughness for this layer and the next so that we can restore on Esc.
-
set_cursor
(x, y)[source] Update the figure given x and y
-
set_layer
(n)[source] Allow adding plot to the same panel @param n: the number of layer
-
update
(x1=None, x2=None, y1=None, y2=None, width=None, height=None, center=None)[source] Draw the new roughness on the graph. :param x1: new maximum value of x coordinates :param x2: new minimum value of x coordinates :param y1: new maximum value of y coordinates :param y2: new minimum value of y coordinates :param width: is the width of the new rectangle :param height: is the height of the new rectangle :param center: provided x, y coordinates of the center point
-
-
class
sas.sasgui.guiframe.local_perspectives.plotting.boxSum.
PointInteractor
(base, axes, color='black', zorder=5, center_x=0.0, center_y=0.0)[source] Bases:
sas.sasgui.guiframe.local_perspectives.plotting.BaseInteractor._BaseInteractor
Draw a point that can be dragged with the marker. this class controls the motion the center of the BoxSum
-
clear
()[source] Clear this figure and its markers
-
move
(x, y, ev)[source] Process move to a new position, making sure that the move is allowed.
-
moveend
(ev)[source]
-
restore
()[source] Restore the roughness for this layer.
-
save
(ev)[source] Remember the roughness for this layer and the next so that we can restore on Esc.
-
set_cursor
(x, y)[source]
-
set_layer
(n)[source] Allow adding plot to the same panel @param n: the number of layer
-
update
(center_x=None, center_y=None)[source] Draw the new roughness on the graph.
-
-
class
sas.sasgui.guiframe.local_perspectives.plotting.boxSum.
VerticalDoubleLine
(base, axes, color='black', zorder=5, x=0.5, y=0.5, center_x=0.0, center_y=0.0)[source] Bases:
sas.sasgui.guiframe.local_perspectives.plotting.BaseInteractor._BaseInteractor
Draw 2 vertical lines moving in opposite direction and centered on a point (PointInteractor)
-
clear
()[source] Clear this slicer and its markers
-
move
(x, y, ev)[source] Process move to a new position, making sure that the move is allowed.
-
moveend
(ev)[source] After a dragging motion reset the flag self.has_move to False
-
restore
()[source] Restore the roughness for this layer.
-
save
(ev)[source] Remember the roughness for this layer and the next so that we can restore on Esc.
-
set_cursor
(x, y)[source] Update the figure given x and y
-
set_layer
(n)[source] Allow adding plot to the same panel :param n: the number of layer
-
update
(x1=None, x2=None, y1=None, y2=None, width=None, height=None, center=None)[source] Draw the new roughness on the graph. :param x1: new maximum value of x coordinates :param x2: new minimum value of x coordinates :param y1: new maximum value of y coordinates :param y2: new minimum value of y coordinates :param width: is the width of the new rectangle :param height: is the height of the new rectangle :param center: provided x, y coordinates of the center point
-
sas.sasgui.guiframe.local_perspectives.plotting.detector_dialog module
Widget to display a 2D map of the detector
-
class
sas.sasgui.guiframe.local_perspectives.plotting.detector_dialog.
DetectorDialog
(parent, id=1, base=None, dpi=None, cmap=<matplotlib.colors.LinearSegmentedColormap object at 0x000000000A321748>, reset_zmin_ctl=None, reset_zmax_ctl=None, *args, **kwds)[source] Bases:
wx._windows.Dialog
Dialog box to let the user edit detector settings
-
class
Event
[source] Bases:
object
-
beam
= 0
-
cmap
= None
-
qpax
= 0
-
sym4
= False
-
xnpts
= 0
-
ynpts
= 0
-
zmax
= 0
-
zmin
= 0
-
-
DetectorDialog.
checkValues
(event)[source] Check the valitidity of zmin and zmax value zmax should be a float and zmin less than zmax
-
DetectorDialog.
getContent
()[source] return event containing value to reset the detector of a given data
-
DetectorDialog.
onSetFocus
(event)[source] Highlight the txtcrtl
-
DetectorDialog.
resetValues
(event)[source] reset detector info
-
DetectorDialog.
setContent
(xnpts, ynpts, qmax, beam, zmin=None, zmax=None, sym=False)[source] received value and displayed them
Parameters: - xnpts – the number of point of the x_bins of data
- ynpts – the number of point of the y_bins of data
- qmax – the maxmimum value of data pixel
- beam – the radius of the beam
- zmin – the value to get the minimum color
- zmax – the value to get the maximum color
- sym –
-
class
sas.sasgui.guiframe.local_perspectives.plotting.graphAppearance module
Dialog for general graph appearance
This software was developed by Institut Laue-Langevin as part of Distributed Data Analysis of Neutron Scattering Experiments (DANSE).
Copyright 2012 Institut Laue-Langevin
-
class
sas.sasgui.guiframe.local_perspectives.plotting.graphAppearance.
graphAppearance
(parent, title, legend=True)[source] Bases:
wx._windows.Frame
-
InitUI
()[source]
-
fillLegendLocs
()[source]
-
get_legend_loc
()[source]
-
get_loc_label
()[source] Associates label to a specific legend location
-
get_togglegrid
()[source]
-
get_togglelegend
()[source]
-
get_xcolor
()[source]
-
get_xfont
()[source]
-
get_xlab
()[source]
-
get_xtick_check
()[source]
-
get_xunit
()[source]
-
get_ycolor
()[source]
-
get_yfont
()[source]
-
get_ylab
()[source]
-
get_ytick_check
()[source]
-
get_yunit
()[source]
-
on_cancel
(e)[source]
-
on_ok
(e)[source]
-
on_x_font
(e)[source]
-
on_y_font
(e)[source]
-
setDefaults
(grid, legend, xlab, ylab, xunit, yunit, xaxis_font, yaxis_font, legend_loc, xcolor, ycolor, is_xtick, is_ytick)[source]
-
xfill_colors
()[source]
-
yfill_colors
()[source]
-
sas.sasgui.guiframe.local_perspectives.plotting.masking module
Mask editor
-
class
sas.sasgui.guiframe.local_perspectives.plotting.masking.
CalcPlot
(id=-1, panel=None, image=None, completefn=None, updatefn=None, elapsed=0, yieldtime=0.01, worktime=0.01)[source] Bases:
sas.sascalc.data_util.calcthread.CalcThread
Compute Resolution
-
compute
()[source] excuting computation
-
-
class
sas.sasgui.guiframe.local_perspectives.plotting.masking.
FloatPanel
(parent=None, base=None, data=None, dimension=1, id=139, *args, **kwds)[source] Bases:
wx._windows.Dialog
Provides the Mask Editor GUI.
-
CENTER_PANE
= False
-
ID
= 139
-
OnClose
(event)[source]
-
complete
(panel, image, elapsed=None)[source] Plot image
Parameters: image – newplot [plotpanel]
-
freeze_axes
()[source] freeze axes
-
get_plot
()[source] Get Plot panel
-
set_plot_unfocus
()[source] Not implemented
-
thaw_axes
()[source] thaw axes
-
window_name
= 'Plot'
-
-
class
sas.sasgui.guiframe.local_perspectives.plotting.masking.
MaskPanel
(parent=None, base=None, data=None, id=-1, *args, **kwds)[source] Bases:
wx._windows.Dialog
Provides the Mask Editor GUI.
-
CENTER_PANE
= True
-
OnClose
(event)[source] Processing close event
-
ShowMessage
(msg='')[source] Show error message when mask covers whole data area
-
freeze_axes
()[source] freeze axes
-
onMouseMotion
(event)[source] onMotion event
-
onWheel
(event)[source] on wheel event
-
set_plot_unfocus
()[source] Not implemented
-
thaw_axes
()[source] thaw axes
-
update
(draw=True)[source] Respond to changes in the model by recalculating the profiles and resetting the widgets.
-
window_name
= 'Mask Editor'
-
-
class
sas.sasgui.guiframe.local_perspectives.plotting.masking.
Maskplotpanel
(parent, id=-1, dimension=2, color=None, dpi=None, **kwargs)[source] Bases:
sas.sasgui.plottools.PlotPanel.PlotPanel
PlotPanel for Quick plot and masking plot
-
add_image
(plot)[source] Add Image
-
add_toolbar
()[source] Add toolbar
-
draw
()[source] Draw
-
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] Disables OnPick
-
onWheel
(event)[source]
-
on_set_focus
(event)[source] send to the parenet the current panel on focus
-
-
class
sas.sasgui.guiframe.local_perspectives.plotting.masking.
ViewApp
(redirect=False, filename=None, useBestVisual=False, clearSigInt=True)[source] Bases:
wx._core.App
-
OnInit
()[source]
-
-
class
sas.sasgui.guiframe.local_perspectives.plotting.masking.
ViewerFrame
(parent, id, title)[source] Bases:
wx._windows.Frame
Add comment
sas.sasgui.guiframe.local_perspectives.plotting.plotting module
-
class
sas.sasgui.guiframe.local_perspectives.plotting.plotting.
Plugin
[source] Bases:
sas.sasgui.guiframe.plugin_base.PluginBase
Plug-in class to be instantiated by the GUI manager
-
clear_panel
()[source] Clear and Hide all plot panels, and remove them from menu
-
clear_panel_by_id
(group_id)[source] clear the graph
-
create_1d_panel
(data, group_id)[source]
-
create_2d_panel
(data, group_id)[source]
-
create_panel_helper
(new_panel, data, group_id, title=None)[source]
-
delete_panel
(group_id)[source]
-
get_panels
(parent)[source] Create and return a list of panel objects
-
hide_panel
(group_id)[source] hide panel with group ID = group_id
-
is_always_active
()[source] return True is this plugin is always active even if the user is switching between perspectives
Create a ‘Plot’ menu to list the panels available for displaying
Parameters: - id – next available unique ID for wx events
- parent – parent window
-
remove_plot
(group_id, id)[source] remove plot of ID = id from a panel of group ID =group_id
-
set_panel_on_focus
(panel)[source]
-
update_panel
(data, panel)[source] update the graph of a given panel
-
sas.sasgui.guiframe.local_perspectives.plotting.profile_dialog module
SLD Profile Dialog for multifunctional models
-
class
sas.sasgui.guiframe.local_perspectives.plotting.profile_dialog.
SLDPanel
(parent=None, base=None, data=None, axes=['Radius'], id=-1, *args, **kwds)[source] Bases:
wx._windows.Dialog
Provides the SLD profile plot panel.
-
CENTER_PANE
= True
Disable menu bar
When the context menu of a plot is rendered, the get_context_menu method will be called to give you a chance to add a menu item to the context menu. :param graph: the Graph object to which we attach the context menu
Returns: a list of menu items with call-back function
-
set_plot_unfocus
()[source] Set_plot unfocus
-
set_schedule
(schedule=False)[source] Set schedule for redraw
-
set_schedule_full_draw
(panel=None, func=None)[source] Set_schedule for full draw
-
show_data1d
(data, name)[source] Show data dialog
-
window_name
= 'Scattering Length Density Profile'
-
-
class
sas.sasgui.guiframe.local_perspectives.plotting.profile_dialog.
SLDplotpanel
(parent, axes=[], id=-1, color=None, dpi=None, **kwargs)[source] Bases:
sas.sasgui.guiframe.local_perspectives.plotting.Plotter1D.ModelPanel1D
-
add_image
(plot)[source] Add image(Theory1D)
-
onChangeCaption
(event)[source] Not implemented
-
on_kill_focus
(event)[source] reset the panel color
-
on_set_focus
(event)[source] send to the parenet the current panel on focus
-
-
class
sas.sasgui.guiframe.local_perspectives.plotting.profile_dialog.
ViewApp
(redirect=False, filename=None, useBestVisual=False, clearSigInt=True)[source] Bases:
wx._core.App
-
OnInit
()[source]
-
-
class
sas.sasgui.guiframe.local_perspectives.plotting.profile_dialog.
ViewerFrame
(parent, id, title)[source] Bases:
wx._windows.Frame
Add comment
sas.sasgui.guiframe.local_perspectives.plotting.sector_mask module
Sector mask interactor
-
class
sas.sasgui.guiframe.local_perspectives.plotting.sector_mask.
SectorMask
(base, axes, color='gray', zorder=3, side=False)[source] Bases:
sas.sasgui.guiframe.local_perspectives.plotting.BaseInteractor._BaseInteractor
Draw a sector slicer.Allow to find the data 2D inside of the sector lines
-
clear
()[source] Clear the slicer and all connected events related to this slicer
-
draw
()[source]
-
freeze_axes
()[source]
-
get_params
()[source] Store a copy of values of parameters of the slicer into a dictionary.
Return params: the dictionary created
-
move
(x, y, ev)[source] Process move to a new position, making sure that the move is allowed.
-
moveend
(ev)[source] Called a dragging motion ends.Get slicer event
-
restore
()[source] Restore the roughness for this layer.
-
save
(ev)[source] Remember the roughness for this layer and the next so that we can restore on Esc.
-
set_cursor
(x, y)[source]
-
set_params
(params)[source] Receive a dictionary and reset the slicer with values contained in the values of the dictionary.
Parameters: params – a dictionary containing name of slicer parameters and values the user assigned to the slicer.
-
thaw_axes
()[source]
-
update
()[source] Respond to changes in the model by recalculating the profiles and resetting the widgets.
-
sas.sasgui.guiframe.local_perspectives.plotting.slicerpanel module
-
class
sas.sasgui.guiframe.local_perspectives.plotting.slicerpanel.
SlicerPanel
(parent, id=-1, type=None, base=None, params=None, *args, **kwargs)[source] Bases:
wx._windows.Panel
,sas.sasgui.guiframe.panel_base.PanelBase
Panel class to show the slicer parameters
-
CENTER_PANE
= False
-
onEVT_SLICER
(event)[source] Process EVT_SLICER events When the slicer changes, update the panel
Parameters: event – EVT_SLICER event
-
onParamChange
(evt)[source] Receive and event and reset the text field contained in self.parameters
-
onSetFocus
(evt)[source] Highlight the txtcrtl
-
onTextEnter
(evt)[source] Parameters have changed
-
on_close
(event)[source] On Close Event
-
set_slicer
(type, params)[source] Rebuild the panel
-
window_name
= 'Slicer panel'
-