On Thu, Apr 16, 2015 at 07:30:47PM +0100, Andrés Muñiz Piniella wrote:
> I want to do three parallel one pixel wide sections on each step
> feature. I will then average.
Why would you want to take three one-pixel sections on each feature and
average? DataField.get_profile() can average in the direction
orthogonal to the line direction – see argument thickness, which has the
same meaning as in the Profile tool.
Maybe I misunderstand and you just want take three sections, one on each
step feature.
To modify the selection in a script:
1) Get the selection, e.g
sel = container['/0/select/line']
2) Use get_data() to obtain the coordinates:
coords = sel.get_data()
The resulting array has length nselections*ncoords, where ncoords = 4
for lines is the number of coordinates describing each selection object
(line here).
3) Do whatever with coords.
4) Set the selection data
sel.set_data(len(coords)/4, coords)
The number 4 has the same meaning as above. For obscure reasons it is
necessary to pass it back.
E.g.
c = gwy.gwy_app_data_browser_get_current(gwy.APP_CONTAINER)
sel = c['/0/select/line']
coords = sel.get_data()
coords = coords + [x + 1e-7 for x in coords]
sel.set_data(len(coords)/4, coords)
Yeti
------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Gwyddion-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gwyddion-users