BaseController¶
- class lsst.ts.ofc.BaseController(ofc_data: OFCData, log: Logger | None = None)¶
 Bases:
objectBase Controller.
This class is the base class for all the controllers. This class is mainly used to determine the offset (
uk) of degree of freedom (DOF) at timek+1based on the wavefront error (yk) at timek.Parameters¶
- ofc_data
OFCData OFC Data.
- log
logging.LoggerorNone Optional logging class to be used for logging operations. If
None, creates a new logger.
Attributes¶
- dof_state
np.array State of telescope in the basis of degrees of freedom.
- dof_state0
np.array Initial state of telescope in the basis of degrees of freedom.
- integral
np.array Integral of the error.
- kp
float Proportional gain.
- ki
float Integral gain.
- kd
float Derivative gain.
- log
logging.Logger Logger class used for logging operations.
- ofc_data
OFCData OFC data.
- previous_error
np.array Previous error.
- pssn_data
dict PSSN data.
- setpoint
np.array Setpoint for the PID controller.
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.
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).
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_aggregated_state(value)Set the aggregated state.
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 offwhmandsensor_namesare different.Attributes Documentation
- ETA = 1.086¶
 
- FWHM_ATM = 0.6¶
 
- derivative_filter_coeff¶
 Derivative filter coefficient.
Returns¶
floatDerivative filter coefficient.
- kp¶
 Proportional gain.
Methods Documentation
- aggregate_state(dof: ndarray[float] | list, dof_idx: ndarray[int] | list[int]) None¶
 Aggregate the calculated degree of freedom (DOF) in the state.
Parameters¶
- dof
numpy.ndarrayorlist Calculated DOF.
- dof_idx
numpy.ndarrayorlist[int] Index array of degree of freedom.
- dof
 
- 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).
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.
Raises¶
- NotImplementedError
 Child class should implemented this.
- 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.ndarrayorlist Normalized point source sensitivity (PSSN).
- sensor_names
list[string] List of sensor names.
Returns¶
floatEffective 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_aggregated_state(value: ndarray[float]) None¶
 Set the aggregated state.
Parameters¶
- value
np.ndarray[float] Aggregated state.
- value
 
- 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
fwhmandsensor_namesare different.
- sensor_names
 
- ofc_data