AttributeError in Image cleaning and atom finding using pycroscopy

24 views
Skip to first unread message

Jack Liu

unread,
Jun 10, 2020, 7:02:47 PM6/10/20
to pycroscopy
Hello,

I'm new to pycroscopy and trying to use algorithm of Image cleaning and atom finding using pycroscopy to get rid of noise in a TEM image. But I encountered a problem shown below when I trying to execute their command. Can some body help me out? If doSVD is an old function, can somebody tell me the replacing function of it?

Rajiv Giridharagopal

unread,
Jun 10, 2020, 7:33:28 PM6/10/20
to pycroscopy
Hi Jack,
Yes, that function is old. Is this from an existing notebook that you're working off of? For this to work it be more like:

h5_svd = px.processing.svd_utils.SVD(h5_wins)
h5_svd_group = h5_svd.compute()
h5_u = h5_svd_group['U']
h5_v = h5_svd_group['V']
h5_s = h5_svd_group['S']

where SVD is a class. If you want to dig into it, is in pycroscopy.processing.svd_utils

Best,
Raj

Jack Liu

unread,
Jun 10, 2020, 7:42:34 PM6/10/20
to pycroscopy
Hi Raj,

Thank you for answering my question!! I did try the command lines you provided, and there are still some errors that I don't really understand what cause them or what is their meaning.



Best, 
Jack

Rajiv Giridharagopal

unread,
Jun 10, 2020, 8:01:49 PM6/10/20
to pycroscopy
How big is the dataset h5_wins? This is a MemoryError popping up in h5py (i.e. not pycroscopy). I don't know if reducing components from 100 will help avoid this error, since it may be system-dependent...

Raj

Jack Liu

unread,
Jun 10, 2020, 8:24:40 PM6/10/20
to pycroscopy
Thank you so much for enlighten me!!

This is the step before memory error. Do you think this is too big? I think I just input a regular 1080*1080 image, what should I do to prevent the memory error? Also, I reduced components from 100 to 50 to 3, and even the num_components is 3 I still keep getting the memory error.


Best regards,
Jack

Rama Vasudevan

unread,
Jun 11, 2020, 10:48:57 AM6/11/20
to pycroscopy
Hi Jack,

I think the issue is that the window step is very small. You should change it to be something like 1/4 of the window size (I think the default is a step size of 1). For a small image (256x256) it should work, but for a larger image such as yours you will quickly hit a memory limit on a normal machine. Please let me know if this works.

Kind Regards,
Rama
Reply all
Reply to author
Forward
0 new messages