Project

General

Profile

Actions

JEOL setup » History » Revision 7

« Previous | Revision 7/10 (diff) | Next »
Neil Voss, 03/02/2012 12:03 PM


JEOL setup

instruments.cfg

[TEM]
class: jeol1230.jeol1230

Testing pyscope instrument script functions

On the instrument host of the instrument, a TEM host that uses Tecnai class, for example, you can launch python command line window and try to create an instance of the instrument and then call a function such as getMagnifications in that like this:

import pyscope.registry
s = pyscope.registry.getClass('jeol1230')()
s.getMagnifications()

Potential problems

import serial

>>> import pyscope.registry
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "c:\Python25\Lib\site-packages\pyscope\registry.py", line 9, in <module>
    import config
  File "c:\Python25\Lib\site-packages\pyscope\config.py", line 39, in <module>
    mod = imp.load_module(fullmodname, *args)
  File "c:\Python25\Lib\site-packages\pyscope\jeol1230.py", line 8, in <module>
    from pyscope import jeol1230lib
  File "c:\Python25\Lib\site-packages\pyscope\jeol1230lib.py", line 8, in <module>
    import serial
ImportError: No module named serial
>>>

you need to install "Python Serial Port Extensions" http://pypi.python.org/pypi/pyserial

defocus.cfg

C:\Python25>c:\Python25\python.exe
Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import pyscope.registry
>>> s = pyscope.registry.getClass('jeol1230')()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "c:\Python25\Lib\site-packages\pyscope\jeol1230.py", line 27, in __init__
    self.jeol1230lib = jeol1230lib.jeol1230lib()
  File "c:\Python25\Lib\site-packages\pyscope\jeol1230lib.py", line 25, in __init__
    self.zeroDefocus = self.readZeroDefocus()
  File "c:\Python25\Lib\site-packages\pyscope\jeol1230lib.py", line 35, in readZeroDefocus
    infile = open(self.defocusFile,"r")
IOError: [Errno 2] No such file or directory: 'C:\\Python25\\Lib\\site-packages\\pyScope\\defocus.cfg'
>>>

Updated by Neil Voss over 12 years ago · 7 revisions