pyScope 1.0.6 problems
Added by Jim Pulokas over 18 years ago
There have been a few people upgrading to pyScope 1.0.6 and having problems. I have not been able to reproduce these problems on our system. If you had problems with 1.0.6, please try installing it again by using this exact procedure, which I have verified to work on our Tecnai (both with Gatan and with Tietz):
- Do complete uninstall of all previous versions of everything related to Leginon, pyScope, and Python on your Tecnai windows machine. This includes:
- Leginon
- pyScope
- NumExtension
- numarray
- PIL
- wxPython
- Python MySQL
- Python
- Install the following exact versions in this order:
- Python 2.4.3
- pywin32 version 208 for py2.4
- wxPython 2.6.3.2
- PIL 1.1.5
- numarray 1.5.1
- NumExtension 1.0.2
- MySQL python 1.2.0
- Leginon 1.2.0
- pyScope 1.0.6
- When pyScope finishes installing, take note of the messages that are printed in the installation window. You should only see failure messages in the following cases:
- if you do not have adaExp installed, this will fail to register in pyScope which is ok, but you will not be able to do film exposures
- if you do not have a Tietz camera, you may see two failures regarding "CAMC" and "ping"
- if you do not have a Gatan camera, you may see a failure regarding "tecnaiccd"
- create or modify your leginon.cfg if necessary. To avoid confusion, make sure you only have one copy of leginon.cfg on the Tecnai (do a search to verify)
- To verify that Leginon is working, try starting Leginon on the Tecnai pc, not remotely. You should be able to start applications, acquire images, create and change presets, etc.
- If that is working, then try to run Leginon from a remote computer with only the leginon client on the Tecnai.
- If it is still not working, please post your situation here with any error messages, and also a description of your system including what version of the following you use;
- Windows (2000, NT, or XP)
- Tecnai User Interface (look in Help menu, "About Tecnai")
- Digital Micrograph (if using Gatan)
- Python and python packages if they differ from what I recommended
Also list anything that was listed as "failed" after pyScope installation, even if it was expected.
With all these details, we should be able to narrow down the problem
Replies (20)
- Added by Anonymous over 18 years ago
I finally got round to trying the Leginon 1.2.0 and pyScope 1.0.6 re-install on the Windows client basically exactly as you describe. A complete uninstall was done of everything relating to Leginon, pyScope and Python. Python, required Python packages, Leginon and pyScope were installed in the exact order and versions described. The description of the packages to install posted earlier by Jim Pulokas does not state whether wxPython 1.6.3.2 should be installed from the ANSI or the Unicode versions of this package which are available for the same version number. I assumed the ANSI version (still in version number 1.6.3.2) was the correct one as the wxPython page suggested the Unicode version has more bugs and says "if you don't know what the difference is" then you should use the ANSI version. Everything was installed from an Administrator login. (On previous installations I've installed everything from a normal user login - with Power User privileges - except the one or two packages which force me to login as an administrator.) The pyScope installer gives error messages concerning two failures regarding "CAMC" and "ping" - as expected as we do not have a Tietz camera.
Leginon was then started on the Tecnai PC and failed to change presets - the problem that I had before with the upgrade to pyScope 1.0.6. I confirmed that running Leginon on a remote computer with only the Leginon client on the Tecnai PC has the same problem (that I cannot send presets to the microscope). This gives the error message "Preset change failed: unable to set instrument" in the scrolling message window in the Preset Manager node. (I also attempted to work around the problem by creating a new preset - which I did successfully - and then deleting the old presets. However, sending the new preset to the microscope is not successful.) The Tecnai PC has Windows 2000 (version 5.0, build 2195, service pack 2), Tecnai User Interface version 2.1.5 build 3235A - 1 Feb 2005, Gatan Digital Micrograph 3.9.2 for GMS 1.4.2, Gatan Filter Control 2.0.8 for GMS 1.4, Python and Python packages are as recommended. The F20 has two cameras - an Ultrascan 4000SP and a GIF. (Leginon 1.2.0 with pyScope 1.0.5 can be run successfully and DM generally has the US4000SP selected when running Leginon),
William
- Added by Anonymous over 18 years ago
By the way, I also verified that going back to pyScope 1.0.5 on the Windows client but staying with pyScope 1.0.6 on the main Leginon system works okay (at least I can successfully send presets - I have not done a full Leginon run with this setup yet). This is preferable to me as the main Leginon system is a laptop running SUSE 10.0 and I'm not sure if I have a copy of a pyScope 1.0.5 RPM that is suitable for SUSE 10.0. (I have an old pyScope 1.0.5 RPM with noarch in its name but also suse-9.3 in the name as well that may or may not be suitable),
William
- Added by Anonymous almost 18 years ago
I recently successfully upgraded to pyScope 1.0.6 by simply removing pyScope 1.0.5 and installing pyScope 1.0.6 on the Windows client (i.e. I didn't remove and re-install any of the prerequisites although that is recommended of course). I verified that I could send presets to the microscope okay now (which was the problem with the previous upgrade). This may be related to the situation at present that we are currently not running the GIF camera or related software (due to FEI investigating other problems - unrelated to Leginon - with the Gatan Filter Control intermittently crashing). So it is possible I may need to downgrade to pyScope 1.0.5 when we start running the GIF again. By the way, I am still using Leginon 1.2.0 - I haven't upgraded to Leginon 1.3.0 yet.
I may wait a bit before that upgrade to see if any problems with Leginon 1.3.0 emerge in the next couple of months although I'm interested if any known difficulties with Leginon 1.2.0 have been fixed (such as the intermittent problem with nodes deadlocking that seem to affect me fairly often when I attempt to run fully automatically).
Also, I was browsing bugzilla recently. The version numbers in the drop down list for searching or filing bugs for Leginon only go up to 1.1 (i.e. no 1.2 or 1.3) although they include Roman numeral versions I and II. Is the current version a sort of intermediate release of Roman numeral version II? Also, are versions 1.2 or 1.3 going to be added as versions that can be picked when filing Leginon bugs or searching for them?
William
- Added by Jim Pulokas almost 18 years ago
Let us know if pyScope 1.0.6 still works after you get your GIF back up. The problem with 1.0.6 is still a mystery to us, since we do not have a GIF to test it on. Caltech has been successfully running 1.0.6 with their GIF, so it is possible that the GIF installation is not consistent from one machine to another.
I would recommend trying out Leginon 1.3, just in case it fixes your problems. You can test it out without any risk, as long as your create a backup of your 1.2 database.
I agree that the Leginon versions listed in bugzilla are very unorganized and not up to date. I just added 1.2.0 and 1.3.0 to the list. I will eventually clean it up so that these are the only two choices. Anyone who wants to report a bug from something before 1.2.0 should probably just upgrade to find out if it has been fixed. Any unresolved bugs from versions before 1.2.0 will be reasigned to one of the recent versions if they have not been fixed yet. Feel free to modify any of your own bug reports in this way.
Jim
- Added by Anonymous almost 18 years ago
We got the GIF back up and pyScope 1.0.6 stopped working. Leginon worked again (i.e. could send and receive presets properly) when the Windows client had pyScope 1.0.6 uninstalled and pyScope 1.0.5 re-installed. I haven't tried upgrading to Leginon 1.3 yet,
William
"pulokas" wrote: Let us know if pyScope 1.0.6 still works after you get your GIF back up. The problem with 1.0.6 is still a mystery to us, since we do not have a GIF to test it on. Caltech has been successfully running 1.0.6 with their GIF, so it is possible that the GIF installation is not consistent from one machine to another.
I would recommend trying out Leginon 1.3, just in case it fixes your problems. You can test it out without any risk, as long as your create a backup of your 1.2 database.
- Added by Anonymous almost 18 years ago
By the way, the reason why the GIF software was re-installed is that the lab think that the problem with the GIF software has been identified and fixed (by engineers from FEI). It appears to be due to some issue with the Firewire driver or card as the Firewire card was replaced. (I don't know if it was a different brand or model of Firewire card),
William
"WVNicholson" wrote: problem with the previous upgrade). This may be related to the situation at present that we are currently not running the GIF camera or related software (due to FEI investigating other problems - unrelated to Leginon - with the Gatan Filter Control intermittently crashing). So it is possible I may need to downgrade to pyScope 1.0.5 when we start running the GIF again.
- Added by Jim Pulokas almost 18 years ago
William,
During a recent visit to UCSF, I was able to see a problem similar to what you are having with pyScope 1.0.6. When sending a preset to the scope, it would report the same error "unable to set instrument" but additionally it would report a more specific error regarding not being able to set the filter width of the GIF. I was able to use a hint from the following to help fix it:
http://ami/documentation/leginon/bk01ch14s05.php
In particular:
-Make sure EFTEM is always on
-If presets manager has error, disable then enable "Filtered" box in Tecnai/TUI/GIF> menu. (TUI: Tecnai User Interface)
After turning the "Filtered" option off and on a few times, and also messing around with this option directly from pyScope in a python command line, I was able to kick it into a working condition. I am not exactly sure what actually fixed it in the end.
This may be different from your problem, but I still think it is related to the GIF.
If you are willing to mess around with pyScope directly in a python command prompt, you may be able to figure out what exactly is causing your problem. Here is an example of some code you can test out. First you import the gatan module and create a Gatan object:
from pyScope import gatan g = gatan.Gatan()
Then try to get and set things on the Gatan object:
g.getDimension() g.setDimension({'x':512, 'y':512}) g.getEnergyFilter() g.setEnergyFilter(True)
For a complete list of available functions, you can look directly in the gatan.py module in pyScope. At UCSF, it was the setEnergyFilterWidth() function that was not working. I was able to use getEnergyfiltered() and setEnergyFiltered() to turn the "Filtered" status off and on a few times. Between doing that and also doing it from the Tecnai interface, the problem with EnergyFilterWidth somehow got fixed.
Let me know if you ever have a chance to try that out.
Jim
- Added by Anonymous over 17 years ago
I recently upgraded to Leginon v.1.3.0 with pyScope 1.0.6 on the Windows client system. I haven't been able to get the presets to work yet (but I haven't had much time to look at it). However, I did notice that I get the same two error messages - "unable to set instrument" and "unable to set energy filter width" that you describe now (rather than just "unable to set instrument" as before). Also, I'm not sure what the correct setting is for filtered in the presets. We have two cameras and I usually use the one without the GIF. So presumably I should have the filtering disabled in my final working version of the presets. I've tried turning the filtering on and off so far without success but I think it would be worth trying again,
William
http://ami/documentation/leginon/bk01ch14s05.php"pulokas" wrote: William,
During a recent visit to UCSF, I was able to see a problem similar to what you are having with pyScope 1.0.6. When sending a preset to the scope, it would report the same error "unable to set instrument" but additionally it would report a more specific error regarding not being able to set the filter width of the GIF. I was able to use a hint from the following to help fix it:
In particular:
-Make sure EFTEM is always on
-If presets manager has error, disable then enable "Filtered" box in Tecnai/TUI/GIF> menu. (TUI: Tecnai User Interface)
After turning the "Filtered" option off and on a few times, and also messing around with this option directly from pyScope in a python command line, I was able to kick it into a working condition. I am not exactly sure what actually fixed it in the end.
This may be different from your problem, but I still think it is related to the GIF.
If you are willing to mess around with pyScope directly in a python command prompt, you may be able to figure out what exactly is causing your problem. Here is an example of some code you can test out. First you import the gatan module and create a Gatan object:
from pyScope import gatan g = gatan.Gatan()
Then try to get and set things on the Gatan object:
g.getDimension() g.setDimension({'x':512, 'y':512}) g.getEnergyFiltered() g.setEnergyFiltered(True)
For a complete list of available functions, you can look directly in the gatan.py module in pyScope. At UCSF, it was the setEnergyFilterWidth() function that was not working. I was able to use getEnergyfilter() and setEnergyFilter() to turn the "Filtered" status off and on a few times. Between doing that and also doing it from the Tecnai interface, the problem with EnergyFilterWidth somehow got fixed.
Let me know if you ever have a chance to try that out.
Jim
- Added by Anonymous over 17 years ago
With the following simple script based on the recent suggestion:
#!/usr/bin/env python
from pyScope import gatan
g = gatan.Gatan()
g.getDimension()
g.setDimension({'x':512, 'y':512})
g.getEnergyFiltered()
g.setEnergyFiltered(True)
I get the following output:
./camtest.py
Traceback (most recent call last):
File "./camtest.py", line 5, in ?
g = gatan.Gatan()
File "/usr/lib/python2.4/site-packages/pyScope/gatan.py", line 32, in init
pythoncom.CoInitializeEx(pythoncom.COINIT_MULTITHREADED)
NameError: global name 'pythoncom' is not defined
I suspect this is a problem with needing some imports (rather than the original problem with presets and settings for energy filtering). I've already tried putting in some import statements without success. I may have more time to look at this later,
William
- Added by Anonymous over 17 years ago
By the way, is this test supposed to be run on the Windows client? Do I need to run the Leginon client while carrying out the test? I tried running the test again - this time on the Windows client (i.e. the microscope PC) and without running the Leginon client. It gave the following output this time:
Traceback (most recent call last):
File "C:\Documents and Settings\bmswvn\Desktop\camtest.py", line 10, in ?
g.setEnergyFiltered(True)
File "C:\Python24\Lib\site-packages\pyScope\gatan.py", line 65, in __getattrib
ute__
return object.__getattribute__(self, attr_name)
AttributeError: 'Gatan' object has no attribute 'setEnergyFiltered'
I get the same result when running the Leginon client. Also, I get the same result whichever of the two cameras is in use i.e. the same result for the US4000SP camera (without an energy filter) and the GIF camera (which has an energy filter),
William
"pulokas" wrote: example of some code you can test out. First you import the gatan module and create a Gatan object:
from pyScope import gatan g = gatan.Gatan()
Then try to get and set things on the Gatan object:
g.getDimension() g.setDimension({'x':512, 'y':512}) g.getEnergyFiltered() g.setEnergyFiltered(True)
For a complete list of available functions, you can look directly in the gatan.py module in
- Added by Anonymous over 17 years ago
Sorry, I forgot to mention that I choose between the two cameras by ticking the desired camera in the Camera sub-menu on the Camera menu in Digital Micrograph,
William
"WVNicholson" wrote:
I get the same result when running the Leginon client. Also, I get the same result whichever of the two cameras is in use i.e. the same result for the US4000SP camera (without an energy filter) and the GIF camera (which has an energy filter),
William
- Added by Anonymous over 17 years ago
I tried turning the filtering on and off in the preset again to see if that allows the presets to work but without success. I've given up and downgraded to pyScope 1.0.5 on the Windows client system again.
Hopefully the output I posted from the test program is informative,
William
"WVNicholson" wrote: I recently upgraded to Leginon v.1.3.0 with pyScope 1.0.6 on the Windows client system. I haven't been able to get the presets to work yet (but I haven't had much time to look at it). However, I did notice that I get the same two error messages - "unable to set instrument" and "unable to set energy filter width" that you describe now (rather than just "unable to set instrument" as before). Also, I'm not sure what the correct setting is for filtered in the presets. We have two cameras and I usually use the one without the GIF. So presumably I should have the filtering disabled in my final working version of the presets. I've tried turning the filtering on and off so far without success but I think it would be worth trying again,
William
- Added by Jim Pulokas over 17 years ago
William,
I probably would have figured this out sooner if we had an energy filter to test on...
The test script I gave you would not work in any case, because I screwed it up.
It should have been calling the functions:
g.getEnergyFilter() g.setEnergyFilter()
NOT
g.getEnergyFiltered() g.setEnergyFiltered()
(I'll edit my previous post to correct that)
Next time you get a chance to try the test script with pyScope 1.0.6, you should probably go ahead and add the other two energy filter functions to the test:
g.getEnergyFilterWidth()
g.setEnergyFilterWidth(somevalue) (not sure what somevalue should be)
If you still get errors in the test script, I have some more info on how this was fixed at UCSF. They had to modify the gatan.py module in pyScope to work with their version of the TecnaiCCD DLL (or DigitalMicrograph?)
In each of those energy filter functions in gatan.py (they are the last four functions in that module) there is a line like:
script = 'Exit(IFCGetSlitWidth())'
or something similar.
This script had to be modified for their version because some of the scripting functions had different names. These are the two that had to be changed:
script = 'Exit(AFGetSlitWidth())'
Becomes:
script = 'Exit(IFCGetSlitWidth())'
script = 'if(AFSetSlitWidth(%f)) Exit(1.0) else Exit(-1.0)'
Becomes:
script = 'if(IFSetSlitWidth(%f)) Exit(1.0) else Exit(-1.0)'
In other words, different versions of TecnaiCCD or DigitalMicrograph are inconsistent with the prefixes for the functions. It can be "AF", "IF", or "IFC"
If there are others that are giving you errors, you may need to change some of the other "script = " lines.
Also, there is a section at the top of gatan.py that looks like this:
self.script_functions = [ ('AFGetSlitState', 'getEnergyFilter'), ('AFSetSlitState', 'setEnergyFilter'), ('AFGetSlitWidth', 'getEnergyFilterWidth'), ('AFSetSlitWidth', 'setEnergyFilterWidth'), ('AFDoAlignZeroLoss', 'alignEnergyFilterZeroLossPeak'), ]
It seems like that would have to be modified as well, but UCSF did not mention that, so I'm not sure. You will have to experiment with it.
Let me know if you can get it to work.
Jim
- Added by Anonymous over 17 years ago
Okay, I tried this version of the script this time:
#!/usr/bin/env python
from pyScope import gatan
g = gatan.Gatan()
g.getDimension()
g.setDimension({'x':512, 'y':512})
g.getEnergyFilter()
g.setEnergyFilter(True)
print g.getEnergyFilterWidth()
g.setEnergyFilterWidth(10)
which gives the following output:
C:\Documents and Settings\bmswvn\Desktop>camtest2.py
Traceback (most recent call last):
File "C:\Documents and Settings\bmswvn\Desktop\camtest2.py", line 12, in ?
g.setEnergyFilterWidth(10)
File "C:\Python24\Lib\site-packages\pyScope\gatan.py", line 253, in setEnergyF
ilterWidth
raise RuntimeError('unable to set energy filter width')
RuntimeError: unable to set energy filter width
C:\Documents and Settings\bmswvn\Desktop>camtest2.py
0.0
Traceback (most recent call last):
File "C:\Documents and Settings\bmswvn\Desktop\camtest2.py", line 12, in ?
g.setEnergyFilterWidth(10)
File "C:\Python24\Lib\site-packages\pyScope\gatan.py", line 253, in setEnergyF
ilterWidth
raise RuntimeError('unable to set energy filter width')
RuntimeError: unable to set energy filter width
C:\Documents and Settings\bmswvn\Desktop>
I decided to print the output from getEnergyFilterWidth because I wanted to see what was a sensible value. (The value 10 was borrowed from the value from inspection in Gatan's Filter Control.) I tried setting the energy filter width to 0 as well by editting the above script and it gave the same output. So getting the filter width seems to work but setting it does not. I'm not sure if that fits in with the incorrect function names explanation. Surely if the Tecnai scripting API was different on different microscope PCs for some reason (like different releases of the software being installed) then all the affected functions would change the same way.
By the way, I'm interested in installing Java on our microscope PC but I'm not sure what release would be best? I know that Javascript works with Tecnai scripting or at least I have tried it by writing some very basic Tecnai scripting programs in Javascript. Java may have better facilities for reflection than Javascript so it may be more useful for pulling out the method names for the relevant object if that's helpful.
Another worry is I'm not sure it makes sense to attempt to set the energy filter width when I'm not using the GIF camera. (Instead I'm using the US4000SP camera which can't be used with image filtering using the GIF.) Could that be what's causing problems in pyScope?
William
"pulokas" wrote: William,
It should have been calling the functions:
g.getEnergyFilter() g.setEnergyFilter()
Next time you get a chance to try the test script with pyScope 1.0.6, you should probably go ahead and add the other two energy filter functions to the test:
g.getEnergyFilterWidth()
g.setEnergyFilterWidth(somevalue) (not sure what somevalue should be)
If you still get errors in the test script, I have some more info on how this was fixed at UCSF. They had to modify the gatan.py module in pyScope to work with their version of the TecnaiCCD DLL (or DigitalMicrograph?)
In each of those energy filter functions in gatan.py (they are the last four functions in that module) there is a line like:
script = 'Exit(IFCGetSlitWidth())'
or something similar.
This script had to be modified for their version because some of the scripting functions had different names. These are the two that had to be changed:
script = 'Exit(AFGetSlitWidth())'
Becomes:
script = 'Exit(IFCGetSlitWidth())'
script = 'if(AFSetSlitWidth(%f)) Exit(1.0) else Exit(-1.0)'
Becomes:
script = 'if(IFSetSlitWidth(%f)) Exit(1.0) else Exit(-1.0)'
- Added by Anonymous over 17 years ago
I made the suggested changes to these lines:
script = 'Exit(AFGetSlitWidth())'
script = 'if(AFSetSlitWidth(%f)) Exit(1.0) else Exit(-1.0)'
and also this extra line:
script = 'if(AFDoAlignZeroLoss()) Exit(1.0) else Exit(-1.0)'
by changing the AF's into IFC's. This allows the later version of the test Python script to run without throwing any exceptions (and just printing out the line from the print statement). If I change the AF's in the earlier code beginning "self_script_functions" then the test script runs with a different error:
C:\Documents and Settings\bmswvn\Desktop>camtest2.py
Traceback (most recent call last):
File "C:\Documents and Settings\bmswvn\Desktop\camtest2.py", line 9, in ?
g.getEnergyFilter()
File "C:\Python24\lib\site-packages\pyScope\gatan.py", line 64, in __getattri
ute__
raise AttributeError('attribute not supported')
AttributeError: attribute not supported
C:\Documents and Settings\bmswvn\Desktop>
Also, I tried running without my extra change to the line with AFDoAlignZeroLoss and the test script still runs okay providing the changes to the other two lines are there (but not the changes to the block of code with "self_scripting_functions"); but I suppose the test script does not test the relevant function anyway,
William
"pulokas" wrote: was fixed at UCSF. They had to modify the gatan.py module in pyScope to work with their version of the TecnaiCCD DLL (or DigitalMicrograph?)
In each of those energy filter functions in gatan.py (they are the last four functions in that module) there is a line like:
script = 'Exit(IFCGetSlitWidth())'
or something similar.
This script had to be modified for their version because some of the scripting functions had different names. These are the two that had to be changed:
script = 'Exit(AFGetSlitWidth())'
Becomes:
script = 'Exit(IFCGetSlitWidth())'script = 'if(AFSetSlitWidth(%f)) Exit(1.0) else Exit(-1.0)'
Becomes:
script = 'if(IFSetSlitWidth(%f)) Exit(1.0) else Exit(-1.0)'In other words, different versions of TecnaiCCD or DigitalMicrograph are inconsistent with the prefixes for the functions. It can be "AF", "IF", or "IFC"
If there are others that are giving you errors, you may need to change some of the other "script = " lines.
Also, there is a section at the top of gatan.py that looks like this:
self.script_functions = [ ('AFGetSlitState', 'getEnergyFilter'), ('AFSetSlitState', 'setEnergyFilter'), ('AFGetSlitWidth', 'getEnergyFilterWidth'), ('AFSetSlitWidth', 'setEnergyFilterWidth'), ('AFDoAlignZeroLoss', 'alignEnergyFilterZeroLossPeak'), ]
It seems like that would have to be modified as well, but UCSF did not mention that, so I'm not sure. You will have to experiment with it.
- Added by Anonymous over 17 years ago
I just noticed that there's another change in the output apart from not getting errors when running with the "fixed" version of gatan.py. The test script outputs the value 10.0 rather than 0.0 when getting the energy filter width. The output value does not seem to be affected by previous runs of the (editted) script that attempt to set the energy filter width to different values,
William
"WVNicholson" wrote: by changing the AF's into IFC's. This allows the later version of the test Python script to run without throwing any exceptions (and just printing out the line from the print statement).
- Added by Anonymous over 17 years ago
Also, I do appear to be able to successfully use Leginon (1.3) to send presets to the microscope now with pyScope 1.0.6 installed on the microscope PC with the changes to gatan.py.
By the way, the original version of gatan.py (not fixed, at least to run in Leeds) seems to have a mixture of the lines with the "AF" prefix and "IFC" prefix (even ignoring the block of code with "self_scripting_functions" that seems to need the "AF" prefixes) i.e. in getEnergyFilter it already has the IFC prefix in "IFCGetSlitIn" and in setEnergyFilter it has "IFCSetSlitIn",
William
"WVNicholson" wrote: I just noticed that there's another change in the output apart from not getting errors when running with the "fixed" version of gatan.py. The test script outputs the value 10.0 rather than 0.0 when getting the energy filter width. The output value does not seem to be affected by previous runs of the (editted) script that attempt to set the energy filter width to different values,
William"WVNicholson" wrote: by changing the AF's into IFC's. This allows the later version of the test Python script to run without throwing any exceptions (and just printing out the line from the print statement).
- Added by Anonymous over 17 years ago
I just noticed that I get an error in the Results window of Digital Micrograph when running the test Python script with the supposedly fixed version of gatan.py (that however does seem to allow presets to work properly with pyScope 1.0.6). The offending line appears to be:
g.setEnergyFilterWidth(10)
as the error in DM disappears if I comment the line out. The errors from DM are:
Line 1: No match for if( void, void, void )
Potential matches are
void if( RealNumber, Expression )
void if( RealNumber, Expression, Expression )
William
"WVNicholson" wrote: Also, I do appear to be able to successfully use Leginon (1.3) to send presets to the microscope now with pyScope 1.0.6 installed on the microscope PC with the changes to gatan.py.
Tecnai or DM scripting question - Added by Anonymous over 17 years ago
By the way, does the code in pyScope use Tecnai or DM scripting in order to access the camera?
William
- Added by Anonymous over 17 years ago
IFCSetSlitWidth appears to return void which is not expected by an if statement in the DM scripting language (which is where it ends up?) and I have replaced the following line in gatan.py:
script = 'if(IFCSetSlitWidth(%f)) Exit(1.0) else Exit(-1.0)'
with:
script = 'IFCSetSlitWidth(%f)\nExit(1.0)'
I'm not sure if the Exit is really necessary. It ought to execute though as I confirmed another command placed after the "\n" will execute by outputting a message with the DM scripting function Result,
William
"WVNicholson" wrote: I just noticed that I get an error in the Results
window of Digital Micrograph when running the test Python script with the supposedly fixed version of gatan.py (that however does seem to allow presets to work properly with pyScope 1.0.6). The offending line appears to be:g.setEnergyFilterWidth(10)
as the error in DM disappears if I comment the line out. The errors from DM are:
Line 1: No match for if( void, void, void )
Potential matches are
void if( RealNumber, Expression )
void if( RealNumber, Expression, Expression )William
"WVNicholson" wrote: Also, I do appear to be able to successfully use Leginon (1.3) to send presets to the microscope now with pyScope 1.0.6 installed on the microscope PC with the changes to gatan.py.