OICController

class lsst.ts.ofc.OICController(ofc_data: OFCData, log: logging.Logger | None = None)

Bases: BaseController

Optimal Integral Controller (OIC)

Attributes Summary

ETA

FWHM_ATM

aggregated_state

Returns the aggregated state.

derivative_filter_coeff

Derivative filter coefficient.

kd

Derivative gain.

ki

Integral gain.

kp

Proportional gain.

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".

calculate_pid_step(state)

Calculate the control signal using PID controller.

control_step(filter_name, dof_state[, ...])

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

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).

reset_history()

Reset the history of the controller.

set_fwhm_data(fwhm, sensor_names)

Set the list of FWHMSensorData of each CCD of camera. Parameters ---------- fwhm : np.ndarray[float] Array of arrays (e.g. 2-d array) which contains the FWHM data. Each element contains an array of fwhm (in arcsec) measurements for a particular sensor. sensor_names : list [string] List of sensor names. Raises ------ RuntimeError If size of fwhm and sensor_names are different.

set_pssn_gain()

Set the gain value based on the PSSN, which comes from the FWHM by DM team.

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.

Attributes Documentation

ETA = 1.086
FWHM_ATM = 0.6
aggregated_state

Returns the aggregated state.

Returns

np.ndarray[float]

Aggregated state.

derivative_filter_coeff

Derivative filter coefficient.

Returns

float

Derivative filter coefficient.

kd

Derivative gain.

Returns

float

Derivative gain.

ki

Integral gain.

Returns

float

Integral gain.

kp

Proportional gain.

Methods Documentation

aggregate_state(dof: numpy.ndarray[float] | list, dof_idx: numpy.ndarray[int] | list[int]) None

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

Parameters

dofnumpy.ndarray or list

Calculated DOF.

dof_idxnumpy.ndarray or list[int]

Index array of degree of freedom.

authority() ndarray[float]

Compute the authority of the system.

Returns

authority : np.array

calc_uk_0(mat_f: ndarray[float], qx: ndarray[float], mat_h: ndarray[float]) ndarray[float]

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: ndarray[float], qx: ndarray[float], **kwargs: dict[str, Any]) ndarray[float]

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[str, typing.Any]

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: ndarray[float], qx: ndarray[float], mat_h: ndarray[float]) ndarray[float]

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.

mat_hnumpy.ndarray

Matrix H.

Returns

numpy.ndarray

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

calculate_pid_step(state: ndarray[float]) ndarray[float]

Calculate the control signal using PID controller.

Parameters

statenp.ndarray[float]

State of the system.

Returns

uknumpy.ndarray

Calculated uk in the basis of DOF.

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

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 [string] or None

List of sensor names.

Returns

control_effortnumpy.ndarray

Calculated uk in the basis of DOF.

Raises

RuntimeError

If sensor_names is not provided for full array mode instruments.

effective_fwhm_g4(pssn: ndarray[float], sensor_names: list[str]) float

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 [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: ndarray[float]) ndarray[float]

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() None

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

reset_history() None

Reset the history of the controller.

set_fwhm_data(fwhm: ndarray[float], sensor_names: list[str]) None

Set the list of FWHMSensorData of each CCD of camera. Parameters ———- fwhm : np.ndarray[float]

Array of arrays (e.g. 2-d array) which contains the FWHM data. Each element contains an array of fwhm (in arcsec) measurements for a particular sensor.

sensor_nameslist [string]

List of sensor names.

Raises

RuntimeError

If size of fwhm and sensor_names are different.

set_pssn_gain() None

Set the gain value based on the PSSN, which comes from the FWHM by DM team.

Raises

RuntimeError

If pssn_data is not properly set.

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

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 [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.

RuntimeError

If Gaussian Quadrature points and weights are not provided for LSST instrument.

RuntimeError

If sensor names are not provided for full array mode instruments.