ScatPy is a Python package for interfacing to the popular scattering simulator DDSCAT. ScatPy provides a rich toolset to:
An example
from ScatPy import *
# Establish target geometry (in um)
length = 0.100
radius = 0.020
target = targets.CYLNDRCAP(length, radius, d=0.005, material='Au_Palik.txt')
# Create a job to be run in the subdirectory tmp/
job = DDscat(folder = './tmp', target=target)
# Change the range of calculated wavelengths and ambient index
job.settings.wavelengths = ranges.How_Range(0.300, 0.600, 15)
job.settings.NAMBIENT = 1.0
# Run the job locally
job.calculate()
# Open the results qtable, plot Q_sca, and Q_abs, and add a legend
ans = results.QTable(folder = './tmp')
ax = ans.plot(['Q_sca', 'Q_abs'])
ax.legend(loc=0)
(Source code, png, hires.png, pdf)
For Windows users this is most easily done by installing Python (x,y).
Python(x,y)):
Visualizing targets in 3D also requires:
Download ScatPy from PyPi
Unzip the package and run python setup.py install from the command line.
Start Python and type import ScatPy. If you don’t recieve any import warnings then you’re ready to go.
Once you have ScatPy installed, start by reading the User’s Guide and reviewing the Examples. More advanced users will benefit from referring to the The ScatPy API.
Work on ScatPy was carried out at the Max Planck Institute for Intelligent Systems, under funding provided by the DPG.
If this code contributes to a publication, please cite:
A.G. Mark, S. Eslami, and P. Fischer; Python code for interacting with DDSCAT.
Available at https://pypi.python.org/pypi/ScatPy.
ScatPy is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.