Writing a front-end
February 12, 2010 7:40 PM   Subscribe

I'm looking to write a graphical front-end for a text-based data fitting and plotting program. Is it better to program an interface from scratch or write an extension for a plotting program such as Igor, Origin, Mathematica, etc.?

I'm fitting data from some neutron scattering experiments using a very tedious command-line program developed by my colleagues. The program first imports experimental data from a text file. The user then enters various experimental parameters that influence the fit, as well as upper and lower fitting bounds. The program next uses a chi-square minimization routine to fit the data, based on the user's constraints.

Currently all of the data, constraints, and fitting bounds are entered manually into a text file, which is loaded by the program; it then outputs a plot of the fit and its data points to a file. I would like to write a simple front-end that will allow me to input the constraints in a more visually appealing and intuitive form. I'd also like immediate feedback whenever a fitting parameter is changed (i.e. include a plot of the results in the interface).

I have some prior programming experience, but I don't know whether it's better to write an front-end from scratch or write a plugin for an existing plotting program, such as Mathematica, Origin, Igor, etc. Has anyone done something like this, and if so, can you share your experiences or suggestions? Thanks!
posted by Aanidaani to Computers & Internet (3 answers total)
 
Well it seems to me you'd either be learning a toolkit API (Wx, GTK, QT, etc) or learning a plugin API. There are a lot more examples and documentation for the former, so I think it would be easier. In most cases these days there are handy bindings for your favorite scripting langauge (e.g. WxPython) such that you don't have to resort to C or C++ and still make very usable native-feeling apps.
posted by Rhomboid at 8:03 PM on February 12, 2010


What language is the data fitting program written in? If it's done in MATLAB, then it's relatively easy to write a GUI wrapper for it. If it's written in something other than MATLAB, you can still consider using MATLAB for the GUI or you might consider what Rhomboid suggested. The advantage of using MATLAB for the GUI wrapper is that its bulit in plotting features are quite flexible and relatively easy to work with.

If you do decide to use MATLAB, here are some helpful links to the documentation:
Creating Graphical User Interfaces
Graphics (and Plotting)
posted by scalespace at 9:35 PM on February 12, 2010


I'd do this in MATLAB. Igor is a good choice as well, especially because as you build your script, the GUI dialog boxes tell you how command lines will look.
posted by fatllama at 7:54 AM on February 13, 2010


« Older One Book to Bring Them, Into the Sci-fi and Hook...   |   "What's done is done." in Latin? Newer »
This thread is closed to new comments.