Project

General

Profile

Actions

Bug #1048

closed

GIF switches to EFTEM mode, has different magnifications

Added by Jim Pulokas about 14 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Low
Assignee:
Category:
Leginon subsystem
Start date:
10/11/2011
Due date:
% Done:

100%

Estimated time:
(Total: 0.00 h)
Affected Version:
Appion/Leginon 2.1.0
Show in known bugs:
No
Workaround:

Description

Leginon stores the list of magnifications available on each instrument in the database. pyscope uses that list to get/set magnification by index. That way the correct mag is get/set if the screen is up or down. GIF switches to EFTEM mode, which has a different list of magnifications. We need to find a way to have get/set magnification to work in any mode, even if the magnification list is different.

The MagnificationsData table is not able to handle different modes. It stores one list of mags for each TEM. One row contains the entire list of mags. This table should be normalized to a table with one row per mag. Columns would be: instrument, mag, index, mode, etc. The index that pyscope and tecnai scripting needs could be queried regardless of what mode the scope is in.


Files

gatan.py (18.4 KB) gatan.py Scott Stagg, 08/12/2011 11:13 AM
tecnai.py (62.5 KB) tecnai.py Scott Stagg, 08/12/2011 11:13 AM
instruments.cfg (1.39 KB) instruments.cfg Scott Stagg, 07/17/2012 08:12 AM

Subtasks 1 (0 open1 closed)

Bug #1445: two retractable camera on the same scope causes constant inserting/retracting Won't Fix or Won't Do Scott Stagg10/11/2011

Actions

Related issues 1 (0 open1 closed)

Related to Leginon - Feature #777: How to support two cameras on one scopeClosedScott Stagg07/26/2010

Actions
Actions #1

Updated by Scott Stagg almost 14 years ago

I want to comment on a work around that Jim suggested to get our Titan working with both our GIF and and the non-filtered camera. In order to do this, I needed to create a new instrument class and a new camera class. The steps I took are below:
  1. In pyscope edited gatan.py
    copied Gatan class to new GatanGIF class
    changed the value for the "name" variable from Gatan to GatanGIF
  2. In pyscope edit tecnai.py
    copied Tecnai class to new TecnaiEFTEM class
    changed the value for the "name" variable from Tecnai to TecnaiEFTEM
  3. added GatanGIF and TecnaiEFTEM to instrument.cfg
  4. added GatanGIF and TecnaiEFTEM to database
  5. because TecnaiEFTEM has completely different mags, it must be completely calibrated
  6. in order for it to work, the GIF has to be selected in the Tecnai interface, and EFTEM mode must be activated. Then the instrument and camera have to be properly set in the presets.
Actions #2

Updated by Jim Pulokas over 13 years ago

  • Assignee changed from Jim Pulokas to Scott Stagg

Scott, if you add your special pyscope classes to the trunk, then I will think about the best way forward. It may turn out that we add mode switching and multiple mag tables to the main Tecnai class, but at least we have something to start with in your solution.

Updated by Scott Stagg over 13 years ago

Jim, I was hesitant to commit my stuff to the trunk. I am attaching them here instead. I just want to make sure that it won't break anything. Please take a look, and commit if you think it won't mess anyone else up.

Actions #4

Updated by Scott Stagg over 12 years ago

  • Assignee changed from Scott Stagg to Anchi Cheng

Anchi, here is the thread we were trying to find yesterday regarding issue #777. Anyway, it was my error that was initially the problem. As you suggested, I should have renamed the class as well as the camera. I did that, and unfortunately, I'm still having a problem. Now the launcher will come up without error, but when Leginon connects to the instrument, it is not querying the cameras. If I go to Navigator, for instance, it will let me select Tecnai but "None" is my only available option for Digital Camera.

Actions #5

Updated by Scott Stagg over 12 years ago

I uploaded my current config file for completeness

Actions #6

Updated by Scott Stagg over 12 years ago

OK. More information on this. On the microscope computer, I tried:
from pyScope import gatan
myccd = gatan.Gatan()
and it yielded the following exception:

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 args[0].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'


Any ideas as to how to fix this? Jim, feel free to weigh in.

Actions #7

Updated by Anchi Cheng over 12 years ago

Jim is on the road.

See if the test used in #1469 will help you finding out what is actually registered and what is called.

Creating instance with ccd = gatan.Gatan() does not work any more. Need

from pyscope import registry
ccd = registry.getClass('Gatan')

Actions #8

Updated by Scott Stagg over 12 years ago

OK, I'm not exactly sure what to look for. I tried the following, and I don't know what to make of it:

>>> ccd=registry.getClass('Gatan')
>>> ccd.getBinning()

Traceback (most recent call last):
  File "<pyshell#4>", line 1, in <module>
    ccd.getBinning()
TypeError: unbound method new_f() must be called with Gatan instance as first argument (got nothing instead)
>>> dir(registry)
['__builtins__', '__doc__', '__file__', '__name__', 'c', 'ccdcameraorder', 'ccdcameras', 'config', 'getClass', 'getClasses', 'temorder', 'tems']
>>> registry.ccdcameras
{'Gatan': <class 'pyscope.gatan.Gatan'>, 'GatanGIF': <class 'pyscope.gatan.GatanGIF'>}
>>> registry.tems
{'Tecnai': <class 'pyscope.tecnai.Tecnai'>, 'TecnaiEFTEM': <class 'pyscope.tecnai.TecnaiEFTEM'>}

Actions #9

Updated by Anchi Cheng over 12 years ago

Sorry, my bad,

you need to use

ccd = registry.getClass('Gatan')()

to get an instance of the class.

Actions #10

Updated by Scott Stagg over 12 years ago

OK, I did ccd = registry.getClass('Gatan')(), and it gave the original exception:

Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    ccd=registry.getClass('Gatan')()
  File "c:\python25\Lib\site-packages\pyscope\loggedmethods.py", line 24, in new_f
    if mylock._RLock__count == 1 and args[0].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'

Actions #11

Updated by Anchi Cheng over 12 years ago

Almost out of idea. You don't have two separate computer, one for TEM and one for camera, do you? and DM is on? And if you only have one of the two camera registered, it still works?

Actions #12

Updated by Anchi Cheng over 12 years ago

Found it. See #1886.

Actions #13

Updated by Anchi Cheng over 12 years ago

I've updated branch 2.2 with that and another change which I think might help you that didn't make it into the branch in pyscope.

Actions #14

Updated by Scott Stagg over 12 years ago

That did it. Thanks!!!!

Actions #15

Updated by Sargis Dallakyan almost 7 years ago

  • Status changed from Assigned to Closed
Actions

Also available in: Atom PDF