Several classes are defined in the source code. This class is used to start the GUI: jldesmear.gui.desmearinggui.DesmearingGui. The main GUI program is started with a Python command such as:
from jldesmear.gui import desmearinggui
desmearinggui.main()
Lake desmearing GUI using PySide (or PyQt4) and Matplotlib
Define the signals used to communicate between the desmearing thread and the PySide (main Qt4 GUI) thread.
FileEntryBox = QGroupBox[QLineEdit + QPushButton]
Run n iterations of the desmearing operation in a separate thread. Running in a separate thread with callbacks allows the GUI widgets to be updated after each iteration.
Parameters: |
|
---|
Start this thread with code such as this example:
IterativeDesmear(Desmear_object, number_of_iterations).start()
create a MatPlotLib FigureCanvas object with a single Figure
See: | http://packtlib.packtpub.com/library/9781847197900/ch06lvl1sec03# |
---|
Note
Something is not quite right here. Both PySide and PyQt4 report problems when charts are created this way.
PyQt4 reports:
QObject::connect: Cannot queue arguments of type 'QTextCursor'
(Make sure 'QTextCursor' is registered using qRegisterMetaType().)
PySide (on linux) reports:
(python2.7:5972): libgnomevfs-WARNING **: Cannot load module `/usr/lib/gnome-vfs-2.0/modules/libfile.so' (/usr/lib/gnome-vfs-2.0/modules/libfile.so: cannot open shared object file: No such file or directory)
Application asked to unregister timer 0x44000005 which is not registered in this thread. Fix application.
This does not stop program execution. It is an indication that some subtlety has been missed. No error is reported on MS Windows 7 using Enthought Python Distribution.
Lake desmearing GUI using Enthought’s Traits, Chaco, and Enable packages.
note: | If you are using Ubuntu 11.04 and cannot see a menubar, this is a bug in Ubuntu 11.04. Try setting the environment variable: UBUNTU_MENUPROXY=1 Or, the code does not call for a menubar. ... Nevermind. |
---|
Provide interactive access to all the parameters used in desmearing
This is a main GUI for the Lake/Jemian small-angle scattering desmearing program. It uses Traits, Chaco, and Enable. Call it with code like this:
DesmearingGui().configure_traits()
return a dictionary of the available extrapolations
Extrapolation functions must be in a file named extrap_KEY.py where KEY is the key name of the extrapolation function. The file is placed in the source code tree in the same directory as the module: extrapolation.
The calc() method should be capable of handling q as a numpy.ndarray or as a float.
The file must contain:
this function is called after every desmearing iteration from traditional()
Parameters: | dsm (obj) – desmearing parameters object |
---|---|
Returns: | should desmearing stop? |
Return type: | bool |
Run n iterations of the desmearing operation in a separate thread. Running in a separate thread with callbacks allows the GUI widgets to be updated after each iteration.
Parameters: |
|
---|
Start this thread with code such as this example:
IterativeDesmear(self.obj_dsm, self.NumItr).start()