JEOL setup » History » Version 7
Neil Voss, 03/02/2012 12:03 PM
1 | 1 | Neil Voss | h1. JEOL setup |
---|---|---|---|
2 | |||
3 | 2 | Neil Voss | h2. instruments.cfg |
4 | 1 | Neil Voss | |
5 | <pre> |
||
6 | [TEM] |
||
7 | class: jeol1230.jeol1230 |
||
8 | 2 | Neil Voss | </pre> |
9 | |||
10 | h2. Testing pyscope instrument script functions |
||
11 | |||
12 | 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: |
||
13 | |||
14 | <pre> |
||
15 | import pyscope.registry |
||
16 | 6 | Neil Voss | s = pyscope.registry.getClass('jeol1230')() |
17 | 2 | Neil Voss | s.getMagnifications() |
18 | 1 | Neil Voss | </pre> |
19 | 3 | Neil Voss | |
20 | 4 | Neil Voss | h2. Potential problems |
21 | |||
22 | 7 | Neil Voss | h3. import serial |
23 | |||
24 | 3 | Neil Voss | <pre> |
25 | >>> import pyscope.registry |
||
26 | Traceback (most recent call last): |
||
27 | File "<stdin>", line 1, in <module> |
||
28 | File "c:\Python25\Lib\site-packages\pyscope\registry.py", line 9, in <module> |
||
29 | import config |
||
30 | File "c:\Python25\Lib\site-packages\pyscope\config.py", line 39, in <module> |
||
31 | mod = imp.load_module(fullmodname, *args) |
||
32 | File "c:\Python25\Lib\site-packages\pyscope\jeol1230.py", line 8, in <module> |
||
33 | from pyscope import jeol1230lib |
||
34 | File "c:\Python25\Lib\site-packages\pyscope\jeol1230lib.py", line 8, in <module> |
||
35 | import serial |
||
36 | ImportError: No module named serial |
||
37 | >>> |
||
38 | </pre> |
||
39 | 4 | Neil Voss | |
40 | 5 | Neil Voss | you need to install "Python Serial Port Extensions" http://pypi.python.org/pypi/pyserial |
41 | 7 | Neil Voss | |
42 | h3. defocus.cfg |
||
43 | |||
44 | <pre> |
||
45 | C:\Python25>c:\Python25\python.exe |
||
46 | Python 2.5.4 (r254:67916, Dec 23 2008, 15:10:54) [MSC v.1310 32 bit (Intel)] on win32 |
||
47 | Type "help", "copyright", "credits" or "license" for more information. |
||
48 | >>> import pyscope.registry |
||
49 | >>> s = pyscope.registry.getClass('jeol1230')() |
||
50 | Traceback (most recent call last): |
||
51 | File "<stdin>", line 1, in <module> |
||
52 | File "c:\Python25\Lib\site-packages\pyscope\jeol1230.py", line 27, in __init__ |
||
53 | self.jeol1230lib = jeol1230lib.jeol1230lib() |
||
54 | File "c:\Python25\Lib\site-packages\pyscope\jeol1230lib.py", line 25, in __init__ |
||
55 | self.zeroDefocus = self.readZeroDefocus() |
||
56 | File "c:\Python25\Lib\site-packages\pyscope\jeol1230lib.py", line 35, in readZeroDefocus |
||
57 | infile = open(self.defocusFile,"r") |
||
58 | IOError: [Errno 2] No such file or directory: 'C:\\Python25\\Lib\\site-packages\\pyScope\\defocus.cfg' |
||
59 | >>> |
||
60 | </pre> |