SegmentedHexikeSurface
- class hcipy.optics.SegmentedHexikeSurface(segments, segment_centers, segment_circum_diameter, pupil_grid, num_modes, hexagon_angle=1.5707963267948966)
Bases:
OpticalElementAn optical element applying per-segment hexike surface aberrations.
The coefficients represent surface height in meters. Phase is applied as
phase = 4 * pi * surface / wavelength(reflection: OPD = 2 * surface).- Parameters:
- segmentsiterable of Field or callable
Segment masks, one per segment. Callables will be evaluated on pupil_grid.
- segment_centersGrid
Center positions for each segment, same ordering as segments.
- segment_circum_diameterscalar
Circumscribed diameter of each hexagonal segment.
- pupil_gridGrid
Grid on which the wavefront is defined.
- num_modesint
Number of hexike modes per segment (Noll ordered).
- hexagon_anglefloat
Rotation of each hexagon. Default pi/2 for flat-top orientation.
Attributes Summary
Surface height coefficients in meters, shape (num_segments, num_modes).
Optical path difference (2 × surface for reflection).
Current surface height in meters as a Field on input_grid.
Methods Summary
backward(wavefront)Propagate a wavefront backward through the optical element.
flatten()Reset all coefficients to zero.
forward(wavefront)Propagate a wavefront forward through the optical element.
get_segment_coefficients(segment_id)Get coefficients for a single segment.
phase_for(wavelength)Get the phase in radians for a given wavelength.
set_coefficients_from_dict(coeffs_by_segment)Set coefficients for multiple segments from a dict-of-dicts.
set_segment_coefficients(segment_id, coeffs_dict)Set coefficients for a single segment.
Attributes Documentation
- coefficients
Surface height coefficients in meters, shape (num_segments, num_modes).
- opd
Optical path difference (2 × surface for reflection).
- surface
Current surface height in meters as a Field on input_grid.
Methods Documentation
- backward(wavefront)
Propagate a wavefront backward through the optical element.
A backward propagation is a literal backward propagation through the element. It is not (in general) the inverse of the forward propagation, except in cases where energy is conserved.
This function will be implemented by the derived class.
- Parameters:
- wavefrontWavefront
The wavefront to propagate.
- Returns:
- Wavefront
The propagated wavefront.
- flatten()
Reset all coefficients to zero.
- forward(wavefront)
Propagate a wavefront forward through the optical element.
This will be implemented by the derived class.
- Parameters:
- wavefrontWavefront
The wavefront to propagate.
- Returns:
- Wavefront
The propagated wavefront.
- get_segment_coefficients(segment_id)
Get coefficients for a single segment.
- Parameters:
- segment_idint
Index of the segment.
- Returns:
- ndarray
The surface height coefficients for the requested segment in meters, with shape
(num_modes,).
- phase_for(wavelength)
Get the phase in radians for a given wavelength.
- Parameters:
- wavelengthscalar
The wavelength at which to calculate the phase deformation.
- Returns:
- Field
The calculated phase deformation.
- set_coefficients_from_dict(coeffs_by_segment, indexing='noll')
Set coefficients for multiple segments from a dict-of-dicts.
- Parameters:
- coeffs_by_segmentdict
Mapping from segment index to a dict mapping mode index to surface height in meters.
- indexing{‘noll’, ‘ansi’}
Indexing scheme for supplied mode indices.
Notes
This function only updates the coefficients that are explicitly provided. Any coefficients not mentioned in coeffs_by_segment will keep their current value.
- set_segment_coefficients(segment_id, coeffs_dict, indexing='noll')
Set coefficients for a single segment.
- Parameters:
- segment_idint
Index of the segment.
- coeffs_dictdict
Mapping from mode index to surface height in meters.
- indexing{‘noll’, ‘ansi’}
Indexing scheme for supplied mode indices.