OICController¶
- class lsst.ts.ofc.OICController(ofc_data: OFCData, log: logging.Logger | None = None)¶
Bases:
BaseController
Optimal Integral Controller (OIC)
Attributes Summary
Returns the aggregated state.
Derivative filter coefficient.
Derivative gain.
Integral gain.
Proportional gain.
Methods Summary
aggregate_state
(dof, dof_idx)Aggregate the calculated degree of freedom (DOF) in the state.
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.
Initialize the state to the state 0 in the basis of degree of freedom (DOF).
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 offwhm
andsensor_names
are different.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 timek+1
based on the wavefront error (yk
) at timek
.Attributes Documentation
- ETA = 1.086¶
- FWHM_ATM = 0.6¶
- derivative_filter_coeff¶
Derivative filter coefficient.
Returns¶
float
Derivative filter coefficient.
- 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¶
- dof
numpy.ndarray
orlist
Calculated DOF.
- dof_idx
numpy.ndarray
orlist[int]
Index array of degree of freedom.
- dof
- 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_f
numpy.ndarray
Matrix F.
- qx
numpy.ndarray
qx array.
- mat_h
numpy.ndarray
The H matrix (see equation above).
Returns¶
- uk
numpy.ndarray
Calculated uk in the basis of degree of freedom (DOF).
- mat_f
- 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_f
numpy.ndarray
Matrix F.
- qx
numpy.ndarray
qx array.
- kwargs
dict[str, typing.Any]
Additional keyword arguments. This is mainly added to provide similar interaface to other
calc_uk_*
methods.
Returns¶
- uk
numpy.ndarray
Calculated uk in the basis of degree of freedom (DOF).
- mat_f
- 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_f
numpy.ndarray
Matrix F.
- qx
numpy.ndarray
qx array.
- mat_h
numpy.ndarray
Matrix H.
Returns¶
numpy.ndarray
Calculated uk in the basis of degree of freedom (DOF).
- mat_f
- calculate_pid_step(state: ndarray[float]) ndarray[float] ¶
Calculate the control signal using PID controller.
Parameters¶
- state
np.ndarray[float]
State of the system.
Returns¶
- uk
numpy.ndarray
Calculated uk in the basis of DOF.
- state
- 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_name
string
Name of the filter.
- dof_state
numpy.ndarray
Optical state in the basis of DOF.
- sensor_names
list
[string
] orNone
List of sensor names.
Returns¶
- control_effort
numpy.ndarray
Calculated uk in the basis of DOF.
Raises¶
- RuntimeError
If
sensor_names
is not provided for full array mode instruments.
- filter_name
- 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¶
- pssn
numpy.ndarray
orlist
Normalized point source sensitivity (PSSN).
- sensor_names
list
[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.
- pssn
- 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¶
- fwhm
numpy.ndarray[x]
An array of FWHM values with sensor information.
Returns¶
- pssn
numpy.ndarray[y]
An array of PSSN values.
- fwhm
- 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_names
list
[string
] List of sensor names.
Raises¶
- RuntimeError
If size of
fwhm
andsensor_names
are different.
- sensor_names
- 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 timek+1
based on the wavefront error (yk
) at timek
.uk in the basis of degree of freedom (DOF) without gain compensation.
Parameters¶
- filter_name
string
Name of the filter.
- dof_state
numpy.ndarray
Optical state in the basis of DOF.
- sensor_names
list
[string
] List of sensor names.
Returns¶
- uk
numpy.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.
- filter_name