Hi,
I have the following problem: I would like to process (fit etc.) all opened 
AFM-images with one pygwy-script and then export them to pngs. This works fine 
so far, but the z-scale of the exported images is the one of the unprocessed 
files: The displayed data fields (after processing) show a scale in the range 
of nm, the exported files a range of micormeters. Example script for this 
problem derived from the pygwy tutorial:

import gwyutils
# base name
basename = "exported_png_%d.png"
i = 0
# get list of available containers
cons = gwy_app_data_browser_get_containers()
# iterate thru containers and datafields
for c in cons:
  # get directory of datafields where key is key in container
  dfields = gwyutils.get_data_fields_dir(c)
  for key in dfields.keys():
    # get processed datafield object
    datafield = dfields[key]
    # retrieve datafield number in container from key (for example '/0/data')
    datafield_id = key.split('/')[1]
    poly_coeff = datafield.fit_polynom(3,3)
    datafield.subtract_polynom(3,3,poly_coeff)
    # request redraw before export
    datafield.data_changed()
    # export datafield to png, for the first time show export dialog
    if i == 0:
      gwyutils.save_dfield_to_png(c, key, basename % i, RUN_INTERACTIVE)
    else :
      gwyutils.save_dfield_to_png(c, key, basename % i, RUN_NONINTERACTIVE)
    i += 1
    # request redraw datawindows with datafields
    datafield.data_changed()

Any idea what I am doing wrong? Thanks for the help. Btw: Thanks to the devs, 
great work!

Regards

Matthias
___________________________________________________________
SMS schreiben mit WEB.DE FreeMail - einfach, schnell und
kostenguenstig. Jetzt gleich testen! http://f.web.de/?mc=021192

------------------------------------------------------------------------------
RSA(R) Conference 2012
Save $700 by Nov 18
Register now
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Gwyddion-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/gwyddion-users

Reply via email to