Discussion:
[Gwyddion-users] Retrieving array size using pygwy
Giacomo Marchioro
2016-11-22 11:10:57 UTC
Permalink
Dear all,
I won't to work with the surfaces as numpy array for do some processing using gwy.
I guess this is a very basic topic but I can't find the parameters where are store the size of the acquisition:

import gwy
import numpy as np
d = gwy.gwy_app_data_browser_get_current(gwy.APP_DATA_FIELD)
data = np.array(d.get_data()).reshape(xsize?,ysize?)
#How can I get the size of my array xsize and ysize?




All the best,
Giacomo Marchioro


------------------------------------------------------------------------------
David Nečas (Yeti)
2016-11-22 12:10:12 UTC
Permalink
Post by Giacomo Marchioro
Dear all,
I won't to work with the surfaces as numpy array for do some
processing using gwy. I guess this is a very basic topic but I can't
import gwy
import numpy as np
d = gwy.gwy_app_data_browser_get_current(gwy.APP_DATA_FIELD)
data = np.array(d.get_data()).reshape(xsize?,ysize?)
#How can I get the size of my array xsize and ysize?
The DataField dimensions are d.get_xres() × d.get_yres().

Regards,

Yeti


------------------------------------------------------------------------------
Giacomo Marchioro
2016-11-22 12:58:49 UTC
Permalink
Thanks a lot Yeti it works. And I apologize for the writing of my previous email, I have a lack of sleeping hours eheheh


Best regards,
Giacomo Marchioro

----- Original Message -----
From: "David Nečas (Yeti)" <***@gwyddion.net>
To: "Gwyddion use discussion" <gwyddion-***@lists.sourceforge.net>
Sent: Tuesday, November 22, 2016 1:10:12 PM
Subject: Re: [Gwyddion-users] Retrieving array size using pygwy
Post by Giacomo Marchioro
Dear all,
I won't to work with the surfaces as numpy array for do some
processing using gwy. I guess this is a very basic topic but I can't
import gwy
import numpy as np
d = gwy.gwy_app_data_browser_get_current(gwy.APP_DATA_FIELD)
data = np.array(d.get_data()).reshape(xsize?,ysize?)
#How can I get the size of my array xsize and ysize?
The DataField dimensions are d.get_xres() × d.get_yres().

Regards,

Yeti

Loading...