guisaxs Package — pySAXS 77.September2012 documentation

### Navigation

- index
- modules |
- next |
- previous |
- pySAXS 77.September2012 documentation »
- pySAXS »
- pySAXS Package »

# guisaxs Package

## `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)

  Bases: `wx._windows.Frame`

  `DataSaveAsTXT`(filename)

    save the checked datas

  `ImportData`(datafilename, lineskip=0, delimiter='t', usecols=None, type=None, name=None)

    extract data from file

  `ListOfDatasChecked`()

    check if there are data checked return list of dataset checked

  `OnAbout`(event)
  `OnAddReferenceValue`(event)

    user want to add a reference value

  `OnChange`(evant)
  `OnChangeColors`(event)
  `OnCheckData`(event)
  `OnClickData`(event)

    what’s happen when the user select a dataset

  `OnClipqRange`(child)
  `OnClipqRangeShow`(event)
  `OnCloseWindow`(event)
  `OnConcatenate`()

    user click on apply

  `OnConcatenateCancel`(datasetname)
  `OnConcatenateShow`(event)

    user want to concatenate different dataset

  `OnDClickData`(event)

    user doucle click on data : open what ?

  `OnDataAppend`(event)
  `OnDataLoad`(event)

    Load datas

  `OnDataOpenDataset`(event)

    open the data set

  `OnDataReset`(event)
  `OnDataSave`(event)

    save the checked datas

  `OnDataSaveDataset`(event)

    save all the data set

  `OnDerivate`(event)

    user want to derivate dataset

  `OnDocClick`(event)

    start the default application for the doc file

  `OnEvalCalcul`(formula, variableDict, newdatasetname, listofdata)

    feedback from evaluator dialog box #formula=”i1+i0+i2” #variableDict={‘i0’:’data1’,’i1’:’data2’,...} #listofdata=[‘data1’,data2’...]

  `OnEvalCalculate`(formula, variableDict, newdatasetname, listofdata)

    feedback from evaluator dialog box #formula=”i1+i0+i2” #variableDict={‘i0’:’data1’,’i1’:’data2’,...} #listofdata=[‘data1’,data2’...]

  `OnEvalShow`(event)
  `OnFileSaveModel`(event)
  `OnGenerateNoise`(event)

    user want generate a noise from the data

  `OnGridOff`(event)
  `OnGridOn`(event)
  `OnInterpolate`(newdataset, olddataset, new_qrange)

    do the interpolation with the new qrange

  `OnInterpolateShow`(event)

    user click on Interpolate

  `OnInvariant`(event)

    user click on invariant

  `OnLicence`(event)
  `OnLogPlotType`(event)
  `OnModelFit`(child)

    when user click on fit on the model child dialog box

  `OnModelFitBounds`(child)

    when user click on fit on the model child dialog box

  `OnModelInfo`(event)
  `OnModelPlot`(event)

    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)
  `OnModelReset`(event)
  `OnModelSelect`(event)

    user click on model

  `OnModelUpdate`(child)

    when the user update from the Model

  `OnPopUpDuplicate`(event)

    duplicate a data set

  `OnPopUpDuplicateWithoutLink`(event)
  `OnPopUpModifyModel`(event)
  `OnPopUpRefresh`(event)

    refresh data from file (is exist)

  `OnPopUpRemove`(event)

    remove a data set

  `OnPopUpRename`(event)

    rename a data set

  `OnPorodPlotType`(event)
  `OnReinitGnulot`(event)

    reinit gnuplot instance

  `OnResetSelectqRange`(event)
  `OnResolution`(event)
  `OnSAXSSubstraction`(event)

    User click on SAXS substraction

  `OnSAXSSubstractionApply`(event, selectedData, parameters)
  `OnScaleQ`(event)

    user want to scale q with a formula

  `OnScalingSAXSApply`(applyQ, applyI, dataname, backgdname)

    child dialog box ask to apply parameters

  `OnScalingSAXSDlgLoad`(event)

    The user click on “load parameters”

  `OnScalingSAXSDlgShow`(event)

    The user click on “Scale Saxs Datas”

  `OnSelectAll`(event)

    when the user want to select all

  `OnSelectqRange`(qmin, qmax, imin, imax)
  `OnSelectqRangeShow`(event)

    change scale

  `OnSendCommandToPlot`(event)
  `OnShowPopup`(event)

    show popup menu

  `OnSize`(evt)
  `OnSmooth`(event)

    user want to smooth dataset

  `OnStatInformations`(event)

    user want statistical information

  `OnSuperModelSelect`(event)

    user call SUPER Model

  `OnToolsContraste`(event)
  `OnToolsContrasteNeutron`(event)
  `OnToolsContrasteXRL`(event)
  `OnUSAXSDeconvolution`(event)

    The user click on “USAXS - Deconvolution”

  `OnUSAXSTransmission`(event, selectedData, parameters)

    do the tramsission correction after dialog box LSTransmissionDlg

  `OnUSAXSTransmissionDlgShow`(event)

    The user click on “USAXS - Data correction”

  `OnUSAXSsimu`(event)
  `OnUSAXSsimuDlgShow`(event)
  `OnUSAXSsimuPlot`(event)
  `OnUSAXSsimuReset`(event)
  `OnUnSelectAll`(event)

    when the user want to select all

  `OpenModel`(M, index=-1, name='', pos=wx.Point(50, 50))

    open the model dialog box

  `RePlot`(event=None)
  `ReadFile`(datafilename, file_type=None)

    read file depending of type of file

  `checkPlotData`(name)

    check if we plot data

  `cleanString`(s)

    Removes all accents from the string

  `createWxPlot`()
  `data_dict` = None
  `findPeaks`(events)

    find peaks

  `getListOfDocs`()
  `get_color`(n)

    return a color name from the list of colors if n> length of list of colors, return at the beginning

  `giveMeANewName`()

    return a new name for a data set

  `printTXT`(txt='', par='')

    print on comment ctrl

  `qmod` = None

    self.gp=Gnuplot.Gnuplot() self.gp.reset()

  `redrawTheList`()

    redraw the listbox

  `removeNonOrdinalChar`(s)
  `replotWxPlot`()

    plot the wx frame

  `sortDictByKey`(d)

    return list of couple sorted by key

## `LSAbsorptionDlg` Module

class `pySAXS.guisaxs.LSAbsorptionDlg.` `AbsorptionForm`(parent, set_dir=None)

  Bases: `wx._windows.Frame`

  `CheckBoxUpdate`(event)
  `DensityUpdate`(event)
  `OnAddClick`(event)
  `OnClick`(event)
  `OnExitClick`(event)
  `OnRemoveAllClick`(event)
  `OnRemoveClick`(event)
  `OnResetClick`(event)
  `ThicknessUpdate`(event)
  `UpdateFormula`()
  `sliderUpdate`(event)

## `LSAbsorptionXRL` Module

class `pySAXS.guisaxs.LSAbsorptionXRL.` `AbsorptionForm`(parent, set_dir=None, printout=None)

  Bases: `wx._windows.Frame`

  `LambdaLabel` = None
    self.NRJslider=wx.Slider(self,104,8030,1000,50000,
      wx.Point(20,20),wx.Size(200,15),wx.SL_HORIZONTAL|wx.SL_AUTOTICKS)

    self.NRJslider.SetTickFreq(5000,1)

    self.Bind(wx.EVT_SLIDER, self.sliderUpdate) self.NRJText = wx.StaticText(self, 105, “8.03 keV”, wx.Point(250, 15))

  `OnAddClick`(event)
  `OnClick`(event)
  `OnClickSource`(event)
  `OnExitClick`(event)
  `OnRemoveAllClick`(event)
  `OnRemoveClick`(event)
  `OnResetClick`(event)
  `UpdateFormula`(verbose=False)
  `printTXT`(txt='', par='')

    for printing messages

## `LSBackgroundDlg` Module

class `pySAXS.guisaxs.LSBackgroundDlg.` `LSBackgroundDlg`(parent, listofdata)

  Bases: `wx._windows.Dialog`

  `OnApplyClick`(event)
  `OnExitClick`(event)

## `LSClipqRangeDlg` Module

class `pySAXS.guisaxs.LSClipqRangeDlg.` `LSClipqRangeDlg`(parent, dataset_name)

  Bases: `wx._windows.Frame`

  `OnExitClick`(event)

    user click on Cancel exit without clipping

  `TextUpdate`(event)

## `LSConcatenateDlg` Module

class `pySAXS.guisaxs.LSConcatenateDlg.` `LSConcatenateDlg`(parent, listofdata, newdatasetname)

  Bases: `wx._windows.Frame`

  `OnApplyClick`(event)

    User click on Apply button

  `OnCancelClick`(event)

    User click on Apply button

  `OnExitClick`(event)
  `clipdata`(datasetname)
  `createData`()

## `LSDeconvolutionDlg` Module

class `pySAXS.guisaxs.LSDeconvolutionDlg.` `LSDeconvolutionDlg`(parent)

  Bases: `wx._windows.Dialog`

  `OnExitClick`(event)
  `typeList` = None

    # top sizer self.pan=wx.Panel(self, wx.ID_ANY) panel = self.pan vbox_top = wx.BoxSizer(wx.VERTICAL) #Parameters sizer sizer=wx.FlexGridSizer(rows=4,cols=2,hgap=20,vgap=5) #text , numerical value, slider

## `LSEvalDlg` Module

class `pySAXS.guisaxs.LSEvalDlg.` `LSEvalDlg`(parent, listofdata, newdatasetname)

  Bases: `wx._windows.Frame`

  `OnExitClick`(event)

    user click on Cancel exit without clipping

  `TextUpdate`(event)

## `LSFitGaussianDlg` Module

class `pySAXS.guisaxs.LSFitGaussianDlg.` `LSFitGaussianDlg`(parent, M)

  Bases: `wx._windows.Dialog`

  `OnExitClick`(event)

## `LSGenericParameterDlg` Module

class `pySAXS.guisaxs.LSGenericParameterDlg.` `LSGenericParameterDlg`(parent, title='', selectedData=None, parameters=None, callbackFunction=None, comment='')

  Bases: `wx._windows.Frame`

  `OnExitClick`(event)
  `textUpdate`(event)

    parameter value is udpated

## `LSInterpolateDlg` Module

class `pySAXS.guisaxs.LSInterpolateDlg.` `LSInterpolateDlg`(parent, newdatasetname, olddatasetname)

  Bases: `wx._windows.Frame`

  `OnApply`(event)

    calculate the new qrange

  `OnExitClick`(event)

    user click on Cancel exit without clipping

  `giveMeAQRange`(index)

    return a q range from the information on the form

  `giveMeListOfChecked`()
  `sortedDictValues`(adict)

    sort a dictionnary

## `LSInvariantDlg` Module

wx python dialog box for calculation of invariant

class `pySAXS.guisaxs.LSInvariantDlg.` `LSInvariantDlg`(parent, dataset_name, DPQ, DGQ)

  Bases: `wx._windows.Frame`

  `OnExitClick`(event)

    user click on Close

  `TextUpdate`(event)

    when the user click on Compute

## `LSInvariantDlgOLD` Module

wx python dialog box for calculation of invariant

class `pySAXS.guisaxs.LSInvariantDlgOLD.` `LSInvariantDlg`(parent, dataset_name, DPQ, DGQ)

  Bases: `wx._windows.Frame`

  `OnExitClick`(event)

    user click on Close

  `TextUpdate`(event)

    when the user click on Compute

## `LSModelDlg` Module

class `pySAXS.guisaxs.LSModelDlg.` `LSModelDlg`(parent, dataset_name, type='model', pos=wx.Point(50, 50))

  Bases: `wx._windows.Frame`

  `DlgUpdate`(event)
  `ModelUpdate`()

    when a parameter is updated

  `OnClickFitButton`(event)
  `OnClickFitButtonBounds`(event)
  `OnClickList`(event)
  `OnExitClick`(event)
  `UpdateAfterFit`(result)

    update all after a fit

  `sliderQmaxMove`(event)
  `sliderQminMove`(event)
  `textMinMaxUpdate`(event)
  `textUpdate`(event)

    parameter value is updated

## `LSResolutionDlg` Module

class `pySAXS.guisaxs.LSResolutionDlg.` `LSResolutionDlg`(parent)

  Bases: `wx._windows.Dialog`

  `OnExitClick`(event)

## `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)

  Bases: `wx._windows.Frame`

  `TextUpdate`(event)
  `on_QuitButton_Click`(event)
  `on_iAutoButton_Click`(event)
  `on_qAutoButton_Click`(event)

## `LSTransmissionDlg` Module

class `pySAXS.guisaxs.LSTransmissionDlg.` `LSTransmissionDlg`(parent, label)

  Bases: `wx._windows.Frame`

  `OnExitClick`(event)
  `SliderUpdate`(event)
  `textUpdate`(event)

    parameter value is udpated

## `LSUSAXSsimuDlg` Module

class `pySAXS.guisaxs.LSUSAXSsimuDlg.` `LSUSAXSsimuDlg`(parent)

  Bases: `wx._windows.Frame`

  `OnExitClick`(event)
  `textUpdate`(event)

## `LSZeroAdjustDlg` Module

class `pySAXS.guisaxs.LSZeroAdjustDlg.` `LSZeroAdjustDlg`(parent, M)

  Bases: `wx._windows.Dialog`

  `OnExitClick`(event)

## `LSdataDlg` Module

class `pySAXS.guisaxs.LSdataDlg.` `LSDataDlg`(parent, datab, rcb)

  Bases: `wx._windows.Dialog`

## `LSneutronDlg` Module

class `pySAXS.guisaxs.LSneutronDlg.` `LSNeutronCon`(parent)

  Bases: `wx._windows.Frame`

  `OnAction`(event)
  `OnAddAtom`(event)
  `OnAddNum`(event)
  `OnResetClick`(event)

## `LSscattering` Module

## `SAXSAbsoluteDlg` Module

class `pySAXS.guisaxs.SAXSAbsoluteDlg.` `SAXSAbsoluteDlg`(parent, params, datasetname=None)

  Bases: `wx._windows.Frame`

  `Compute`(event)

    user modify text

  `Control2Params`()
  `OnApplyClick`(event)

    User click on Apply button

  `OnExitClick`(event)
  `OnLoadClick`(event)

    User click on save button

  `OnSaveClick`(event)

    User click on save button

  `Params2Control`()

## `dataset` Module

class `pySAXS.guisaxs.dataset.` `dataset`(name=None, q=None, i=None, filename=None, checked=True, model=None, rawdata_ref=None, type=None, parameters=None, error=None, comment=None, parent=None, child=None, parentformula=None, variableDict=None, color=None)

`pySAXS.guisaxs.dataset.` `getDataDictFromXMLFile`(filename)

`pySAXS.guisaxs.dataset.` `getDataDictRaw`(filename)

  get dataset from old format

`pySAXS.guisaxs.dataset.` `getDatasetFromXML`(element)

  set the dataset with the parsed xml as Element

  <root>
    <name> mqlkqsmldk</name> <checked>true</checked> <q datatype=’numpy.array’>0,0.1,0.2,0.3</q> if it is an array datatype must contain ‘array’ ...

  </root>

`pySAXS.guisaxs.dataset.` `getDatasetFromXMLFile`(filename)

`pySAXS.guisaxs.dataset.` `saveDataDictOnXMLFile`(filename, data_dict)

`pySAXS.guisaxs.dataset.` `saveDataDictRaw`(filename, data_dict)

  save dataset in old format

`pySAXS.guisaxs.dataset.` `saveDatasetOnXMLFile`(filename, dataset)

## `matplotlibwx` Module

class `pySAXS.guisaxs.matplotlibwx.` `PlotFrame`(parent, id, title, size=(4, 4), dpi=96, cursor=True, location=True, crosshairs=True, selection=True, zoom=True, autoscaleUnzoom=True, axetype=None, **kwds)

  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 \nWritten by Ken McIvor <mcivor@iit.edu>\nCopyright 2005-2009 Illinois Institute of Technology\nmodified for PySAXS by Olivier Tach'e\n CEA / LIONS 2009"
  `ABOUT_TITLE` = 'About wxmpl.PlotFrame'
  `OnAutoscale`(event)

    if self.autoscaleitem.IsChecked(): self.statusbar.Show()

  `OnGridOff`(event)
  `OnGridOn`(event)
  `OnLegendOff`(event)
  `OnLegendOn`(event)
  `OnLegendXYtitle`(event)
  `OnLineFormat`(event)
  `OnLineFormatErrorBar`(event)
  `OnLogPlotType`(event)
  `OnMarkerChange`(event)
  `OnMenuFileClose`(evt)

    Handles File->Close menu events.

  `OnMenuFilePageSetup`(evt)

    Handles File->Page Setup menu events

  `OnMenuFilePrint`(evt)

    Handles File->Print menu events

  `OnMenuFilePrintPreview`(evt)

    Handles File->Print Preview menu events

  `OnMenuFileSave`(evt)

    Handles File->Save menu events.

  `OnMenuHelpAbout`(evt)

    Handles Help->About menu events.

  `OnPlotXYType`(event)
  `OnXYRange`(event)
  `addData`(x, y, label=None, id=None, error=None, color=None)

    datas to the plot x and y are datas label : the name of datas id : no of datas in a list -> give the colors

  `clearData`()
  `create_menus`()
  `draw`()

    Draw the associated C{Figure} onto the screen.

  `get_color`(n)

    return a color name from the list of colors if n> length of list of colors, return at the beginning

  `get_figure`()

    Returns the figure associated with this canvas.

  `get_marker`()

    Return an infinite, cycling iterator over the available marker symbols. or a fixed marker symbol

  `replot`()
  `set_autoscale_unzoom`(state)

    Enable or disable automatic view rescaling when the user zooms out to the initial figure.

  `set_crosshairs`(state)

    Enable or disable drawing crosshairs through the mouse cursor when it is inside a matplotlib axes.

  `set_cursor`(state)

    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)

    Enable or disable the display of the matplotlib axes coordinates of the mouse in the lower left corner of the canvas.

  `set_selection`(state)

    Enable or disable area selections, where user selects a rectangular area of the canvas by left-clicking and dragging the mouse.

  `set_zoom`(state)

    Enable or disable zooming in when the user makes an area selection and zooming out again when the user right-clicks.

class `pySAXS.guisaxs.matplotlibwx.` `data`(x, y, label=None, id=None, error=None, color=None)

## `myplot` Module

class `pySAXS.guisaxs.myplot.` `myplot`

  Bases: `pySAXS.guisaxs.matplotlibwx.PlotFrame`

  `addData`(x, y, label='')
  `plot`()
  `setLabel`(x='', y='')

## `pySaxsColors` Module

`pySAXS.guisaxs.pySaxsColors.` `getColorRGB`(name)

`pySAXS.guisaxs.pySaxsColors.` `listOfColors`()

  return the RGB list of colors with luminance <=0.4

`pySAXS.guisaxs.pySaxsColors.` `listOfColorsDict`()

`pySAXS.guisaxs.pySaxsColors.` `listOfColorsNames`()

  return the list of colors NAMES with luminance <=0.4

`pySAXS.guisaxs.pySaxsColors.` `name2luminance`(name)

`pySAXS.guisaxs.pySaxsColors.` `rgb2luminance`(r, g, b)

## `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')

## `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)

  Bases: `matplotlib.backends.backend_wxagg.FigureCanvasWxAgg`

  A matplotlib canvas suitable for embedding in wxPython applications.

  `OnActivate`(evt)

    Handles the wxPython window activation event.

  `OnDestroy`(evt)

    Handles the wxPython window destruction event.

  `OnEraseBackground`(evt)

    Overrides the wxPython backround repainting event to reduce flicker.

  `draw`(**kwds)

    Draw the associated C{Figure} onto the screen.

  `get_figure`()

    Returns the figure associated with this canvas.

  `notify_point`(axes, x, y)

    Called by the associated C{PlotPanelDirector} to emit a C{PointEvent}.

  `notify_selection`(axes, x1, y1, x2, y2)

    Called by the associated C{PlotPanelDirector} to emit a C{SelectionEvent}.

  `set_autoscale_unzoom`(state)

    Enable or disable automatic view rescaling when the user zooms out to the initial figure.

  `set_crosshairs`(state)

    Enable or disable drawing crosshairs through the mouse cursor when it is inside a matplotlib axes.

  `set_cursor`(state)

    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)

    Enable or disable the display of the matplotlib axes coordinates of the mouse in the lower left corner of the canvas.

  `set_selection`(state)

    Enable or disable area selections, where user selects a rectangular area of the canvas by left-clicking and dragging the mouse.

  `set_zoom`(state)

    Enable or disable zooming in when the user makes an area selection and zooming out again when the user right-clicks.

  `zoomed`(axes)

    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)

  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'
  `OnMenuFileClose`(evt)

    Handles File->Close menu events.

  `OnMenuFilePageSetup`(evt)

    Handles File->Page Setup menu events

  `OnMenuFilePrint`(evt)

    Handles File->Print menu events

  `OnMenuFilePrintPreview`(evt)

    Handles File->Print Preview menu events

  `OnMenuFileSave`(evt)

    Handles File->Save menu events.

  `OnMenuHelpAbout`(evt)

    Handles Help->About menu events.

  `create_menus`()
  `draw`()

    Draw the associated C{Figure} onto the screen.

  `get_figure`()

    Returns the figure associated with this canvas.

  `set_autoscale_unzoom`(state)

    Enable or disable automatic view rescaling when the user zooms out to the initial figure.

  `set_crosshairs`(state)

    Enable or disable drawing crosshairs through the mouse cursor when it is inside a matplotlib axes.

  `set_cursor`(state)

    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)

    Enable or disable the display of the matplotlib axes coordinates of the mouse in the lower left corner of the canvas.

  `set_selection`(state)

    Enable or disable area selections, where user selects a rectangular area of the canvas by left-clicking and dragging the mouse.

  `set_zoom`(state)

    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)

  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`()
  `draw`()

    Draw the associated C{Figure} onto the screen.

  `get_figure`()

    Returns the figure associated with this canvas.

  `set_crosshairs`(state)

    Enable or disable drawing crosshairs through the mouse cursor when it is inside a matplotlib axes.

  `set_cursor`(state)

    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)

    Enable or disable the display of the matplotlib axes coordinates of the mouse in the lower left corner of the canvas.

  `set_selection`(state)

    Enable or disable area selections, where user selects a rectangular area of the canvas by left-clicking and dragging the mouse.

  `set_zoom`(state)

    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)

  Plots and updates lines on a matplotlib C{Axes}.

  `setChannels`(channels)

    Specify the data-providers of the lines to be plotted and updated.

  `update`()

    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)

  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`()

    Returns the line color string to use when the line is plotted, or C{None} to use an automatically generated color.

  `getLabel`()

    Returns the matplotlib label for this channel of data.

  `getMarker`()

    Returns the line marker string to use when the line is plotted, or C{None} to use the default line marker.

  `getStyle`()

    Returns the line style string to use when the line is plotted, or C{None} to use the default line style.

  `getX`()

    Template method that returns the vector of X axis data or C{None} if there is no data available.

  `getY`()

    Template method that returns the vector of Y axis data or C{None} if there is no data available.

  `hasChanged`()

    Returns a boolean indicating if the line data has changed.

  `setChanged`(changed)

    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)

  Provides a simplified interface to the wxPython printing framework that’s designed for printing matplotlib figures.

  `getPrintData`()

    Return the current printer settings in their C{wx.PrintData} object.

  `pageSetup`()
  `previewFigure`(figure, title=None)

    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)

    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)

    Use the printer settings in C{printData}.

class `pySAXS.guisaxs.wxmpl.` `PointEvent`(id, axes, x, y)

  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`()

`pySAXS.guisaxs.wxmpl.` `EVT_POINT`(win, id, func)

  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)

  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`()

`pySAXS.guisaxs.wxmpl.` `EVT_SELECTION`(win, id, func)

  Register to receive wxPython C{SelectionEvent}s from a C{PlotPanel} or C{PlotFrame}.

### Navigation

- index
- modules |
- next |
- previous |
- pySAXS 77.September2012 documentation »
- pySAXS »
- pySAXS Package »