Revision as of 09:49, 20 July 2017 by JulienLhermitte (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

ScatterSim API

(Work in progress)

This page documents the general API for the ScatterSim code.


In general, the objects in the ScatterSim code used to generate simulations are either:

  1. NanoObject : the base object
  2. CompositeNanoObject : an arrangement of NanoObject objects
  3. Lattice objects : NanoObjects that are assembled into a lattice.

NanoObjects or Composite NanoObjects

Each of these elements is initialized by calling their initialization class. To initialize a NanoObject or CompositeNanoObject, potential arguments must be supplied:

from ScatterSim.NanoObjects import SphereNanoObject
pargs = {"radius" : 10}
sphere = SphereNanoObject(pargs=pargs)

where pargs is a dictionary containing the parameters that describe the system. Here, a SphereNanoObject only requires a radius as a parameter. Other more complex objects, like CylinderNanoObject may require more parameters (such as height in this case).

Creating a new CompositeNanoObject

Sometimes the objects available are not enough and a more complex objects is needed. Objects may be compounded into more complex NanoObject objects by creating a new CompositeNanoObject.



Any object's canonical rotation is described in its docstring. From there, it is possible to re-orient it.

The orientation is defined with the following parameters

  • x0, y0, z0 : the z y and z position with respect to the object's internal reference frame
  • eta, theta, phi : the Euler angles. THe rotations are defined as follows:
       Three-axis rotation:
           1. Rotate about +z by eta (counter-clockwise in x-y plane)
           2. Tilt by phi with respect to +z (rotation about y-axis,
           clockwise in x-z plane) then
           3. rotate by theta in-place (rotation about z-axis,
           counter-clockwise in x-y plane)