Table Of Contents

Next topic

User’s Guide

This Page

Welcome to ScatPy’s documentation!

Introduction

ScatPy is a Python package for interfacing to the popular scattering simulator DDSCAT. ScatPy provides a rich toolset to:

  • Create standard DDSCAT scattering targets based on physical (rather than dipole) dimensions
  • Construct and visualize complex custom scattering targets
  • Manage the job parameters found in the ddscat.par file
  • Organize iterative jobs requiring multiple targets or input parameters
  • Script job submission to cluster queue managers
  • Maintain profiles and defaults for deployment on platforms other than the local machine
  • Load, plot and manipulate DDSCAT output tables
  • Manage the output from multiple jobs through results collections
  • Work with and visualize nearfield results as multidimensional numpy arrays
  • Suitable for interactive or scripted use

A Simple Example

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)

_images/example1.png

Installation

  1. Start by getting a working version of Python.

    For Windows users this is most easily done by installing Python (x,y).

  2. ScatPy has the following mandatory dependency (it’s installed as standard by

    Python(x,y)):

    Visualizing targets in 3D also requires:

  3. Download ScatPy from PyPi

  4. Unzip the package and run python setup.py install from the command line.

  5. Start Python and type import ScatPy. If you don’t recieve any import warnings then you’re ready to go.

Getting Started

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.

Acknowledgements and Citing

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.

License

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/>.

Indices and tables