Project

General

Profile

Gatan Issues after Update

Added by Anand Gupta almost 12 years ago

We just updated the legionon installation on our microscope computer to 2.2 from 2.1, to bring it in sync with our recently updated linux leginon installation. After following the instructions from http://emg.nysbc.org/projects/leginon/wiki/How_to_Update_from_v21_(Microscope_Windows_Computer)
Our leginon client starts up and connects ok, but the Gatan CCD we have doesn't appear in Applications. Its listed in our instruments.cfg, complete with the new zplane field. It used to work in 2.1 (and before that), and has just stopped. Our microscope(a Tecnai) seems to work fine with leginon.

When we try to open the gatan interface in python using

from pyscope import gatan
ccd = gatan.Gatan()

We get:
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
ccd = gatan.Gatan()
File "c:\python25\Lib\site-packages\pyscope\loggedmethods.py", line 24, in new_f
if mylock._RLock__count == 1 and args0.logged_methods_on:
File "c:\python25\Lib\site-packages\pyscope\loggedmethods.py", line 27, in new_f
result = f(*args, **kwargs)
File "C:\Python25\lib\site-packages\pyscope\gatan.py", line 69, in getattribute
if attr_name in object.__getattribute__(self, 'unsupported'):
AttributeError: 'Gatan' object has no attribute 'unsupported'

We're not sure how to fix this, and would appreciate any help in getting it working.

Thanks!


Replies (6)

RE: Gatan Issues after Update - Added by Anchi Cheng almost 12 years ago

First, the way to test import of an instrumnet class has changed. Instead of

from pyscope import gatan
c = gatan.Gatan()

You need to create the instance of the gatan camera class use
from pyscope import registry
c = registry.getClass('Gatan')

As for the error you get, I expect that you will get the same one even if you change the testing method. I started Issue #1886. It may take a few days to fix this proper.
Here is a work around that you can do now:

On the computer that controls the Gatan camera, go to where pyscope is installed: C:\\Python25\Lib\site-packages\pyscope
and edit line 4 of baseinstrument.py

#class BaseInstrument(loggedmethods.LoggedMethodsBase):
class BaseInstrument(object):

LoggedMethod is only used so far on DE camera. Therefore, you are safe to do so.

Anchi

RE: Gatan Issues after Update - Added by @Maria Janssen over 11 years ago

Hi!

We have the exact same problem as described above by Anand Gupta: leginon client starts up and connects, but the Gatan CCD doesn't show up in Applications. Its listed in our instruments.cfg, complete with the new zplane field. In version 2.1 everything worked fine.

We tried to use the same work around as described by Anchi here, but that didn't solve the problem for us.

Also, is there any way to see if pyScope is working with the CCD? We tried using:

from pyScope import gatan
myccd = gatan.Gatan()
myccd.getBinning()

, but are not getting anything.... not sure where to look further?

Thanks a lot,
Mandy

RE: Gatan Issues after Update - Added by @Maria Janssen over 11 years ago

Okay. With the help of Giovanni Cardoni, we got the CCD now recognized in the Leginon application. In the file gatan.py we changed the order a little bit: we put ln 26 "self.unsupported = []" before ln 25 "ccdcamera.CCDCamera._init_(self). This way when the CCD camera starts initializing the variable it needs is defined already. In addition, we needed to use the work around that Anchi described above.

Although I'm happy we can work now with the CCD camera, I was wondering what happens when we add the DE12 camera. Is, after what we did here in the script, the CCD still detectable when we add the DE12 later? How do we control both camera's with this work around?

Thanks!
Mandy

RE: Gatan Issues after Update - Added by Anchi Cheng over 11 years ago

Odd, the bug was fixed in 2.2 branch a month ago in r16940 and r16941. If you've got a new check out or updated your branch check out since, you should not have gotten neither of these. Please have Jinghua check if everything is up to date.

Since the change is in gatan.py DE12 that uses de.py should not be affected.

Anchi

RE: Gatan Issues after Update - Added by @Maria Janssen over 11 years ago

Thanks! Everything should be up to date now.

The question I was wondering about though is the work around you implemented above: line 4 of baseinstrument.py

#class BaseInstrument(loggedmethods.LoggedMethodsBase):
class BaseInstrument(object):

We did this, but we were wondering what happens when we want to use both gatan and DE12.

RE: Gatan Issues after Update - Added by Jim Pulokas over 11 years ago

To clarify the use of LoggedMethodsBase: It is used to generate a very detailed log of everything that pyscope does and is only useful when you are debugging problems. You are safe to disable it using the work around from Anchi, and all cameras including the DE12 should work fine.
Jim

    (1-6/6)