INSTALLING THE YALE SET_CURRENT PROGRAM FOR THE VISTEC EBPG version 5.0 Set_current.py for the EBPG sets the beam current by interpolating a table of (C1, C2, I) values. 1. Save (or copy) the archive file current.tar to the EBPG directory /home/pg/bin 2. Unpack the archive with (from a terminal command window of course) tar xvf current.tar 3. Confirm that the files are there ls *.py *.dat *.gz You should see a listing of set_current.py c1c2cur.dat peek.py scipy-0.11.0b1.tar.gz numpy-1.6.2.tar.gz The file c1c2cur.dat must be in /home/pg/bin 4. Are the python libraries scipy and numpy already installed on your machine? You can check by firing up python in a terminal and typing (but don't type ">>>" since that's the python prompt.) python >>> import numpy >>> import scipy >>> ^D If you see "No module named..." then proceed to steps 5 and 6. If the prompt >>> simply reappears, then you are good to go directly to step 7. The numpy and scipy libraries are included here just for your convenience. For the latest and greatest versions, visit http://numpy.scipy.org/ Do you really need the latest version? Not likely. 5. Install numpy su (become super-user and enter password) cd /usr/local/bin (suggested location) mv /home/pg/bin/numpy* . (dot means "here") tar xvzf numpy-1.6.2.tar.gz ... (stuff prints out) cd numpy-1.6.2 python setup.py build --fcompiler=gnu ... (you are actually using fortran!) python setup.py install ... Now test it: python >>> import numpy >>> ^D 6. Install scipy su (become super-user and enter password) cd /usr/local/bin (suggested location) mv /home/pg/bin/scipy* . (dot means "here") tar xvzf scipy-0.11.0b1.tar.gz ... (stuff prints out) cd scipy-0.11.0b1 python setup.py install ... Now test it: python >>> import scipy >>> ^D 7. Make sure set_current.py is executable cd /home/pg/bin chmod a+x current.py Create an alias in /home/pg/local_commands or in /etc/bashrc by inserting the line alias set_current="/home/pg/bin/set_current.py" 8. Try them out; for example set_current 10.5 The file c1c2cur.dat contains values of lens 1, lens 2, and beam current. If your EBPG system differs from the one at Yale, then you can create a better set of values with the script peek.py, which loads each 300um archive file and extracts your local values. The presumption is that your local archive files have fairly good lens 2 values so that conjugate blanking is optimal. If that's not the case, then you should first optimize C2 values with the program tweakc2.py. So much work! Newer EBPGs use 16 bit DACs for the lens drivers, and so the numerical values for C1 and C2 are very different from those of older systems. Comments in set_current.py tell you how to set more appropriate values for the limits and "safe" lens settings. If you have a lot of disfunctional and dubious archive files, then you should start by deleting them all. You can start with just a few archive files that were setup manually with the 300um aperture; e.g. 0.5 nA, 100 nA, 10 nA, 50 nA. The precise values of beam current are not very important, as long as they cover the full range. Be sure to use tweakc2 after setting C1 and C2, so that the conjugate blanking will be optimal. Next, use peek.py to extract C1 and C2 values from these initial archives. These values will be used for a quadratic interpolation. If the interpolation fails, it may be due to a crappy set of initial archives. set_current will not work well at the very low or very high ends. Sorry. You'll have to set up 0.5 nA and 100 nA (300 um) manually.