GuiSAXS Module
project : pySAXS
description : wxPython Class to plot some data files to gnuplot
authors : Antoine Thill, Olivier Spalla, Olivier Tache, Debasis Sen
Last changes :
10-11-2009 OT : Replaced LsScattering by GuiSAXS.py
15-06-2009 OT : little changes for new models, replace with by with_ for gnuplot commands
change gnuplot plotting commands
- 05-06-2007 OT : big changes everywhere !
- add data management, no more reference to usaxs data directly
16-03-2007 OT : send loglog commands directly to gnuplot
13-03-2007 OT : add a SAXS and USAXS menu
add a HELP (about and licence dialog box) menu
-
class pySAXS.guisaxs.GuiSAXS.GuiSAXS(parent, title)[source]
Bases: wx._windows.Frame
-
DataSaveAsTXT(filename)[source]
save the checked datas
-
ImportData(datafilename, lineskip=0, delimiter='t', usecols=None, type=None, name=None)[source]
extract data from file
-
ListOfDatasChecked()[source]
check if there are data checked
return list of dataset checked
-
OnAbout(event)[source]
-
OnAddReferenceValue(event)[source]
user want to add a reference value
-
OnChangeColors(event)[source]
-
OnCheckData(event)[source]
-
OnClickData(event)[source]
what’s happen when the user select a dataset
-
OnClipqRange(child)[source]
-
OnClipqRangeShow(event)[source]
-
OnCloseWindow(event)[source]
-
OnConcatenate()[source]
user click on apply
-
OnConcatenateCancel(datasetname)[source]
-
OnConcatenateShow(event)[source]
user want to concatenate different dataset
-
OnDClickData(event)[source]
user doucle click on data : open what ?
-
OnDataAppend(event)[source]
-
OnDataLoad(event)[source]
Load datas
-
OnDataOpenDataset(event)[source]
open the data set
-
OnDataReset(event)[source]
-
OnDataSave(event)[source]
save the checked datas
-
OnDataSaveDataset(event)[source]
save all the data set
-
OnDerivate(event)[source]
user want to derivate dataset
-
OnDocClick(event)[source]
start the default application for the doc file
-
OnEvalCalcul(formula, variableDict, newdatasetname, listofdata)[source]
feedback from evaluator dialog box
#formula=”i1+i0+i2”
#variableDict={‘i0’:’data1’,’i1’:’data2’,...}
#listofdata=[‘data1’,data2’...]
-
OnEvalCalculate(formula, variableDict, newdatasetname, listofdata)[source]
feedback from evaluator dialog box
#formula=”i1+i0+i2”
#variableDict={‘i0’:’data1’,’i1’:’data2’,...}
#listofdata=[‘data1’,data2’...]
-
OnEvalShow(event)[source]
-
OnFileSaveModel(event)[source]
-
OnGenerateNoise(event)[source]
user want generate a noise from the data
-
OnGridOff(event)[source]
-
OnGridOn(event)[source]
-
OnInterpolate(newdataset, olddataset, new_qrange)[source]
do the interpolation with the new qrange
-
OnInterpolateShow(event)[source]
user click on Interpolate
-
OnInvariant(event)[source]
user click on invariant
-
OnLicence(event)[source]
-
OnLogPlotType(event)[source]
-
OnModelFit(child)[source]
when user click on fit on the model child dialog box
-
OnModelFitBounds(child)[source]
when user click on fit on the model child dialog box
-
OnModelInfo(event)[source]
-
OnModelPlot(event)[source]
if self.ISMODEL==True:
self.gp(‘set title ‘ ‘+str(self.M.IntensityFunc).split(‘ ‘)[1]+’ ‘ ‘)
GD=Gnuplot.Data(self.M.q,self.M.GetIntensity()*(self.M.q**self.plotexp),with=’l lt 2’)
self.gp.replot(GD)
-
OnModelQRange(event)[source]
-
OnModelReset(event)[source]
-
OnModelSelect(event)[source]
user click on model
-
OnModelUpdate(child)[source]
when the user update from the Model
duplicate a data set
refresh data from file (is exist)
remove a data set
rename a data set
-
OnPorodPlotType(event)[source]
-
OnQuickPlot(event)[source]
-
OnReinitGnulot(event)[source]
reinit gnuplot instance
-
OnResetSelectqRange(event)[source]
-
OnResolution(event)[source]
-
OnSAXSSubstraction(event)[source]
User click on SAXS substraction
-
OnSAXSSubstractionApply(event, selectedData, parameters)[source]
-
OnScaleQ(event)[source]
user want to scale q with a formula
-
OnScalingSAXSApply(applyQ, applyI, dataname, backgdname)[source]
child dialog box ask to apply parameters
-
OnScalingSAXSDlgLoad(event)[source]
The user click on “load parameters”
-
OnScalingSAXSDlgShow(event)[source]
The user click on “Scale Saxs Datas”
-
OnSelectAll(event)[source]
when the user want to select all
-
OnSelectqRange(qmin, qmax, imin, imax)[source]
-
OnSelectqRangeShow(event)[source]
change scale
-
OnSendCommandToPlot(event)[source]
show popup menu
-
OnSize(evt)[source]
-
OnSmooth(event)[source]
user want to smooth dataset
-
OnStatInformations(event)[source]
user want statistical information
-
OnSuperModelSelect(event)[source]
user call SUPER Model
-
OnToolsContraste(event)[source]
-
OnToolsContrasteNeutron(event)[source]
-
OnUSAXSDeconvolution(event)[source]
The user click on “USAXS - Deconvolution”
-
OnUSAXSTransmission(event, selectedData, parameters)[source]
do the tramsission correction after dialog box LSTransmissionDlg
-
OnUSAXSTransmissionDlgShow(event)[source]
The user click on “USAXS - Data correction”
-
OnUSAXSsimu(event)[source]
-
OnUSAXSsimuDlgShow(event)[source]
-
OnUSAXSsimuPlot(event)[source]
-
OnUSAXSsimuReset(event)[source]
-
OnUnSelectAll(event)[source]
when the user want to select all
-
OpenModel(M, index=-1, name='', pos=wx.Point(50, 50))[source]
open the model dialog box
-
RePlot(event=None)[source]
-
ReadFile(datafilename, file_type=None)[source]
read file depending of type of file
-
checkPlotData(name)[source]
check if we plot data
-
cleanString(s)[source]
Removes all accents from the string
-
createWxPlot()[source]
-
data_dict = None
-
findPeaks(events)[source]
find peaks
-
getListOfDocs()[source]
-
get_color(n)[source]
return a color name from the list of colors
if n> length of list of colors, return at the beginning
-
giveMeANewName()[source]
return a new name for a data set
-
printTXT(txt='', par='')[source]
print on comment ctrl
-
qmod = None
self.gp=Gnuplot.Gnuplot()
self.gp.reset()
-
redrawTheList()[source]
redraw the listbox
-
removeNonOrdinalChar(s)[source]
-
replotWxPlot()[source]
plot the wx frame
-
sortDictByKey(d)[source]
return list of couple sorted by key
LSSelectxyRangeDlg Module
project : pySAXS
description : wxPython Class to plot some data files to gnuplot
authors : Antoine Thill, Olivier Spalla, Olivier Tache’, Debasis Sen
Last changes :
16-03-2007 OT : add autoscale buttons, send replot command directly to gnuplot
-
class pySAXS.guisaxs.LSSelectxyRangeDlg.LSSelectqRangeDlg(parent, qmin, qmax, imin, imax)[source]
Bases: wx._windows.Frame
-
TextUpdate(event)[source]
-
on_QuitButton_Click(event)[source]
-
on_iAutoButton_Click(event)[source]
-
on_qAutoButton_Click(event)[source]
textView Module
project : pySAXS
description : function to print a message from a txt file to a dialog box
authors : Olivier Tache
Last changes :
24-07-2012 OT
13-03-2007 OT
-
pySAXS.guisaxs.textView.ViewMessage(file, title='test')[source]
wxmpl Module
Embedding matplotlib in wxPython applications is straightforward, but the
default plotting widget lacks the capabilities necessary for interactive use.
WxMpl (wxPython+matplotlib) is a library of components that provide these
missing features in the form of a better matplolib FigureCanvas.
-
class pySAXS.guisaxs.wxmpl.PlotPanel(parent, id, size=(6.0, 3.7), dpi=96, cursor=True, location=True, crosshairs=True, selection=True, zoom=True, autoscaleUnzoom=True)[source]
Bases: matplotlib.backends.backend_wxagg.FigureCanvasWxAgg
A matplotlib canvas suitable for embedding in wxPython applications.
-
OnActivate(evt)[source]
Handles the wxPython window activation event.
-
OnDestroy(evt)[source]
Handles the wxPython window destruction event.
-
OnEraseBackground(evt)[source]
Overrides the wxPython backround repainting event to reduce flicker.
-
draw(**kwds)[source]
Draw the associated C{Figure} onto the screen.
-
get_figure()[source]
Returns the figure associated with this canvas.
-
notify_point(axes, x, y)[source]
Called by the associated C{PlotPanelDirector} to emit a C{PointEvent}.
-
notify_selection(axes, x1, y1, x2, y2)[source]
Called by the associated C{PlotPanelDirector} to emit a
C{SelectionEvent}.
-
set_autoscale_unzoom(state)[source]
Enable or disable automatic view rescaling when the user zooms out to
the initial figure.
-
set_crosshairs(state)[source]
Enable or disable drawing crosshairs through the mouse cursor when it
is inside a matplotlib axes.
-
set_cursor(state)[source]
Enable or disable the changing mouse cursor. When enabled, the cursor
changes from the normal arrow to a square cross when the mouse enters a
matplotlib axes on this canvas.
-
set_location(state)[source]
Enable or disable the display of the matplotlib axes coordinates of the
mouse in the lower left corner of the canvas.
-
set_selection(state)[source]
Enable or disable area selections, where user selects a rectangular
area of the canvas by left-clicking and dragging the mouse.
-
set_zoom(state)[source]
Enable or disable zooming in when the user makes an area selection and
zooming out again when the user right-clicks.
-
zoomed(axes)[source]
Returns a boolean indicating whether or not the C{axes} is zoomed in.
-
class pySAXS.guisaxs.wxmpl.PlotFrame(parent, id, title, size=(6.0, 3.7), dpi=96, cursor=True, location=True, crosshairs=True, selection=True, zoom=True, autoscaleUnzoom=True, **kwds)[source]
Bases: wx._windows.Frame
A matplotlib canvas embedded in a wxPython top-level window.
@cvar ABOUT_TITLE: Title of the “About” dialog.
@cvar ABOUT_MESSAGE: Contents of the “About” dialog.
-
ABOUT_MESSAGE = 'wxmpl.PlotFrame 2.0dev\nWritten by Ken McIvor <mcivor@iit.edu>\nCopyright 2005-2009 Illinois Institute of Technology'
-
ABOUT_TITLE = 'About wxmpl.PlotFrame'
Handles File->Close menu events.
Handles File->Page Setup menu events
Handles File->Print menu events
Handles File->Print Preview menu events
Handles File->Save menu events.
Handles Help->About menu events.
-
draw()[source]
Draw the associated C{Figure} onto the screen.
-
get_figure()[source]
Returns the figure associated with this canvas.
-
set_autoscale_unzoom(state)[source]
Enable or disable automatic view rescaling when the user zooms out to
the initial figure.
-
set_crosshairs(state)[source]
Enable or disable drawing crosshairs through the mouse cursor when it
is inside a matplotlib axes.
-
set_cursor(state)[source]
Enable or disable the changing mouse cursor. When enabled, the cursor
changes from the normal arrow to a square cross when the mouse enters a
matplotlib axes on this canvas.
-
set_location(state)[source]
Enable or disable the display of the matplotlib axes coordinates of the
mouse in the lower left corner of the canvas.
-
set_selection(state)[source]
Enable or disable area selections, where user selects a rectangular
area of the canvas by left-clicking and dragging the mouse.
-
set_zoom(state)[source]
Enable or disable zooming in when the user makes an area selection and
zooming out again when the user right-clicks.
-
class pySAXS.guisaxs.wxmpl.PlotApp(title='WxMpl', size=(6.0, 3.7), dpi=96, cursor=True, location=True, crosshairs=True, selection=True, zoom=True, **kwds)[source]
Bases: wx._core.App
A wxApp that provides a matplotlib canvas embedded in a wxPython top-level
window, encapsulating wxPython’s nuts and bolts.
@cvar ABOUT_TITLE: Title of the “About” dialog.
@cvar ABOUT_MESSAGE: Contents of the “About” dialog.
-
ABOUT_MESSAGE = None
-
ABOUT_TITLE = None
-
OnInit()[source]
-
draw()[source]
Draw the associated C{Figure} onto the screen.
-
get_figure()[source]
Returns the figure associated with this canvas.
-
set_crosshairs(state)[source]
Enable or disable drawing crosshairs through the mouse cursor when it
is inside a matplotlib axes.
-
set_cursor(state)[source]
Enable or disable the changing mouse cursor. When enabled, the cursor
changes from the normal arrow to a square cross when the mouse enters a
matplotlib axes on this canvas.
-
set_location(state)[source]
Enable or disable the display of the matplotlib axes coordinates of the
mouse in the lower left corner of the canvas.
-
set_selection(state)[source]
Enable or disable area selections, where user selects a rectangular
area of the canvas by left-clicking and dragging the mouse.
-
set_zoom(state)[source]
Enable or disable zooming in when the user makes an area selection and
zooming out again when the user right-clicks.
-
class pySAXS.guisaxs.wxmpl.StripCharter(axes)[source]
Plots and updates lines on a matplotlib C{Axes}.
-
setChannels(channels)[source]
Specify the data-providers of the lines to be plotted and updated.
-
update()[source]
Redraw the associated axes with updated lines if any of the channels’
data has changed.
-
class pySAXS.guisaxs.wxmpl.Channel(name, color=None, style=None, marker=None)[source]
Provides data for a C{StripCharter} to plot. Subclasses of C{Channel}
override the template methods C{getX()} and C{getY()} to provide plot data
and call C{setChanged(True)} when that data has changed.
-
getColor()[source]
Returns the line color string to use when the line is plotted, or
C{None} to use an automatically generated color.
-
getLabel()[source]
Returns the matplotlib label for this channel of data.
-
getMarker()[source]
Returns the line marker string to use when the line is plotted, or
C{None} to use the default line marker.
-
getStyle()[source]
Returns the line style string to use when the line is plotted, or
C{None} to use the default line style.
-
getX()[source]
Template method that returns the vector of X axis data or C{None} if
there is no data available.
-
getY()[source]
Template method that returns the vector of Y axis data or C{None} if
there is no data available.
-
hasChanged()[source]
Returns a boolean indicating if the line data has changed.
-
setChanged(changed)[source]
Sets the change indicator to the boolean value C{changed}.
@note: C{StripCharter} instances call this method after detecting a
change, so a C{Channel} cannot be shared among multiple charts.
-
class pySAXS.guisaxs.wxmpl.FigurePrinter(view, printData=None)[source]
Provides a simplified interface to the wxPython printing framework that’s
designed for printing matplotlib figures.
-
getPrintData()[source]
Return the current printer settings in their C{wx.PrintData} object.
-
pageSetup()[source]
-
previewFigure(figure, title=None)[source]
Open a “Print Preview” window for the matplotlib chart C{figure}. The
keyword argument C{title} provides the printing framework with a title
for the print job.
-
printFigure(figure, title=None)[source]
Open a “Print” dialog to print the matplotlib chart C{figure}. The
keyword argument C{title} provides the printing framework with a title
for the print job.
-
setPrintData(printData)[source]
Use the printer settings in C{printData}.
-
class pySAXS.guisaxs.wxmpl.PointEvent(id, axes, x, y)[source]
Bases: wx._core.PyCommandEvent
wxPython event emitted when a left-click-release occurs in a matplotlib
axes of a window without an area selection.
@cvar axes: matplotlib C{Axes} which was left-clicked
@cvar x: matplotlib X coordinate
@cvar y: matplotlib Y coordinate
@cvar xdata: axes X coordinate
@cvar ydata: axes Y coordinate
-
Clone()[source]
-
pySAXS.guisaxs.wxmpl.EVT_POINT(win, id, func)[source]
Register to receive wxPython C{PointEvent}s from a C{PlotPanel} or
C{PlotFrame}.
-
class pySAXS.guisaxs.wxmpl.SelectionEvent(id, axes, x1, y1, x2, y2)[source]
Bases: wx._core.PyCommandEvent
wxPython event emitted when an area selection occurs in a matplotlib axes
of a window for which zooming has been disabled. The selection is
described by a rectangle from C{(x1, y1)} to C{(x2, y2)}, of which only
one point is required to be inside the axes.
@cvar axes: matplotlib C{Axes} which was left-clicked
@cvar x1: matplotlib x1 coordinate
@cvar y1: matplotlib y1 coordinate
@cvar x2: matplotlib x2 coordinate
@cvar y2: matplotlib y2 coordinate
@cvar x1data: axes x1 coordinate
@cvar y1data: axes y1 coordinate
@cvar x2data: axes x2 coordinate
@cvar y2data: axes y2 coordinate
-
Clone()[source]
-
pySAXS.guisaxs.wxmpl.EVT_SELECTION(win, id, func)[source]
Register to receive wxPython C{SelectionEvent}s from a C{PlotPanel} or
C{PlotFrame}.