webbpsf_ext.opds.OTE_WFE_Drift_Model

class webbpsf_ext.opds.OTE_WFE_Drift_Model(**kwargs)[source]

Bases: webbpsf.opds.OTE_Linear_Model_WSS

OPD subclass for calculating OPD drift values over time.

__init__(**kwargs)[source]
Parameters
  • opdfile (str or fits.HDUList) – FITS file to load an OPD from. The OPD data must be specified in microns.

  • opd_index (int, optional) – Index of a datacube to load OPD from, if the selected extension contains a datacube.

  • transmission (str or None) – FITS file for pupil mask, with throughput from 0-1. If not explicitly provided, will be inferred from wherever is nonzero in the OPD file.

  • segment_mask_file (str) – FITS file for pupil mask, with throughput from 0-1. If not explicitly provided, will use JWpupil_segments_RevW_npix1024.fits, or equivalent for other value of npix

  • zero (bool) – Set an OPD to precisely zero everywhere.

  • rm_ptt (bool) – Remove piston, tip, and tilt? This is mostly for visualizing the higher order parts of the LOM. Default: False.

  • v2v3 (tuple of 2 astropy.Quantities) – Tuple giving V2,v3 coordinates as quantities, typically in arcminutes, or None to default to the master chief ray location between the two NIRCam modules.

  • include_nominal_field_dependence (bool) – Include the Zernike polynomial model for OTE field dependence for the nominal OTE. Note, if OPD is None, then this will be ignored and the nominal field dependence will be disabled.

  • control_point_fieldpoint (str) – A parameter used in the field dependence model for a misaligned secondary mirror. Name of the field point where the OTE MIMF control point is located, on instrument defined by “control_point_instr”. Default: ‘nrca3_full’. The OTE control point is the field point to which the OTE has been aligned and defines the field angles for the field-dependent SM pose aberrations.

  • npix (int) – Size of OPD: npix x npix

Methods

__init__(**kwargs)

Parameters
  • opdfile (str or fits.HDUList) -- FITS file to load an OPD from. The OPD data must be specified in microns.

apply_frill_drift([amplitude, random, case, ...])

Apply model of segment PTT motions for the frill-induced drift.

apply_iec_drift([amplitude, random, case, ...])

Apply model of segment PTT motions for the drift seen at OTIS induced by the IEC (Instrument Electronics Compartment) heater resistors.

as_fits([include_pupil])

Return the OPD as a fits.HDUList object

calc_rms(arr[, segname])

Calculate RMS of input images

copy()

Make a copy of a wavefront object

display([nrows, row, what, crosshairs, ax, ...])

Display plots showing an optic's transmission and OPD.

display_opd([ax, labelsegs, vmax, colorbar, ...])

Draw on screen the perturbed OPD

estimated_Strehl(wavelength[, verbose])

Compute an estimated Strehl given a wavelength in meters

evolve_dopd(delta_time, slew_angles[, case, ...])

Evolve the delta OPD with multiple slews

gen_delta_opds(delta_time[, start_angle, ...])

Create series of delta OPDs

gen_frill_drift(delta_time[, start_angle, ...])

Frill WFE drift scaling

gen_iec_series(delta_time[, amplitude, ...])

Create a series of IEC WFE scale factors

gen_thermal_drift(delta_time[, start_angle, ...])

Thermal WFE drift scaling

get_opd(wave)

Return the optical path difference, given a wavelength.

get_phasor(wave)

Compute a complex phasor from an OPD, given a wavelength.

get_transmission(wave)

Return the electric field amplitude transmission, given a wavelength.

header_keywords()

Return info we would like to save in FITS header of output PSFs

interp_dopds(delta_time, dopds, dt_new[, ...])

Interpolate an array of delta OPDs

label_seg(segment[, ax, show_axes, color, ...])

Annotate a plot with a text label for a particular segment

move_global_zernikes(zvector[, unit, ...])

Add one or more aberrations specified arbitrarily as Zernike polynomials.

move_seg_global(segment[, xtilt, ytilt, ...])

Move a segment in pose and/or ROC, using PM global V coordinates..

move_seg_local(segment[, xtilt, ytilt, ...])

Move a segment in pose and/or ROC, using segment-local control coordinates.

move_sm_local([xtilt, ytilt, rot_unit, ...])

Move the secondary mirror in pose, using segment-local control coordinates.

move_sur(sur_file[, group, verbose, reverse])

Move using a JWST Segment Update Request file

opds_as_hdul(delta_time, slew_angles[, ...])

Convert series of delta OPDS to HDUList

powerspectrum([max_cycles, sampling, vmax, ...])

Compute the spatial power spectrum of an aberrated wavefront.

print_state()

ptv([segment])

return peak to valley WFE in nanometers

reset([verbose])

Reset an OPD to the state it was loaded from disk.

rms([segment])

Return RMS WFE in nanometers

slew_pos_averages(delta_time, slew_angles[, ...])

Get averages at each slew position

slew_scaling(start_angle, end_angle)

WFE scaling due to slew angle

thermal_slew(delta_time[, start_angle, ...])

Update the OPD based on presence of a pitch angle change between observations.

update_opd([display, verbose])

Update the OPD based on the current linear model values.

writeto(outname[, overwrite])

Write OPD to a FITS file on disk

zern_seg(segment[, vmax, unit])

Show the Zernike terms applied to a given segment

zero([zero_original])

Reset an OPD to precisely zero everywhere.

Attributes

pupil_diam

Diameter of the pupil (if this is a pupil plane optic)

shape

Return shape of the OpticalElement, as a tuple

apply_frill_drift(amplitude=None, random=False, case='BOL', delay_update=False)

Apply model of segment PTT motions for the frill-induced drift.

This is additive with other WFE terms.

Parameters
  • amplitude (float) – Amplitude of drift in nm rms to apply

  • random (bool) – if True, choose a random amplitude from within the expected range for either the BOL or EOL cases. The assumed model is a uniform distribution between 0 and a maximum amplitude of 8.6 or 18.4 nm rms respectively.

  • case (string) – either “BOL” for current best estimate at beginning of life, or “EOL” for more conservative prediction at end of life. Only relevant if random=True.

  • delay_update (bool) – hold off on computing the WFE change? This is useful for computational efficiency if you’re making many changes at once.

apply_iec_drift(amplitude=None, random=False, case='BOL', delay_update=False)

Apply model of segment PTT motions for the drift seen at OTIS induced by the IEC (Instrument Electronics Compartment) heater resistors. This effect was in part due to non-flight-like ground support equipment mountings, and is not expected in flight at the same levels it was seen at JSC. We model it anyway, at an amplitude consistent with upper limits for flight.

This is additive with other WFE terms.

Parameters
  • amplitude (float) – Amplitude of drift in nm rms to apply

  • random (bool) – if True, choose a random amplitude from within the expected range for either the BOL or EOL cases. The assumed model is a sinusoidal drift between 0 and 3.5 nm, i.e. a random variate from the arcsine distribution times 3.5.

  • case (string) – either “BOL” for current best estimate at beginning of life, or “EOL” for more conservative prediction at end of life. Only relevant if random=True. (Note, for IEC drift the amplitude is the same regardless.)

  • delay_update (bool) – hold off on computing the WFE change? This is useful for computational efficiency if you’re making many changes at once.

as_fits(include_pupil=True)

Return the OPD as a fits.HDUList object

Parameters

include_pupil (bool) – Include the pupil mask as a FITS extension?

calc_rms(arr, segname=None)[source]

Calculate RMS of input images

copy()

Make a copy of a wavefront object

display(nrows=1, row=1, what='intensity', crosshairs=False, ax=None, colorbar=True, colorbar_orientation=None, title=None, opd_vmax=<Quantity 5.e-07 m>, wavelength=<Quantity 1.e-06 m>, npix=512, grid_size=None)

Display plots showing an optic’s transmission and OPD.

Parameters
  • what (str) – What to display: ‘intensity’, ‘amplitude’, ‘phase’, ‘opd’, or ‘both’ (meaning intensity and OPD in two subplots)

  • ax (matplotlib.Axes instance) – Axes to display into

  • nrows, row (integers) – number of rows and row index for subplot display

  • crosshairs (bool) – Display crosshairs indicating the center?

  • colorbar (bool) – Show colorbar?

  • colorbar_orientation (bool) – Desired orientation, horizontal or vertical? Default is horizontal if only 1 row of plots, else vertical

  • opd_vmax (float) – Max absolute value for OPD image display, in meters.

  • title (string) – Plot label

  • wavelength (float, default 1 micron) – For optics with wavelength-dependent behavior, evaluate at this wavelength for display.

  • npix (integer) – For optics without a fixed pixel sampling, evaluate onto this many pixels for display.

  • grid_size (float) – For optics without a fixed pixel sampling, evaluate onto this large a spatial or angular extent for display. Specify in units of arcsec for image plane optics, meters for all other optics. If unspecified, a default value will be chosen instead, possibly from the ._default_display_size attribute, if present.

display_opd(ax=None, labelsegs=True, vmax=150.0, colorbar=True, clear=False, title=None, unit='nm', pupil_orientation='entrance_pupil', cbpad=None, colorbar_orientation='vertical', show_axes=False, show_rms=True, show_v2v3=False, cmap=None)

Draw on screen the perturbed OPD

Parameters
  • ax (matplotlib.Axes) – axes instance to display into.

  • labelsegs (bool) – draw segment name labels on each segment? default True.

  • show_axes (bool) – Draw local control axes per each segment

  • show_rms (bool) – Annotate the RMS wavefront value

  • show_v2v3 – Draw the observatory V2V3 coordinate axes

  • pupil_orientation (string) – either ‘entrance_pupil’ or ‘exit_pupil’, for which orientation we should display the OPD in.

  • clear (bool) – Clear plot window before display? default true

  • unit (str) – Unit for WFE. default is ‘nm’

estimated_Strehl(wavelength, verbose=True)

Compute an estimated Strehl given a wavelength in meters

Parameters
  • wavelength (float) – in meters

  • verbose (bool) – should I print out an informative message?

evolve_dopd(delta_time, slew_angles, case='BOL', return_wfe_amps=True, return_dopd_fin=True, do_thermal=True, do_frill=True, do_iec=True, **kwargs)[source]

Evolve the delta OPD with multiple slews

Input an array of delta_time and slew_angles to return the evolution of a delta_OPD image. Option to return the various WFE components, including OTE backplane (thermal), frill tensioning, and IEC heater switching.

Parameters
  • delta_time (astropy.units quantity object) – An array of times assuming astropy units.

  • slew_angles (ndarray) – The sun pitch angles, in degrees between -5 and +45.

  • case (string) – Either “BOL” for current best estimate at beginning of life, or “EOL” for more conservative prediction at end of life.

  • do_thermal (bool) – Include thermal slew component? Mostly for debugging purposes.

  • do_frill (bool) – Include frill component? Mostly for debugging purposes.

  • do_iec (bool) – Include IEC component? Good to exclude if calling this function repeatedly for evolution of multiple slews, then add IEC later.

  • return_wfe_amps (bool) – Return a dictionary that provides the RMS WFE (nm) of each component at each time step.

  • return_dopd_fin (bool) – Option to exclude calculating final delta OPD in case we only want the final RMS WFE dictionary.

Keyword Arguments
  • amplitude (float) – Full amplitude of IEC arcsine distribution. Values will range from -0.5*amplitude to +0.5*amplitude.

  • period (float) – Period in minutes of IEC oscillations. Usually 3-5 minutes.

  • random_seed (int) – Random seed to pass to IEC generation.

gen_delta_opds(delta_time, start_angle=- 5, end_angle=45, do_thermal=True, do_frill=True, do_iec=True, case='BOL', return_wfe_amps=True, return_dopd_fin=True, random_seed=None, **kwargs)[source]

Create series of delta OPDs

Generate a series of delta OPDS, the result of which is a combination of thermal, frill, and IEC effects. The thermal and frill values are dependent on time, start/end slew angles, and case (‘BOL’ or ‘EOL’). Delta OPD contributions from the IEC heater switching are treated as random state switches assuming an arcsine distribution.

Parameters
  • delta_time (astropy.units quantity object) – An array of times assuming astropy units.

  • start_angle (float) – The starting sun pitch angle, in degrees between -5 and +45.

  • end_angle (float) – The ending sun pitch angle, in degrees between -5 and +45.

  • case (string) – Either “BOL” for current best estimate at beginning of life, or “EOL” for more conservative prediction at end of life.

  • do_thermal (bool) – Include thermal slew component? Mostly for debugging purposes.

  • do_frill (bool) – Include frill component? Mostly for debugging purposes.

  • do_iec (bool) – Include IEC component? Good to exclude if calling this function repeatedly for evolution of multiple slews, then add IEC later.

  • return_wfe_amps (bool) – Return a dictionary that provides the RMS WFE (nm) of each component at each time step.

  • return_dopd_fin (bool) – Option to exclude calculating final delta OPD in case we only want the final RMS WFE dictionary.

  • random_seed (int) – Random seed to pass to IEC generation.

gen_frill_drift(delta_time, start_angle=- 5, end_angle=45, case='BOL')[source]

Frill WFE drift scaling

Function to determine the factor to scale the delta OPD associated with frill tensioning. Returns the RMS WFE (nm) depending on time and slew angles.

Parameters
  • delta_time (astropy.units quantity object) – The time since a slew occurred.

  • start_angle (float) – The starting sun pitch angle, in degrees between -5 and +45

  • end_angle (float) – The ending sun pitch angle, in degrees between -5 and +45

  • case (string) – either “BOL” for current best estimate at beginning of life, or “EOL” for more conservative prediction at end of life. The amplitude of the frill drift is roughly 2x lower for BOL (8.6 nm after 2 days) versus EOL (18.4 nm after 2 days).

gen_iec_series(delta_time, amplitude=3.5, period=5.0, interp_kind='linear', random_seed=None)[source]

Create a series of IEC WFE scale factors

Create a series of random IEC heater state changes based on arcsine distribution.

Parameters

delta_time (astropy.units quantity object array) – Time series of atropy units to interpolate IEC amplitudes

Keyword Arguments
  • amplitude (float) – Full amplitude of arcsine distribution. Values will range from -0.5*amplitude to +0.5*amplitude.

  • period (float) – Period in minutes of IEC oscillations. Usually 3-5 minutes.

  • random_seed (int) – Provide a random seed value between 0 and (2**32)-1 to generate reproducible random values.

  • interp_kind (str or int) – Specifies the kind of interpolation as a string (‘linear’, ‘nearest’, ‘zero’, ‘slinear’, ‘quadratic’, ‘cubic’, ‘previous’, ‘next’, where ‘zero’, ‘slinear’, ‘quadratic’ and ‘cubic’ refer to a spline interpolation of zeroth, first, second or third order; ‘previous’ and ‘next’ simply return the previous or next value of the point) or as an integer specifying the order of the spline interpolator to use. Default is ‘linear’.

gen_thermal_drift(delta_time, start_angle=- 5, end_angle=45, case='BOL')[source]

Thermal WFE drift scaling

Function to determine the factor to scale the delta OPD associated with OTE backplane thermal distortion. Returns the RMS WFE (nm) depending on time and slew angles.

Parameters
  • delta_time (astropy.units quantity object) – The time since a slew occurred.

  • start_angle (float) – The starting sun pitch angle, in degrees between -5 and +45

  • end_angle (float) – The ending sun pitch angle, in degrees between -5 and +45

  • case (string) – either “BOL” for current best estimate at beginning of life, or “EOL” for more conservative prediction at end of life. The amplitude of the frill drift is roughly 3x lower for BOL (13 nm after 14 days) versus EOL (43 nm after 14 days).

get_opd(wave)

Return the optical path difference, given a wavelength.

When the OPD map is defined in terms of wavelength-independent phase, as in the case of the vector apodizing phase plate coronagraph of Snik et al. (Proc. SPIE, 2012), it is converted to optical path difference in meters at the given wavelength for consistency with the rest of POPPY.

Parameters

wave (float or obj) – either a scalar wavelength or a Wavefront object

Returns

ndarray giving OPD in meters

get_phasor(wave)

Compute a complex phasor from an OPD, given a wavelength.

The returned value should be the complex phasor array as appropriate for multiplying by the wavefront amplitude.

Parameters

wave (float or obj) – either a scalar wavelength or a Wavefront object

get_transmission(wave)

Return the electric field amplitude transmission, given a wavelength.

Parameters

wave (float or obj) – either a scalar wavelength or a Wavefront object

Returns

ndarray giving electric field amplitude transmission between 0 - 1.0

header_keywords()

Return info we would like to save in FITS header of output PSFs

interp_dopds(delta_time, dopds, dt_new, wfe_dict=None, interp_kind='linear', **kwargs)[source]

Interpolate an array of delta OPDs

Perform a linear interpolation on a series of delta OPDS.

Parameters
  • delta_time (astropy.units quantity object) – An array of times assuming astropy units corresponding to each dopd.

  • dopds (ndarray) – Array of delta OPD images associated with delta_time.

  • dt_new (astropy.units quantity object) – New array to interpolate onto.

Keyword Arguments
  • wfe_dict (dict or None) – If specified, then must provide a dictionary where the values for each keywords are the WFE drift components associated with each delta_time. Will then return a dictionary

  • interp_kind (str or int) – Specifies the kind of interpolation as a string (‘linear’, ‘nearest’, ‘zero’, ‘slinear’, ‘quadratic’, ‘cubic’, ‘previous’, ‘next’, where ‘zero’, ‘slinear’, ‘quadratic’ and ‘cubic’ refer to a spline interpolation of zeroth, first, second or third order; ‘previous’ and ‘next’ simply return the previous or next value of the point) or as an integer specifying the order of the spline interpolator to use. Default is ‘linear’.

label_seg(segment, ax=None, show_axes=False, color='black', pupil_orientation='entrance_pupil')

Annotate a plot with a text label for a particular segment

move_global_zernikes(zvector, unit='micron', absolute=False, delay_update=False, display=False)

Add one or more aberrations specified arbitrarily as Zernike polynomials. This assumes no particular physics for the mirror motions, and allows adding any arbitrary WFE.

Parameters

zvector (list or ndarray) – Zernike coefficients

Note that the Zernikes are interpreted as being with respect to the CIRCUMSCRIBING circle.

move_seg_global(segment, xtilt=0.0, ytilt=0.0, clocking=0.0, rot_unit='urad', radial=None, xtrans=0.0, ytrans=0.0, piston=0.0, roc=0.0, trans_unit='micron', display=False, delay_update=False, absolute=False)

Move a segment in pose and/or ROC, using PM global V coordinates..

These motions are converted into the segment-local “Control” coordinate systems, which are distinct for each segment.

Parameters
  • segment (str) – Segment name, e.g. ‘A1’. Use ‘SM’ for the secondary mirror.

  • xtilt, ytilt, clocking (floats) – Tilt angle, in microradians by default. ‘xtilt’ means tilt around the X axis, and similarly for ytilt.

  • radial, ytrans,xtrans (floats) – Displacement distance, in microns by default. Note the ‘radial’ and ‘xtrans’, ‘ytrans’ are redundant and included for convenience; the Ball WAS linear optical model uses radial translation as the control DoF, but physically that maps to either x or y translation depending on whether A, B, or C segment, and the Ball MCS algorithms expect X and Y translations. We support both ways of describing this here.

  • piston (float) – Displacement distance for piston.

  • roc (float) – radius of curvature mechanism adjustment, in microns.

  • trans_unit (str) – Unit for translations. Can be ‘micron’, ‘millimeter’,’nanometer’, ‘mm’, ‘nm’, ‘um’

  • rot_unit (str) – Unit for rotations. Can be ‘urad’, ‘radian’, ‘milliradian’, ‘arcsec’, ‘arcmin’, ‘milliarcsec’

  • absolute (bool) – Same meaning as for JWST SURs: if true, move the segment to exactly this position. Otherwise moves are treated as incremental relative moves from the current position.

  • display (bool) – Display after moving?

  • delay_update (bool) – hold off on computing the WFE change? This is useful for computational efficiency if you’re moving a whole bunch of segments at once. Incompatible with display=True.

move_seg_local(segment, xtilt=0.0, ytilt=0.0, clocking=0.0, rot_unit='urad', radial=None, xtrans=None, ytrans=None, piston=0.0, roc=0.0, trans_unit='micron', display=False, delay_update=False, absolute=False)

Move a segment in pose and/or ROC, using segment-local control coordinates.

These motions are always commanded in the segment-local “Control” coordinate systems, which are distinct for each segment.

Parameters
  • segment (str) – Segment name, e.g. ‘A1’.

  • xtilt, ytilt, clocking (floats) – Tilt angle, in microradians by default. ‘xtilt’ means tilt around the X axis, and similarly for ytilt.

  • radial, ytrans,xtrans (floats) – Displacement distance, in microns by default. Note the ‘radial’ and ‘xtrans’, ‘ytrans’ are redundant and included for convenience; the Ball WAS linear optical model uses radial translation as the control DoF, but physically that maps to either x or y translation depending on whether A, B, or C segment, and the Ball MCS algorithms expect X and Y translations. We support both ways of describing this here.

  • piston (float) – Displacement distance for piston.

  • roc (float) – radius of curvature mechanism adjustment, in microns.

  • trans_unit (str) – Unit for translations. Can be ‘meter’, ‘micron’, ‘millimeter’, ‘nanometer’, ‘m’, ‘mm’, ‘nm’, ‘um’

  • rot_unit (str) – Unit for rotations. Can be ‘urad’, ‘radian’, ‘milliradian’, ‘arcsec’, ‘arcmin’, ‘milliarcsec’

  • absolute (bool) – Same meaning as for JWST SURs: if true, move the segment to exactly this position. Otherwise moves are treated as incremental relative moves from the current position.

  • display (bool) – Display after moving?

  • delay_update (bool) – hold off on computing the WFE change? This is useful for computational efficiency if you’re moving a whole bunch of segments at once. Incompatible with display=True.

move_sm_local(xtilt=0.0, ytilt=0.0, rot_unit='urad', xtrans=0.0, ytrans=0.0, piston=0.0, trans_unit='micron', display=False, delay_update=False)

Move the secondary mirror in pose, using segment-local control coordinates.

These motions are always commanded in the segment-local “Control” coordinate systems, which are distinct for each segment. The SM is also handled a bit differently than all the PMSAs in terms of its local coordinate system, which this function handles behind the scenes.

Parameters
  • segment (str) – Segment name, e.g. ‘A1’. Use ‘SM’ for the secondary mirror.

  • xtilt, ytilt, clocking (floats) – Tilt angle, in microradians by default. ‘xtilt’ means tilt around the X axis, and similarly for ytilt.

  • xtrans, ytrans, piston (floats) – Displacement distance, in microns by default.

  • trans_unit (str) – Unit for translations. Can be ‘micron’, ‘millimeter’,’nanometer’, ‘mm’, ‘nm’, ‘um’

  • rot_unit (str) – Unit for rotations. Can be ‘urad’, ‘radian’, ‘milliradian’, ‘arcsec’, ‘arcmin’, ‘milliarcsec’

  • display (bool) – Display after moving?

  • delay_update (bool) – hold off on computing the WFE change? This is useful for computational efficiency if you’re moving a whole bunch of segments at once. Incompatible with display=True.

move_sur(sur_file, group=None, verbose=False, reverse=False)

Move using a JWST Segment Update Request file

Parameters
  • sur_file (file name) – Path to SUR XML file

  • group (one-based int index) – Index to a single group to run. Default is to run all groups. Note, this index counts up from 1 (not 0) for consistency with group indexing in the SUR files themselves.

  • verbose (bool) – Flag controlling whether moves are printed.

  • reverse (bool) – Run this SUR “backwards”, i.e. in opposite order of all groups and flipping the sign of all moves. (This can be useful for certain testing and mock data generation scenarios.)

name

string. Descriptive Name of this optic

opds_as_hdul(delta_time, slew_angles, delta_opds=None, wfe_dict=None, case=None, add_main_opd=True, slew_averages=False, return_ind=None, **kwargs)[source]

Convert series of delta OPDS to HDUList

powerspectrum(max_cycles=50, sampling=5, vmax=100, iterate=False)

Compute the spatial power spectrum of an aberrated wavefront.

Produces nice plots on screen.

Returns an array [low, mid, high] giving the RMS spatial frequencies in the different JWST-defined spatial frequency bins:

low: <=5 cycles/aperture mid: 5 < cycles <= 30 high: 30 < cycles

ptv(segment=None)

return peak to valley WFE in nanometers

Parameters

segment (string) – Segment name, to compute RMS for a single segment. Leave unspecified (None) to compute for the entire aperture.

property pupil_diam

Diameter of the pupil (if this is a pupil plane optic)

reset(verbose=True)[source]

Reset an OPD to the state it was loaded from disk.

i.e. undo all segment moves.

rms(segment=None)

Return RMS WFE in nanometers

Parameters

segment (string) – Segment name, to compute RMS for a single segment. Leave unspecified (None) to compute RMS WFE for the entire aperture. Segments are identified by name: A1-A6, B1-B6, C1-C6

property shape

Return shape of the OpticalElement, as a tuple

slew_pos_averages(delta_time, slew_angles, opds=None, wfe_dict=None, mn_func=<function mean>, interpolate=False, **kwargs)[source]

Get averages at each slew position

Given a series of times and slew angles, calculate the average OPD and WFE RMS error within each slew angle position. Returns a tuple with new arrays of (dt_new, opds_new, wfe_dict_new).

If input both opds and wfe_dict are not specified, then we call the evolve_dopd function and return .

Parameters
  • delta_time (astropy.units quantity object) – An array of times assuming astropy units.

  • slew_angles (ndarray) – The sun pitch angles at each delta_time, in degrees between -5 and +45.

  • opds (ndarray or None) – Cube of OPD images (or delta OPDs) associated with each delta_time. If set to None, then a new set of OPDs are not calculated.

  • wfe_dict (dict or None) – If specified, then must provide a dictionary where the values for each keywords are the WFE drift components associated with each delta_time. New set of WFE dictionary is not calculated if set to None.

  • mn_func (function) – Function to use for taking averages. Default: np.mean()

  • interpolate (bool) – Instead of taking average, use the interpolation function self.interp_dopds().

Keyword Arguments
  • case (string) – Either “BOL” for current best estimate at beginning of life, or “EOL” for more conservative prediction at end of life.

  • do_thermal (bool) – Include thermal slew component? Mostly for debugging purposes.

  • do_frill (bool) – Include frill component? Mostly for debugging purposes.

  • do_iec (bool) – Include IEC component? Good to exclude if calling this function repeatedly for evolution of multiple slews, then add IEC later.

  • amplitude (float) – Full amplitude of IEC arcsine distribution. Values will range from -0.5*amplitude to +0.5*amplitude.

  • period (float) – Period in minutes of IEC oscillations. Usually 3-5 minutes.

  • kind (str or int) – Specifies the kind of interpolation (if specified) as a string. Default: ‘linear’.

slew_scaling(start_angle, end_angle)[source]

WFE scaling due to slew angle

Scale the WSS Hexike components based on slew pitch angles.

Parameters
  • start_angle (float) – The starting sun pitch angle, in degrees between -5 and +45

  • end_angle (float) – The ending sun pitch angle, in degrees between -5 and +45

thermal_slew(delta_time, start_angle=- 5, end_angle=45, scaling=None, display=False, case='EOL', delay_update=False)

Update the OPD based on presence of a pitch angle change between observations.

Use a delta slew time along with the beginning and ending angles of the observatory relative to the sun (or the user can define a scaling factor) to determine the expected WFE caused by thermal variations. Note: The start_angle and end_angle are used together, but will be ignored if the scaling variable is set to somthing other than “None”.

The maximum HOT to COLD pitch angles are -5 to 45 degrees. With regards to this, we make some assumptions: 1. A COLD to HOT slew is just the negative of the HOT to COLD slew 2. The scaling factor can be simplified to a simple ratio of angles (this is

a gross over-simplification due to lack of a better model)

The HOT to COLD vs COLD to HOT nature of the slew is determined by the start and end angles

Note, multiple calls in a row to this function are NOT cumulative; rather, the model internally resets to the initial starting OPD each time, and calculates a single slew. This is intentional to be more reproducible and well defined, with less hidden history state. If you need a more complex time evolution, build that yourself by summing individual delta OPDs.

Parameters
  • delta_time (astropy.units quantity object) – The time between observations. Default units: “hour”

  • start_angle (float) – The starting sun pitch angle, in degrees between -5 and +45

  • end_angle (float) – The ending sun pitch angle, in degrees between -5 and +45

  • scaling (float between 0 and 1) – Scaling factor that can be used instead of the start_angle and end_angle parameters. This directly sets the amplitude of the drift and overrides the angles and case settings.

  • display (bool) – Display the updated OPD

  • case (string) – either “BOL” for current best estimate at beginning of life, or “EOL” for more conservative prediction at end of life. The amplitude of the thermal drift is roughly 3x lower for BOL (13 nm after 14 days) versus EOL (43 nm after 14 days).

  • delay_update (bool) – Users typically only need to call this directly if they have set the “delay_update” parameter to True in some function call to move mirrors.

update_opd(display=False, verbose=False)

Update the OPD based on the current linear model values.

Users typically only need to call this directly if they have set the “delay_update” parameter to True in some function call to move mirrors.

writeto(outname, overwrite=True, **kwargs)

Write OPD to a FITS file on disk

zern_seg(segment, vmax=150, unit='nm')

Show the Zernike terms applied to a given segment

zero(zero_original=False)

Reset an OPD to precisely zero everywhere.

Parameters

zero_original (bool) – should we zero out the stored copy of the original OPD? If so, then even using the reset() function won’t set this back to the original value.