On Tue, Jun 12, 2012 at 03:06:00PM +0200, Denny Köhler wrote:
> I'd like to create a script which allows me to do some basic stuff like
> calculating a height distributiona and then fitting a gaussian to this
> data on a lot of data sets. So doing it manually is not an option.
> I found two modules who could be usefull for this:
> stats and sfunctions
> but the problem is, Gwyddion crashes without any error message or
> something similar when I call these modules.

Not all modules are the same; stats and sfunctions are tools (there are
also other kinds, file, graph or layer module functions).  You cannot
‘call’ them as data processing functions.  In fact, it would be probably
quite difficult to use tools from a script as they are inherently
interactive and their interface is immensely idiosyncratic.

> Btw. using the implemented function "dh" of the DataField was not
> suitable up to now because I'd like to do some more data processing
> befor I want to save the solution somewhere and up to now I didn't find
> a way to get a DataLine into a Graph or something similar... :-( So a
> hint on this would be helpfull, too.

The following should work as a standalone script (only with stadnalone
gwy available in nightly snapshots at this moment).  Removing the last
two lines should make it suitable for the console.  Anyway, hopefully it
demonstrates how to create a graph window with data from a DataLine.

import gwy, gtk
c = ... load or get the container ...
f = c.get_object_by_name('/0/data')  # or some other data...
l = gwy.DataLine(1, 1.0, True)
f.dh(l, 0)
gm = gwy.GraphModel()
gcm = gwy.GraphCurveModel()
gcm.set_data_from_dataline(l, 0, 0)
gm.add_curve(gcm)
g = gwy.Graph(gm)
w = gtk.Window()
w.add(g)
w.show_all()
w.connect('destroy', gtk.main_quit)
gtk.main()

Regards,

Yeti


------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Gwyddion-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gwyddion-users

Reply via email to