|
Package SIMION ::
Module PA
|
|
Module SIMION.PA
pa.py Python module for reading/writing/manipulating SIMION potential
arrays.
DESCRIPTION
This module is for manipulating SIMION potential array (PA/PA?)
files (including creating, loading, modifying, and saving). See
Appendix D-5 of the SIMION 7.0 manual for the PA file format
specification.
This modules is intended to be very robust and has been put through
an extensive test suite. It is also intended to be simple to use and
very Pythonic. The module is, however, not as fast as the corresponding
C++ implementation, even though speed has been considered, so use the
C++ implementation if speed is critical.
SYNOPSIS
>>> from SIMION.PA import *
>>>
>>>
>>> pa = PA(file = 'buncher.pa#')
>>>
>>> print pa.header_string()
>>>
>>> pa2 = PA(nx = 100, ny = 20, symmetry = 'cylindrical')
>>>
>>> z = 0
>>> for x in range(0, pa.nx()):
... for y in range(0, pa.ny()):
... inside = (x + y < 10)
... if inside:
... pa.point(x, y, z, 1, 5.0)
>>> pa2.save('cone.pa#')
>>>
>>> pa3 = PA(nx = 50, ny = 50, field_type = 'magnetic')
>>> z = 0
>>> for x in range(0, pa.nx()):
>>> for y in range(0, pa.ny()):
>>> ex = x
>>> ey = y**2
>>> ez = 0
>>> pa3.field(x, y, z, ex, ey, ez)
>>> pa3.save('mag1.pa')
AUTHOR
David Manura (c) 2003-2004 Scientific Instrument Services, Inc.
Licensed under the terms of the SIMION SL Toolkit. $Revision: 1.4 $
$Date: 2004/07/20 04:11:42 $ Created 2003-11.
| Classes |
PA |
This is a Python class for reading/writing/modifying SIMION potential
arrays. |
|