OFCController

class lsst.ts.ofc.OFCController(ofc_data, log=None)

Bases: object

Optical Feedback Control Controller.

This class is mainly used to determine the offset (uk) of degree of freedom (DOF) at time k+1 based on the wavefront error (yk) at time k.

Parameters
ofc_dataOFCData

Data container.

loglogging.Logger or None

Optional logging class to be used for logging operations. If None, creates a new logger.

Attributes
dof_statenp.array

State of telescope in the basis of degrees of freedom.

dof_state0np.array

Initial state of telescope in the basis of degrees of freedom.

loglogging.Logger

Logger class used for logging operations.

m1m3_bmfBendModeToForce

Class to convert bend mode to forces for M1M3.

m2_bmfBendModeToForce

Class to convert bend mode to forces for M2.

ofc_dataOFCData

OFC data container.

Attributes Summary

ETA

FWHM_ATM

aggregated_state

Returns the aggregated state.

gain

Get the gain value.

Methods Summary

aggregate_state(dof, dof_idx)

Aggregate the calculated degree of freedom (DOF) in the state.

authority()

Compute the authority of the system.

calc_uk_0(mat_f, qx, mat_h)

Calculate uk by referencing to "0".

calc_uk_x0(mat_f, qx, **kwargs)

Calculate uk by referencing to "x0".

calc_uk_x00(mat_f, qx, mat_h)

Calculate uk by referencing to "x00".

effective_fwhm_g4(pssn, sensor_names)

Calculate the effective FWHM by Gaussian quadrature.

fwhm_to_pssn(fwhm)

Convert the FWHM data to PSSN.

reset_dof_state()

Initialize the state to the state 0 in the basis of degree of freedom (DOF).

uk(filter_name, dof_state[, sensor_names])

Estimate the offset (uk) of degree of freedom (DOF) at time k+1 based on the wavefront error (yk) at time k.

uk_gain(filter_name, dof_state[, sensor_names])

Estimate uk in the basis of degree of freedom (DOF) with gain compensation.

Attributes Documentation

ETA = 1.086
FWHM_ATM = 0.6
aggregated_state

Returns the aggregated state.

Returns
np.ndarray

Aggregated state.

gain

Get the gain value.

Returns
gainfloat

Gain value in the feedback.

Methods Documentation

aggregate_state(dof, dof_idx)

Aggregate the calculated degree of freedom (DOF) in the state.

Parameters
dofnumpy.ndarray or list

Calculated DOF.

dof_idxnumpy.ndarray or list of int

Index array of degree of freedom.

authority()

Compute the authority of the system.

Returns
authoritynp.array
calc_uk_0(mat_f, qx, mat_h)

Calculate uk by referencing to “0”.

The offset will trace the real value and target for 0.

uk = -F’ * (QX + rho**2 * H * S).

Parameters
mat_fnumpy.ndarray

Matrix F.

qxnumpy.ndarray

qx array.

mat_hnumpy.ndarray

The H matrix (see equation above).

Returns
uknumpy.ndarray

Calculated uk in the basis of degree of freedom (DOF).

calc_uk_x0(mat_f, qx, **kwargs)

Calculate uk by referencing to “x0”.

The offset will only trace the previous one.

uk = -F’ * QX.

Parameters
mat_fnumpy.ndarray

Matrix F.

qxnumpy.ndarray

qx array.

kwargsdict

Additional keyword arguments. This is mainly added to provide similar interaface to other calc_uk_* methods.

Returns
uknumpy.ndarray

Calculated uk in the basis of degree of freedom (DOF).

calc_uk_x00(mat_f, qx, mat_h)

Calculate uk by referencing to “x00”. The offset will only trace the relative changes of offset without regarding the real value. uk = -F’ * [QX + rho**2 * H * (S - S0)].

Parameters
mat_fnumpy.ndarray

Matrix F.

qxnumpy.ndarray

qx array.

Returns
numpy.ndarray

Calculated uk in the basis of degree of freedom (DOF).

effective_fwhm_g4(pssn, sensor_names)

Calculate the effective FWHM by Gaussian quadrature.

FWHM: Full width at half maximum. FWHM = eta * FWHM_{atm} * sqrt(1/PSSN -1). Effective GQFWHM = sum_{i} (w_{i}* FWHM_{i}).

Parameters
pssnnumpy.ndarray or list

Normalized point source sensitivity (PSSN).

sensor_nameslist of string

List of sensor names.

Returns
float

Effective FWHM in arcsec by Gaussian quadrature.

Raises
ValueError

Input values are unphysical.

ValueError

Image quality weights sum is zero. Please check your weights.

fwhm_to_pssn(fwhm)

Convert the FWHM data to PSSN.

Take the array of FWHM values (nominally 1 per CCD) and convert it to PSSN (nominally 1 per CCD).

Parameters
fwhmnumpy.ndarray[x]

An array of FWHM values with sensor information.

Returns
pssnnumpy.ndarray[y]

An array of PSSN values.

reset_dof_state()

Initialize the state to the state 0 in the basis of degree of freedom (DOF).

uk(filter_name: str, dof_state: ndarray, sensor_names: list[str] | None = None) ndarray

Estimate the offset (uk) of degree of freedom (DOF) at time k+1 based on the wavefront error (yk) at time k.

uk in the basis of degree of freedom (DOF) without gain compensation.

Parameters
filter_namestring

Name of the filter.

dof_statenumpy.ndarray

Optical state in the basis of DOF.

sensor_nameslist of string

List of sensor names.

Returns
uknumpy.ndarray

Calculated uk in the basis of DOF.

Raises
RuntimeError

If xref strategy is not valid.

RuntimeError

If sensor_names is not provided for full array mode instruments.

ValueError

If image quality weights sum is zero.

uk_gain(filter_name: str, dof_state: ndarray, sensor_names: list[str] | None = None) ndarray

Estimate uk in the basis of degree of freedom (DOF) with gain compensation.

Parameters
filter_namestring

Name of the filter.

dof_statenumpy.ndarray

Optical state in the basis of DOF.

sensor_nameslist of string

List of sensor names.

Returns
uknumpy.ndarray

Calculated uk in the basis of DOF.

Raises
RuntimeError

If sensor_names is not provided for full array mode instruments.