Project

General

Profile

Actions

Feature #2201

closed

two gatan cameras on the same scope

Added by Jim Pulokas almost 12 years ago. Updated almost 11 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
pyscope
Target version:
Start date:
01/10/2013
Due date:
% Done:

0%

Estimated time:
Deliverable:

Description

The pyscope Gatan class is currently limited to only using the current active camera, and there is no way to alternate using two Gatan cameras within the same session. Need to add support for having more than one Gatan camera.


Files

startMainErr.png (94.8 KB) startMainErr.png Jian Shi, 01/13/2013 10:36 PM
CCD_acquire_error.JPG (126 KB) CCD_acquire_error.JPG Jian Shi, 01/13/2013 10:39 PM
tifferror.png (37.7 KB) tifferror.png Jian Shi, 02/13/2013 06:14 PM
Actions #1

Updated by Jim Pulokas almost 12 years ago

  • Status changed from Assigned to In Test

Ideally, we could configure different Gatan cameras in instruments.cfg under different names, but using the same Gatan class. The Gatan instance would have to be initialized using the proper camera id that Digital Micrograph uses to set the current active camera. That ID would also have to be in the instruments.cfg. The way we interpret and use instruments.cfg would need improvement, because currently we do not refer to cameras by the configured name, but rather the class name. Therefore, I am going to initially implement this by creating different classes for each camera.

In r17324 (not tested yet) I have created classes Gatan0, Gatan1, etc... where the number is the camera id used by Digital Micrograph. So in instruments.cfg you have have something like:

[Gatan Orius]
class: gatan.Gatan0

[Gatan CCD]
class: gatan.Gatan1
but pay careful attention to knowing which camera id is which camera. Unfortunately, we still refer to cameras in Leginon by the class name, so you will only see "Gatan0" etc. in your camera choices, not "Gatan Orius". I really want to fix this so we can give cameras more meaningful names.

I will do some initial testing on our single camera system, then pass this over to Jian to test on his two camera system.

Actions #2

Updated by Jim Pulokas almost 12 years ago

  • Assignee changed from Jim Pulokas to Jian Shi

Jian,
I just realized that we do not even have a camera to test on here. Our only Gatan CCD was taken off so we could try out a K2, which uses its own pyscope module. This means you will have to be the first one to test out my changes to gatan.py.

To test: update from svn and install the new gatan.py. Then you also have to modify instruments.cfg as I mentioned above. I would guess that the camera that shows up first in DigitalMicrograph is camera 0, and the second one is camera 1, but you will have to confirm that. One thing I forgot to add to the config example above is "zplane", which I think is the same for both of the cameras, right? In other words: both cameras are on the same plane, and retracting one will insert the other?

Let me know if it works or if you need something fixed.
Jim

Actions #3

Updated by Jian Shi almost 12 years ago

Jim,

I downloaded and installed the version 17325 from SVN. Here are the outcomes:
1) The issue in baseinstrument.py still exist in svn, which has been solved by http://emg.nysbc.org/issues/1886
Without fixing it, the CCDs won't show up in instrument node

2)If the Leginon Main is started from Linux, there is error which should due to the changes in gatan.py. Please see attached screen copy.

3) If the Leginon Main is started on Windows, the CCD in instruments.cfg are listed correctly and is able to communicate with DM. But error comes up when try to take image with either cameras.

4) Regarding to the camera z-plane, there are two scenarios:
4a)On our T12, the Gatan CCD and Gatan Orius are installed at the same image plane. But only Orius can push CCD out while it is inserted. On the contrary, it is not true. We have to manually retract Orius first, then insert CCD.
4b) On our Krios, the Gatan Orius is installed at pre-GIF plane, same as Falcon. They do push each other out of view. At least we don't have to retract either one explicitly during operation. The other is Gatan GIF CCD, which is behind GIF and not retractable.
I am not sure what z-plane in instruments.cfg exactly means and how to set it up.

Thanks and Regards,
Jian

Actions #5

Updated by Jim Pulokas over 11 years ago

Hi Jian, The linux problem looks like you have the gatan camera configured in the instruments.cfg. This should only be configured in the instruments.cfg on the Windows machine. The Windows problem seems like it is because of too old a version of numextension. I will try to compile a new version, but until then you should be able to run main from Linux if instruments.cfg issue is resolved. Let me know if that works, otherwise report any new errors and set "Assigned to" back to me.
Jim

Actions #6

Updated by Jian Shi over 11 years ago

Great! It worked. I can use both Gatan CCD now simply removing the Gatan item in instruments.cfg on Linux.

Orius can be inserted and used to take images simply after chosen from camera list. On the contrary, GIF CCD can't push Orius out since the GIF CCD and Orius are not on the same plane. Orius need to be explicitly retracted by user in DM to allow the beam pass. It would be nice that the camera can retract itself as soon as it is deselected.

BTW, when I start leginon main, I got error message regarding to _tifffile.decodelzw, which I didn't find answer on the forum.

Actions #7

Updated by Anchi Cheng over 11 years ago

Does this mean that Orius itself does not respond to our request to retract? Leginon's script is suppose to set all unused camera that are above the camera for imaging to retracted before it sends the request to insert the imaging camera.

If I understand your last update correctly, camera insertion/retraction works correctly on T12 where your have CCD and Orius on the same plane, but it does not on Krios. If Orius does not ever respond to our call to

orius.Retract()

but it is pushed away by the CCD when we call to
T12CCD.Insert()

then I can see why it does work on Krios where GIF CCD does not do the push.

Do you know if it is intended for Orius retraction not controlled from anything but manual (I suppose it means a button in DM still).

Can you try a direct call on both scope in the following:
I don't know if your orius would be loaded as gatan.Gatan0 or not. In this script I assume it is. Do this in python command window on the camera computer

from pyscope import gatan
orius = gatan.Gatan0()
orius.getRetractable() # This should return True
orius.getInserted() # This should return the current state of orius.  Retracted is False, Inserted is True
orius.setInserted(True) # This should insert orius
orius.setInserted(False) # This should retract orius

I've not done enough scripting at this level but I don't think I would cause harm as long as you start with all camera on the same plane retracted.

tifffile error is for decode compressed file. Lacking that part of the library does not affect any function we currently use in Leginon and Appion.

Actions #8

Updated by Jian Shi over 11 years ago

1) I didn't install and test Leginon on our T12 due to other constrains. I just listed it as a possible scenario. However, on Krios, Falcon and Orius are indeed on the same plane and push each other out of view. That is what happens in EPU, so that user can assign different camera to different presets, per se Orius for Low mag atlas, and Falcon for high mag image in SA range.

2) Your Orius test command runs as expected in the terminal. But within Leginon Manual node, I notice that nothing really happens in DM when I select the other camera from the list in setting window. The insert event only is trigged by acquiring an image.

3) Our EFCCD is gatan0 and Orius is Gatan1. If I choose Gatan1(Orius) and start acquire, the Orius will be inserted until then and collect an image correctly. After this, if I choose Gatan0(EFCCD) and start acquire, EFCCD will be selected in DM but return a blank image due to blockage. If I run "Orius.getInserted()" in terminal window, the return value will be True at this moment. I have to go to DM and click search or acquire button manually, DM will pop a window to ask "Retract nonselected camera?" and retract Orius after click OK. Maybe Orius did not get retracted in Leginon because the EFCCD is not insert-able and retractable, I suspect.

4) I will more interested in testing using Falcon and Orius simultaneously. Falcon control is not in TecnaiCCD.dll, but in other library files. I found a few candidates but would appreciate your help to load them into python and pyscope for testing. Let me know if you are interested.

Thanks,
Jian

Actions #9

Updated by Anchi Cheng over 11 years ago

Could you tell us the zplanes you assigned to each camera in your instruments.cfg? I wonder if you had it backward.

Actions #10

Updated by Jian Shi over 11 years ago

In fact, I am not sure what to put in for the z-plane. Any arbitrary number? Or relative distance to film drawer? In what unit? I will check the number I input there tomorrow.

Actions #11

Updated by Anchi Cheng over 11 years ago

Leginon will attempt to retract camera at higher zplane when a camera of lower zplane is about to acquire an image, which will be inserted if insertable. If the two cameras are assigned to the same zplane, then there is no retraction of the unused camera.

The number is relative, with no unit. You should assign the Orius a larger number, and the EFCCD a smaller number.

Actions #12

Updated by Jian Shi over 11 years ago

Your suggestion works great. Now all Gatan CCDs switch smoothly and seamlessly. Now the outstanding question is to control Falcon camera. Do you guys have any suggestion?

Actions #13

Updated by Anchi Cheng over 11 years ago

  • Status changed from In Test to Closed

Great.

Let's put Falcon camera to another issue #2254

Actions #14

Updated by Anchi Cheng over 11 years ago

In summary, the need for two gatan camera on one scope controlled by the same computer is resolved by r17324 in trunk.

  1. Update the pyscope installlation on the camera-controlling computer to the said version.
  2. The two cameras need to be configured as two classes in pyscope/instrument.cfg at the camera-controlling computer. The way to set z-planes are described in Installation_on_the_microscope_computer
Actions #15

Updated by Anchi Cheng almost 11 years ago

  • Target version set to myami-3.0
Actions

Also available in: Atom PDF