Bug #1048
closedGIF switches to EFTEM mode, has different magnifications
100%
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
Updated by Scott Stagg almost 14 years ago
- In pyscope edited gatan.py
copied Gatan class to new GatanGIF class
changed the value for the "name" variable from Gatan to GatanGIF - In pyscope edit tecnai.py
copied Tecnai class to new TecnaiEFTEM class
changed the value for the "name" variable from Tecnai to TecnaiEFTEM - added GatanGIF and TecnaiEFTEM to instrument.cfg
- added GatanGIF and TecnaiEFTEM to database
- because TecnaiEFTEM has completely different mags, it must be completely calibrated
- 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.
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.
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.
Updated by Scott Stagg over 12 years ago
- File instruments.cfg instruments.cfg added
I uploaded my current config file for completeness
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.
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')
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'>}
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.
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'
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?
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.
Updated by Sargis Dallakyan almost 7 years ago
- Status changed from Assigned to Closed