Bases: object
A class representing a monochromatic wavefront that can be transformed between pupil and image planes (but not to intermediate planes, yet).
In a pupil plane, a wavefront object wf has
 wf.diam, a diameter in meters
 wf.pixelscale, a scale in meters/pixel
In an image plane, it has
 wf.fov, a field of view in arcseconds
 wf.pixelscale, a scale in arcsec/pixel
Use the wf.propagateTo() method to transform a wavefront between conjugate planes. This will update those properties as appropriate.
By default, Wavefronts are created in a pupil plane. Set pixelscale=# to make an image plane instead.
Parameters :  wavelength : float
npix : int
diam : float, optional
pixelscale : float, optional
oversample : int, optional
dtype : numpy.dtype, optional


Attributes Summary
amplitude  Electric field amplitude of the wavefront 
intensity  Electric field intensity of the wavefront (i.e. 
phase  Phase of the wavefront, in radians 
shape  Shape of the wavefront array 
totalIntensity  Integrated intensity over the entire spatial/angular extent of the wavefront 
Methods Summary
asFITS([what, includepadding])  Return a wavefront as a pyFITS HDUList object :Parameters: what : string what kind of data to write. 
coordinates()  Return Y, X coordinates for this wavefront, in the manner of numpy.indices() This function knows about the offset resulting from FFTs. 
copy()  Return a copy of the wavefront as a different object. 
display([what, nrows, row, showpadding, ...])  Display wavefront on screen :Parameters: what : string What to display. 
normalize()  Set this wavefront’s total intensity to 1 
propagateTo(optic)  Propagates a wavefront object to the next optic in the list. 
rotate([angle])  Rotate a wavefront by some amount :Parameters: angle : float Angle to rotate, in degrees counterclockwise. 
tilt([Xangle, Yangle])  Tilt a wavefront in X and Y. 
writeto(filename[, clobber])  Write a wavefront to a FITS file. 
Attributes Documentation
Electric field amplitude of the wavefront
Electric field intensity of the wavefront (i.e. field amplitude squared)
Phase of the wavefront, in radians
Shape of the wavefront array
Integrated intensity over the entire spatial/angular extent of the wavefront
Methods Documentation
Return a wavefront as a pyFITS HDUList object
Parameters :  what : string
includepadding : bool


Return Y, X coordinates for this wavefront, in the manner of numpy.indices()
This function knows about the offset resulting from FFTs. Use it whenever computing anything measures in wavefront coordinates.
Returns :  Y, X : array_like


Return a copy of the wavefront as a different object.
Display wavefront on screen
Parameters :  what : string
nrows : int
row : int
imagecrop : float, optional
showpadding : bool, optional
colorbar : bool
ax : matplotlib Axes


Returns :  figure : matplotlib figure

Set this wavefront’s total intensity to 1
Propagates a wavefront object to the next optic in the list. Modifies this wavefront object itself.
Parameters :  optic : OpticalElement


Rotate a wavefront by some amount
Parameters :  angle : float


Tilt a wavefront in X and Y.
Recall from Fourier optics (although this is straightforwardly rederivable by drawing triangles) that for a wavefront tilted by some angle theta in radians, that a point r meters from the center of the pupil has:
extra_pathlength = sin(theta) * r extra_waves = extra_pathlength/ wavelength = r * sin(theta) / wavelength
So we calculate the U and V arrays (corresponding to r for the pupil, in meters from the center) and then multiply by the appropriate trig factors for the angle.
The sign convention is chosen such that positive Yangle tilts move the star upwards in the array at the focal plane. (This is sort of an inverse of what physically happens in the propagation to or through focus, but we’re ignoring that here and trying to just work in sky coords)
Parameters :  Xangle, Yangle : float


Write a wavefront to a FITS file.
Parameters :  filename : string
what : string
clobber : bool, optional


Returns :  outfile: file on disk :
