# sas.qtgui.Plotting.Slicers package

## sas.qtgui.Plotting.Slicers.AnnulusSlicer module

class sas.qtgui.Plotting.Slicers.AnnulusSlicer.AnnulusInteractor(base, axes, item=None, color='black', zorder=3)[source]

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]
getParams()[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. Redraw the plot with new parameters.

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.

setParams(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.
set_cursor(x, y)[source]
set_layer(n)[source]

Allow adding plot to the same panel :param n: the number of layer

update()[source]

Respond to changes in the model by recalculating the profiles and resetting the widgets.

validate(param_name, param_value)[source]

Test the proposed new value “value” for row “row” of parameters

class sas.qtgui.Plotting.Slicers.AnnulusSlicer.RingInteractor(base, axes, color='black', zorder=5, r=1.0, sign=1)[source]

Draw a ring Given a radius

clear()[source]

Clear the slicer and all connected events related to this slicer

getParams()[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.

setParams(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.
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
update()[source]

Draw the new roughness on the graph.

## sas.qtgui.Plotting.Slicers.Arc module

Arc slicer for 2D data

class sas.qtgui.Plotting.Slicers.Arc.ArcInteractor(base, axes, color='black', zorder=5, r=1.0, theta1=0.39269908169872414, theta2=0.7853981633974483)[source]

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.qtgui.Plotting.Slicers.AzimutSlicer module

class sas.qtgui.Plotting.Slicers.AzimutSlicer.SectorInteractor(base, axes, color='black', zorder=3)[source]

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.

validate(param_name, param_value)[source]

Test the proposed new value “value” for row “row” of parameters

class sas.qtgui.Plotting.Slicers.AzimutSlicer.SectorInteractorPhi(base, axes, color='black', zorder=3)[source]
class sas.qtgui.Plotting.Slicers.AzimutSlicer.SectorInteractorQ(base, axes, color='black', zorder=3)[source]

## sas.qtgui.Plotting.Slicers.BaseInteractor module

class sas.qtgui.Plotting.Slicers.BaseInteractor.BaseInteractor(base, axes, color='black')[source]

Bases: object

Share some functions between the interface interactor and various layer interactors.

Individual interactors need the following functions:

save(ev) - save the current state for later restore restore() - restore the old state move(x,y,ev) - move the interactor to position x,y moveend(ev) - end the drag event update() - draw the interactors

The following are provided by the base class:

connect_markers(markers) - register callbacks for all markers clear_markers() - remove all items in self.markers onHilite(ev) - enter/leave event processing onLeave(ev) - enter/leave event processing onClick(ev) - mouse click: calls save() onRelease(ev) - mouse click ends: calls moveend() onDrag(ev) - mouse move: calls move() or restore() onKey(ev) - keyboard move: calls move() or restore()

Interactor attributes:

base - model we are operating on axes - axes holding the interactor color - color of the interactor in non-active state markers - list of handles for the interactor
clear_markers()[source]

Clear old markers and interfaces.

connect_markers(markers)[source]

Connect markers to callbacks

dpixel(x, y, nudge=False)[source]

Return the step size in data coordinates for a small step in screen coordinates. If nudge is False (default) the step size is one pixel. If nudge is True, the step size is 0.2 pixels.

move(x, y, ev)[source]
moveend(ev)[source]
onClick(ev)[source]

Prepare to move the artist. Calls save() to preserve the state for later restore().

onDrag(ev)[source]

Move the artist. Calls move() to update the state, or restore() if the mouse leaves the window.

onHilite(ev)[source]

Hilite the artist reporting the event, indicating that it is ready to receive a click.

onKey(ev)[source]

Respond to keyboard events. Arrow keys move the widget. Escape restores it to the position before the last click.

Calls move() to update the state. Calls restore() on escape.

onLeave(ev)[source]

Restore the artist to the original colour when the cursor leaves.

onRelease(ev)[source]
restore(ev)[source]
save(ev)[source]

## sas.qtgui.Plotting.Slicers.BoxSlicer module

class sas.qtgui.Plotting.Slicers.BoxSlicer.BoxInteractor(base, axes, item=None, color='black', zorder=3)[source]

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]
getParams()[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.

setParams(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.
set_cursor(x, y)[source]
set_layer(n)[source]

Allow adding plot to the same panel

Parameters: n – the number of layer
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.qtgui.Plotting.Slicers.BoxSlicer.BoxInteractorX(base, axes, item=None, color='black', zorder=3)[source]

Average in Qx direction

validate(param_name, param_value)[source]

Validate input from user. Values get checked at apply time.

class sas.qtgui.Plotting.Slicers.BoxSlicer.BoxInteractorY(base, axes, item=None, color='black', zorder=3)[source]

Average in Qy direction

validate(param_name, param_value)[source]

Validate input from user Values get checked at apply time.

class sas.qtgui.Plotting.Slicers.BoxSlicer.HorizontalLines(base, axes, color='black', zorder=5, x=0.5, y=0.5)[source]

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.qtgui.Plotting.Slicers.BoxSlicer.VerticalLines(base, axes, color='black', zorder=5, x=0.5, y=0.5)[source]

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
validate(param_name, param_value)[source]

Validate input from user

## sas.qtgui.Plotting.Slicers.BoxSum module

Boxsum Class: determine 2 rectangular area to compute the sum of pixel of a Data.

class sas.qtgui.Plotting.Slicers.BoxSum.BoxSumCalculator(base, axes, color='black', zorder=3)[source]

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]

Redraw canvas

getParams()[source]

Store a copy of values of parameters of the slicer into a dictionary. :return params: the dictionary created

getResult()[source]

Return the result of box summation

model()[source]

model accessor

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

postData()[source]

Get the limits of the boxsum and compute the sum of the pixel contained in that region and the error on that sum

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.

setLayer(n)[source]

Allow adding plot to the same panel :param n: the number of layer

setModelFromParams()[source]

Set up the Qt model for data handling between controls

setPanelName(name)[source]

Store the name of the panel associated to this slicer @param name: the name of this panel

setParams(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.

setParamsFromModel()[source]

Cast model content onto params dict

setReadOnlyParametersFromModel()[source]

Cast model content onto “read-only” subset of parameters

update()[source]

Respond to changes in the model by recalculating the profiles and resetting the widgets.

validate(param_name, param_value)[source]

Validate input from user

class sas.qtgui.Plotting.Slicers.BoxSum.HorizontalDoubleLine(base, axes, color='black', zorder=5, x=0.5, y=0.5, center_x=0.0, center_y=0.0)[source]

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.

setCursor(x, y)[source]

Update the figure given x and y

setLayer(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.qtgui.Plotting.Slicers.BoxSum.PointInteractor(base, axes, color='black', zorder=5, center_x=0.0, center_y=0.0)[source]

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.

setCursor(x, y)[source]
setLayer(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.qtgui.Plotting.Slicers.BoxSum.VerticalDoubleLine(base, axes, color='black', zorder=5, x=0.5, y=0.5, center_x=0.0, center_y=0.0)[source]

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.

setCursor(x, y)[source]

Update the figure given x and y

setLayer(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.qtgui.Plotting.Slicers.RadiusInteractor module

class sas.qtgui.Plotting.Slicers.RadiusInteractor.RadiusInteractor(base, axes, color='black', zorder=5, arc1=None, arc2=None, theta=0.39269908169872414)[source]

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.qtgui.Plotting.Slicers.SectorSlicer module

Sector interactor

class sas.qtgui.Plotting.Slicers.SectorSlicer.LineInteractor(base, axes, color='black', zorder=5, r=1.0, theta=0.7853981633974483)[source]

Select an annulus through a 2D plot

clear()[source]
getParams()[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.

setParams(params)[source]
set_cursor(x, y)[source]
set_layer(n)[source]
update(theta=None)[source]

Draw the new roughness on the graph.

class sas.qtgui.Plotting.Slicers.SectorSlicer.SectorInteractor(base, axes, item=None, color='black', zorder=3)[source]

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]

Redraw canvas

getParams()[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.

setParams(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.
set_cursor(x, y)[source]
set_layer(n)[source]

Allow adding plot to the same panel

Parameters: n – the number of layer
update()[source]

Respond to changes in the model by recalculating the profiles and resetting the widgets.

validate(param_name, param_value)[source]

Test the proposed new value “value” for row “row” of parameters

class sas.qtgui.Plotting.Slicers.SectorSlicer.SideInteractor(base, axes, color='black', zorder=5, r=1.0, phi=0.7853981633974483, theta2=1.0471975511965976)[source]

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

getParams()[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.

setParams(params)[source]
set_cursor(x, y)[source]
set_layer(n)[source]

Allow adding plot to the same panel

Parameters: n – the number of layer
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