| |
- __builtin__.list(__builtin__.object)
-
- WavePointSet
- __builtin__.object
-
- Moments
- MomentsFixed
- optics.ray.Position(vector.Vector3d)
-
- Psf
- optics.surface.ImagePlane(optics.surface.OpticalPlane)
-
- TargetPlane
- vector.Vector2d(__builtin__.object)
-
- WavePoint
class Moments(__builtin__.object) |
|
Class to implment two dimensional moments |
|
Methods defined here:
- __init__(self, order=2)
- Constructor with order only, defaults to 2
- addPoint(self, p, value)
- Method to add a point
- addRay(self, ray, plane)
- Method add ray or raypencil in speficied place
- centroid(self)
- get(self, m, n)
- Method to get a momment value
- radius(self)
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class MomentsFixed(__builtin__.object) |
|
Class to implment two dimensional moments |
|
Methods defined here:
- __init__(self)
- Constructor with order only, defaults to 2
- addPoint(self, p, value)
- Method to add a point
- addRay(self, ray, plane)
- Method add ray or raypencil in speficied place
- centroid(self)
- radius(self)
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class Psf(optics.ray.Position) |
|
Class to represent a geometric Psf |
|
- Method resolution order:
- Psf
- optics.ray.Position
- vector.Vector3d
- __builtin__.object
Methods defined here:
- __init__(self, pos=ray.Position(0.0000e+00 , 0.0000e+00, 0.0000e+00), intensity=1.0, a=1.0, b=None, alpha=0.0)
- Form Psf with parameters
param pos the position in 3d
param a radius or major axis
param b (default None),
param alpha angle of ellipse
- __repr__(self)
- Implement repr()
- area(self)
- Area of PSF
- draw(self)
- eccentricity(self)
- Eccenricity of the ellipse
- optimalArea(self, pencil, plane)
- Method to find the optimal area PSF from a raypencil starting
as the guess locaion plane
- setWithRays(self, pencil, plane)
- Set PSF from RayPencil in specified plane
Methods inherited from optics.ray.Position:
- copy(self)
- Return a copy of the current Position.
- propagate(self, u, d)
- Propagate current Position a distance directions specifed by Director.
param u the Director
param d float the distance
param return True if successful, else False if either current or
Director is inValid.
Methods inherited from vector.Vector3d:
- __abs__(self)
- Implement abs() to return the abs length of Vector3d as a float.
- __add__(self, b)
- Implement c = self + b for Vector3d, if b is float, then it will be added to
each component.
returns new Vector3d
- __div__(self, b)
- Implement c = self / b for Vector3d, if b is float it will divide each element
- __ge__(self, b)
- Implement >= to compare abs() of each vector
- __getitem__(self, key)
- Implement indexing on read in [i] syntax.
- __gt__(self, b)
- Implement > to compare abs() of each vectors
- __iadd__(self, v)
- Method to implement the += to add Vector3d to current in place, if v is a
Vectord3d the components will be added, while if it is a float it will be
added to each component.
- __idiv__(self, v)
- Method to implement the /= to divide current vector in place, if v is a
Vectord3d the components will be devided, while if it is a float it will
divide each component.
- __imul__(self, v)
- Method to implement the *= to multiply Vector3d by current in place, if v is a
Vectord3d the components will be multiplied, while if it is a float it will
multiply each component.
- __isub__(self, v)
- Method to implement the -= to subtract Vector3d from current in place, if v is
a Vectord3d the components will be subtrated, while if it is a float it will
be subrtacted from each component.
- __le__(self, b)
- Implement <= to compare abs() of each vector.
- __len__(self)
- Get len() defined at 3
- __lt__(self, b)
- Implement < to compare abs() of each vector.
- __mul__(self, b)
- Implement c = self * b for Vectors3d, if b is float it will multiply each element.
return new Vector3d
- __neg__(self)
- Implement the __neg__ method to return a new vector being the -ve of the current.
Note current not changed.
- __nonzero__(self)
- Implement the logical no-zero test if a vector is valid. True is self.n != Nan
- __radd__(self, b)
- Impement c = b + self for b not a Vector3d, (typically a float)
returns new Vector3d
- __rdiv__(self, b)
- Implement c = b / self for Vector3d, if b is float it will divide each element
- __rmul__(self, b)
- Implement c = b * self for Vector3d, if b is float it will multiply each element.
- __rsub__(self, b)
- Implement c = b - self for Vector3d, if b is float it will be subtracted
from each element.
returns new Vector3d
- __setitem__(self, key, value)
- Implement indexing on write in s[i] syntax.
- __str__(self)
- Implement str() with componets fommatted with 8.4e
- __sub__(self, b)
- Implement c = self - b for Vector3d, if b is float it will be subtracted
from each element.
returns new Vector3d
- abs(self)
- Return the abs of the Vector3d as a float.
- absCube(self)
- Return the absCube of the Vector3d as a float defined as
abs(x**3) + abs(y**3) + abs(z**3). Note does NOT use pow or **3
- absNormalised(self)
- Method to return abs() and normalsied copy of current vector as a
list pair (current vector not changed)
return [a,n] where a abs() and n is normalsied Vector3d
- absSquare(self)
- Return the absSquare of the vector3d as a float. Note does NOT use pow or **2
- angleBetween(self, b)
- Method to get the angle between two Vector3d
param b Vector3d second Vector3d
return float, angle in range -pi/2 and pi
Note: is abs(current) and abs(b) is zero, zero is returned.
- areaBetween(self, b)
- Method to get the area between two Vectors3d defined by a = 0.5 * abs (self x b)
param b Vector3d second Vector3d
return float, area defined by triangle formed by the two vectors
- cross(self, b)
- Method to form the cross product c = self x b
return Vector3d the cross product
- distance(self, b)
- Method to det the distance between two Vector3d
param b second Vector3d
return float distance between two vectors.
- distanceCube(self, b)
- Method to get distanceCube between two Vector3d, defined by sum |a.i - b.i|^3.
Note does NOT use **2 or pow.
param b the second Vector3d
return float the cube of the distance between vectors.
- distanceSquare(self, b)
- Method to get distanceSquare between two Vector3d, Note does NOT use **2 or pow.
param b the second Vector3d
return float the square of the distance between vectors
- dot(self, b)
- Method to form the .dot product of self . b
returns float the dot product.
- errorSquare(self, b)
- Method to get the normalsied square error between two Vector3d
param b Vector3d, the second vector
return float the normalsied square error
- inverseSquare(self, b)
- Method to get the Vector3d from current to Vector3d b scaled by inverse square of
the distance between them, for implementation of inverse square law forces.
Formula implements is v = (b - self) |b - self |^3
param b Vector3d, the second vector.
returned Vectors3d the scaled vector
- isValid(self)
- Method to test if vector is Valid
returns True for Valid, else False
- negate(self)
- Method to negate the current vector in place.
- normalise(self)
- Method to normalised vector in place.
Note: if abs() = 0, the current vector will be set inValid()
- polar(self)
- Return a copy of current vector in polar (r,theta,psi) form.
- rect(self)
- Return a copy of the current vector in rect (x,y,z) form from current assume to
be in polar (r,theta,psi) form.
Note: there is no error checking, so if the current Vector is NOT in polar
form you will get rubbish.
- rotate(self, alpha, beta, gamma)
- Method to implmeent general Rotate about x , y, z in place.
The rotation order is x,y then z.
param alpha rotation about x axis in radians
param beta rotation about y axis in radians
param gamma rotation about z axis in radians
- rotateAboutX(self, alpha)
- Method to implementate rotation about x axis in place.
param alpha rotatian about x axis in radians
- rotateAboutY(self, beta)
- Method to implementate a rotation about y axis in place.
param beta rotatian about y axis in radians.
- rotateAboutZ(self, gamma)
- Method to implementate a rotation about z axis in place.
param gamma rotatian about z axis in radians.
- round(self, figs=0)
- Method to round the current Vector2d to number of decimal figures.
param figs number of figures to round to (default is 0)
- set(self, x_or_v=0.0, y=0.0, z=0.0)
- Method to set vector with various augument types.
param x_or_v float x component (default = 0.0)
param y float y component (default = 0.0)
param z float z component (default = 0.0)
OR
param x_or_v Vector3d, all three componets copied
OR
param x_or_v list, [0] = 1, [1] = y, [2] = z
- setInvalid(self)
- Method to set current vector3d to Invalid by setting all three
compoents to float("nan").
- setLength(self, d)
- Method to set the length (or abs) of the current vector to specified length
by scaling.
param d float length vector is set to.
Data descriptors inherited from vector.Vector3d:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class TargetPlane(optics.surface.ImagePlane) |
|
For a target plane, being at ImagePlane with target points or various types |
|
- Method resolution order:
- TargetPlane
- optics.surface.ImagePlane
- optics.surface.OpticalPlane
- optics.surface.FlatSurface
- optics.surface.Surface
Methods defined here:
- __init__(self, pt, xsize=36.0, ysize=24.0)
- Constuctor with
param pt Poistion or float, the plane position
param xsize float xsize of plane (defaults to 36mm)
param ysize float ysize of plane (defaults to 24 mm)
- __repr__(self)
- Implement repr()
- add(self, t, key='global')
- Add a target
- addGrid(self, xn, yn=0, radius=inf)
- Fill the TargetPlace with a set regular set of targets
param xn number of targets across horizontal
param yn numbers of tarets across if 0 or negative, n will
be set to that the targets are on a square grid
param radius, float, have targets only in a masked of
specified radius.
Note: number of targets will be rounded to ensure an
odd number across array so there will always be one
at (0,0)
- draw(self)
- Draw the plane in MatLibPlot
- rayPencil(self, pt_or_u, wave=0.55, intensity=1.0)
- Get an intesnity RayPenci, one ray from each target
param pt_or_u Position or Director, of Position each
ray will pass through this point, if Director, this
is direction of each ray.
param wave wavelength, (defaults of Default)
param intensity intensity, (defaults to 1.0)
Methods inherited from optics.surface.ImagePlane:
- __str__(self)
- Implement str()
- scale(self, a)
- Scale plane, scales both position and size, if a < 0,abs(a) is used.
param a the scale parameter.
- setSize(self, x, y)
- Set the size of plane but without scaling ploation point
Methods inherited from optics.surface.OpticalPlane:
- surfaceVector(self, pos)
- Method to get the Vector2d from the reference point to the specifed position, assumed to
be in the plane.
Methods inherited from optics.surface.FlatSurface:
- getDistance(self, r, u)
- Get the distance from specifed Postition to the surface
param r the position
param u the director
- getNormal(self, pt)
- Get surface normal at any point.
Methods inherited from optics.surface.Surface:
- getPoint(self)
- Method to get the surface point in global coordinates taking account
that the Surface my belong to an OpticalGroup
return Vector3d the reference point
- makeStandAlone(self)
- Method to make the Surface standalone, it is removed from any OpticalGroup
and the reference point is re-set.
|
class WavePoint(vector.Vector2d) |
|
Call to hold a WavePoint being the optical |
|
- Method resolution order:
- WavePoint
- vector.Vector2d
- __builtin__.object
Methods defined here:
- __init__(self, r, plane, refpt=None)
- param ray the input ray
param plane
param reference point
- __repr__(self)
- getPhaselength(self)
- Method to get the phase length, being 2*pi*pathelength/wavelength
Methods inherited from vector.Vector2d:
- __abs__(self)
- Implement abs() method for vector2d
- __add__(self, b)
- Method to implments the c = self + b to add 2 Vector2d, of b is a float it
will be added to each component.
return new Vector2d
- __div__(self, b)
- Method to implemnt c = self / b for b being Vector 2d or float, if float it
is appled to each component.
returns Vector2d.
- __ge__(self, b)
- Implement abs(self> >= abs(b)
- __getitem__(self, key)
- Implement indexing on read using [i] syntax.
- __gt__(self, b)
- Implement abs(self) > abs(b)
- __iadd__(self, v)
- Method to implement the += to add Vector2d to current in place, if v is a
Vectord2d the components will be added, while if it is a float it will be
added to each component.
- __idiv__(self, v)
- Method to implement the /= to divide current vector in place, if v is a
Vectord2d the components will be divided, while if it is a float it will
divide each component.
- __imul__(self, v)
- Method to implement the *= to multiply Vector2d by current in place, if v is a
Vectord3d the component s will be multiplied, while if it is a float it will
multiply each component.
- __isub__(self, v)
- Method to implement the -= to subtract Vector2d from current in place, if v is a
Vectord2d the components will be subtrated, while if it is a float it will be
subrtacted from each component.
- __le__(self, b)
- Implement abs(self) <= abs(b)
- __len__(self)
- Implement len() to return 2
- __lt__(self, b)
- Implement abd(self) < abs(b)
- __mul__(self, b)
- Method to implemnt c = self * b for b being Vector 2d or float, if float it
is appled to each component.
returns Vector2d.
- __neg__(self)
- Method to implement the __neg__ method to return a new -ve vector.
Note current not changed.
- __nonzero__(self)
- Implment nonzero for logical test if Valid
- __radd__(self, b)
- Method to implments the c = b + self to add 2 Vector2d, of b is a float it will
be added to each component.
return new Vector2d
- __rdiv__(self, b)
- Method to implemnt c = b / self for b being Vector 2d or float, if float
it is appled to each component.
returns Vector2d.
- __rmul__(self, b)
- Method to implemnt c = self * b for b being Vector 2d or float, if float
it is appled to each component.
returns Vector2d.
- __rsub__(self, b)
- Method to implments the c = b - self to add 2 Vector2d, of b is a float it
will be added to each component.
return new Vector2d
- __setitem__(self, key, value)
- Implement indexing on write using [i] syntax
- __str__(self)
- Implement str() to return a string with components in 8.4e format.
- __sub__(self, b)
- Method to implments the c = self - b to add 2 Vector2d, of b is a float it
will be added to each component.
return new Vector2d
- abs(self)
- Return abs of vectors2d as a float.
- absCube(self)
- Return the absCube of the Vector2d as a float defined as abs(x**3) + abs(y**3).
Does not use pow or **3
- absNormalised(self)
- Method to return length f vector and normalsied vector as a pair
- absSquare(self)
- Return the absSquare of the vector2d as a float. Does not use pow or **2
- angleBetween(self, b)
- Method to get the angle between two Vector2d
param b second Vector2d
param return float, angle in range -pi/2 and pi
Note: is abs(current) and abs(b) is zero, zero is retunned
- copy(self)
- Return a copy of the current Vector2d.
- distance(self, b)
- Method to get distance between two Vector2ds Note does NOT use **2 or pow
param b the second Vector2d
return float the square of the distance between vectors.
- distanceCube(self, b)
- Method to get distanceCube between two Vector2ds Note does NOT use **2 or pow
param b the second Vector2d
return float the square of the distance between vectors.
- distanceSquare(self, b)
- Method to get distanceSquare between two Vector2ds Note does NOT use **2 or pow
param b the second Vector2d
return float the square of the distance between vectors.
- dot(self, b)
- Method to get .dot product between current and specified Vector3d
b second Vector2d
return float the dot product
- errorSquare(self, b)
- Method to set the normalsied square error between two vectors
- getComplex()
- Return a copy of the vector as a complex(x,y)
- inverseSquare(self, b)
- Method to get the vector from current to b scaled to inverse square of
the distance between them, for implementation of inverse square law forces.
- isValid(self)
- Method to deterime if Vector2d is valid, so .x != Nan
- negate(self)
- Method to negate the current vector in place, will return self to can be used in chain.
- normalise(self)
- Method to normalised vector in place. Will return selfso can be used in chain.
Note: if current vector is abs() = 0, the current vector will be set inValid()
- polar(self)
- Return a copy of the current vector in polar (r,theta) form
- rect(self)
- Return a copy of the current vector in rect (x,y) form assumeing it is in
polar (r,theta) form.
Note: there is NO checking, so if the current Vector is NOT in polar form
you will get rubbish.
- rotate(self, gamma)
- Method to implementate a rotation in place.
param gamma rotatian angle.
- round(self, figs=0)
- Method to round the current Vector2d to number of decimal figures.
param figs number of figures to round to (default is 0)
- set(self, x_or_v=0.0, y=0.0)
- Method to set componets of the vector in various formats.
param x_or_v float x component (default = 0.0)
param y float y component (default = 0.0)
OR
x_or_v Vector2d both componets copied
OR
x_or_v list, [0] = x, [1] = y
- setInvalid(self)
- Method to set to invalid current vector2d to Invalid by setting both compoents
to float("nan")
- setLength(self, d)
- Method to set the length of a vector to specified length. Will return self.
param d float length vector is set to.
Data descriptors inherited from vector.Vector2d:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
|
class WavePointSet(__builtin__.list) |
|
Class to hold a set of WavePoints |
|
- Method resolution order:
- WavePointSet
- __builtin__.list
- __builtin__.object
Methods defined here:
- __init__(self, pencil, plane, refpt=None)
- Create a set of wavepoint from a pencil.
- add(self, wp)
- Metod to add a WavePoint,it append to WavePointSet and also set the currect
maxradius of neded
- leastSqrError(self, zern)
- Method to caculate the least sqr error between the datapoint and a two dimensional
surface estmate
- zeroMean(self)
- Method to zerom mean the data by substracting off the average pathlength
from eack point.
Data descriptors defined here:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Methods inherited from __builtin__.list:
- __add__(...)
- x.__add__(y) <==> x+y
- __contains__(...)
- x.__contains__(y) <==> y in x
- __delitem__(...)
- x.__delitem__(y) <==> del x[y]
- __delslice__(...)
- x.__delslice__(i, j) <==> del x[i:j]
Use of negative indices is not supported.
- __eq__(...)
- x.__eq__(y) <==> x==y
- __ge__(...)
- x.__ge__(y) <==> x>=y
- __getattribute__(...)
- x.__getattribute__('name') <==> x.name
- __getitem__(...)
- x.__getitem__(y) <==> x[y]
- __getslice__(...)
- x.__getslice__(i, j) <==> x[i:j]
Use of negative indices is not supported.
- __gt__(...)
- x.__gt__(y) <==> x>y
- __iadd__(...)
- x.__iadd__(y) <==> x+=y
- __imul__(...)
- x.__imul__(y) <==> x*=y
- __iter__(...)
- x.__iter__() <==> iter(x)
- __le__(...)
- x.__le__(y) <==> x<=y
- __len__(...)
- x.__len__() <==> len(x)
- __lt__(...)
- x.__lt__(y) <==> x<y
- __mul__(...)
- x.__mul__(n) <==> x*n
- __ne__(...)
- x.__ne__(y) <==> x!=y
- __repr__(...)
- x.__repr__() <==> repr(x)
- __reversed__(...)
- L.__reversed__() -- return a reverse iterator over the list
- __rmul__(...)
- x.__rmul__(n) <==> n*x
- __setitem__(...)
- x.__setitem__(i, y) <==> x[i]=y
- __setslice__(...)
- x.__setslice__(i, j, y) <==> x[i:j]=y
Use of negative indices is not supported.
- __sizeof__(...)
- L.__sizeof__() -- size of L in memory, in bytes
- append(...)
- L.append(object) -- append object to end
- count(...)
- L.count(value) -> integer -- return number of occurrences of value
- extend(...)
- L.extend(iterable) -- extend list by appending elements from the iterable
- index(...)
- L.index(value, [start, [stop]]) -> integer -- return first index of value.
Raises ValueError if the value is not present.
- insert(...)
- L.insert(index, object) -- insert object before index
- pop(...)
- L.pop([index]) -> item -- remove and return item at index (default last).
Raises IndexError if list is empty or index is out of range.
- remove(...)
- L.remove(value) -- remove first occurrence of value.
Raises ValueError if the value is not present.
- reverse(...)
- L.reverse() -- reverse *IN PLACE*
- sort(...)
- L.sort(cmp=None, key=None, reverse=False) -- stable sort *IN PLACE*;
cmp(x, y) -> -1, 0, 1
Data and other attributes inherited from __builtin__.list:
- __hash__ = None
- __new__ = <built-in method __new__ of type object>
- T.__new__(S, ...) -> a new object with type S, a subtype of T
| |