Project

General

Profile

JEOL setup » History » Version 9

Neil Voss, 03/02/2012 12:17 PM

1 1 Neil Voss
h1. JEOL setup
2
3 8 Neil Voss
h2. more info
4
5
http://cryoem.nysbc.org/CemRobotics.html
6
7 2 Neil Voss
h2. instruments.cfg
8 1 Neil Voss
9
<pre>
10
[TEM]
11
class: jeol1230.jeol1230
12 2 Neil Voss
</pre>
13
14
h2. Testing pyscope instrument script functions
15
16
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:
17
18
<pre>
19
import pyscope.registry
20 6 Neil Voss
s = pyscope.registry.getClass('jeol1230')()
21 2 Neil Voss
s.getMagnifications()
22 1 Neil Voss
</pre>
23 3 Neil Voss
24 4 Neil Voss
h2. Potential problems
25
26 7 Neil Voss
h3. import serial
27
28 3 Neil Voss
<pre>
29
>>> import pyscope.registry
30
Traceback (most recent call last):
31
  File "<stdin>", line 1, in <module>
32
  File "c:\Python25\Lib\site-packages\pyscope\registry.py", line 9, in <module>
33
    import config
34
  File "c:\Python25\Lib\site-packages\pyscope\config.py", line 39, in <module>
35
    mod = imp.load_module(fullmodname, *args)
36
  File "c:\Python25\Lib\site-packages\pyscope\jeol1230.py", line 8, in <module>
37
    from pyscope import jeol1230lib
38
  File "c:\Python25\Lib\site-packages\pyscope\jeol1230lib.py", line 8, in <module>
39
    import serial
40
ImportError: No module named serial
41
>>>
42
</pre>
43 4 Neil Voss
44 5 Neil Voss
you need to install "Python Serial Port Extensions" http://pypi.python.org/pypi/pyserial
45 7 Neil Voss
46
h3. defocus.cfg
47
48
<pre>
49
>>> import pyscope.registry
50
>>> s = pyscope.registry.getClass('jeol1230')()
51
Traceback (most recent call last):
52
  File "<stdin>", line 1, in <module>
53
  File "c:\Python25\Lib\site-packages\pyscope\jeol1230.py", line 27, in __init__
54
    self.jeol1230lib = jeol1230lib.jeol1230lib()
55
  File "c:\Python25\Lib\site-packages\pyscope\jeol1230lib.py", line 25, in __init__
56
    self.zeroDefocus = self.readZeroDefocus()
57 1 Neil Voss
  File "c:\Python25\Lib\site-packages\pyscope\jeol1230lib.py", line 35, in readZeroDefocus
58
    infile = open(self.defocusFile,"r")
59
IOError: [Errno 2] No such file or directory: 'C:\\Python25\\Lib\\site-packages\\pyScope\\defocus.cfg'
60 9 Neil Voss
>>>
61
</pre>
62
63
create an empty file called defocus.cfg
64
65
h3. serial port permissions
66
67
<pre>
68
>>> import pyscope.registry
69
>>> s = pyscope.registry.getClass('jeol1230')()
70
Traceback (most recent call last):
71
  File "<stdin>", line 1, in <module>
72
  File "c:\python25\Lib\site-packages\pyscope\jeol1230.py", line 27, in __init__
73
    self.jeol1230lib = jeol1230lib.jeol1230lib()
74
  File "c:\python25\Lib\site-packages\pyscope\jeol1230lib.py", line 25, in __init__
75
    self.zeroDefocus = self.readZeroDefocus()
76
  File "c:\python25\Lib\site-packages\pyscope\jeol1230lib.py", line 37, in readZeroDefocus
77
    line = lines[0]
78
IndexError: list index out of range
79 7 Neil Voss
>>>
80
</pre>