Model¶
- class lsst.ts.MTAOS.Model(instrument, data_path, ofc_data, log=None, run_name='mtaos_wep', collections='LSSTComCam/raw/all,LSSTComCam/calib', pipeline_instrument=None, pipeline_n_processes=9, data_instrument_name=None, reference_detector=0, zernike_table_name='zernikeEstimateRaw')¶
Bases:
object
Attributes Summary
Return the user gain.
Methods Summary
add_correction
(wavefront_errors[, config])Compute ofc corrections from user-defined wavefront erros.
calculate_corrections
(**kwargs)Time execution of function
func
.generate_wep_configuration
(instrument, …)Generate configuration dictionary for running the WEP pipeline based on a reference image id and a configuration dictionary.
Get the aggregated DOF.
Get the DOF correction from the last visit.
Parse data container generated from calling
WavefrontCollection.getListOfWavefrontErrorAvgInTakenData
into an array with field indices and an array of wavefront errors.Get an ndarray with the FWHM data for all the sensors.
Get list of fwhm sensor ids.
Get rejected wavefront errors.
Get the list of rejected wavefront error from the collection.
Get wavefront errors.
get_wfe
()Get the list of wavefront error from the collection.
pre_process
(visit_id, config)Pre-process image for WEP.
process_comcam
(intra_id, extra_id, config)Process ComCam intra/extra focual images.
Reject the correction of subsystems.
reject_unreasonable_wfe
(listOfWfErr)Reject the wavefront error that is unreasonable.
Reset fhwm data.
Reset the current calculation contains the wavefront error and subsystem corrections to be empty.
run_wep
(**kwargs)Time execution of function
func
.select_sources
(ra, dec, sky_angle, …)Setup and run source selection algorithm.
set_fwhm_data
(sensor_id, fwhm_data)Set the FWHM sensor data.
set_ofc_data_values
(**kwargs)Set ofc data values.
Attributes Documentation
- MAX_LEN_QUEUE = 10¶
- user_gain¶
Return the user gain.
Methods Documentation
- add_correction(wavefront_errors, config=None)¶
Compute ofc corrections from user-defined wavefront erros.
- calculate_corrections(**kwargs)¶
Time execution of function
func
.The method can either me a normal method or a coroutine.
- generate_wep_configuration(instrument, reference_id, config)¶
Generate configuration dictionary for running the WEP pipeline based on a reference image id and a configuration dictionary.
- get_dof_aggr()¶
Get the aggregated DOF.
DOF: Degree of freedom.
- Returns
- numpy.ndarray
Aggregated DOF.
- get_dof_lv()¶
Get the DOF correction from the last visit.
DOF: Degree of freedom.
- Returns
- numpy.ndarray
DOF correction from the last visit.
- static get_field_idx_wfe_from_data_container(data_container)¶
Parse data container generated from calling
WavefrontCollection.getListOfWavefrontErrorAvgInTakenData
into an array with field indices and an array of wavefront errors.- Parameters
- data_container: `dict`
Dictionary returned by
WavefrontCollection.getListOfWavefrontErrorAvgInTakenData()
.
- Returns
- field_idx:
np.ndarray [int]
Array with field indexes.
- wfe:
np.ndarray
Array of arrays with the zernike coeficients for each field index.
- field_idx:
- get_fwhm_data()¶
Get an ndarray with the FWHM data for all the sensors.
FWHM: Full width at half maximum.
- Returns
np.ndarray
2-D array with the fwhm data. Each element of the array contains an array with the fwhm data (in arcsec).
- get_rejected_wavefront_errors()¶
Get rejected wavefront errors.
- Returns
- field_idx:
np.ndarray [int]
Array with field indexes.
- wfe:
np.ndarray
Array of arrays with the zernike coeficients for each field index.
- field_idx:
- get_rejected_wfe()¶
Get the list of rejected wavefront error from the collection.
This is to let MtaosCsc to publish the latest rejected wavefront error.
- Returns
- list[lsst.ts.wep.ctrlIntf.SensorWavefrontData]
List of rejected wavefront error data.
- get_wavefront_errors()¶
Get wavefront errors.
- Returns
- field_idx:
np.ndarray [int]
Array with field indexes.
- wfe:
np.ndarray
Array of arrays with the zernike coeficients for each field index.
- field_idx:
- get_wfe()¶
Get the list of wavefront error from the collection.
This is to let MtaosCsc to publish the latest calculated wavefront error.
- Returns
- list[lsst.ts.wep.ctrlIntf.SensorWavefrontData]
List of wavefront error data.
- async pre_process(visit_id, config)¶
Pre-process image for WEP.
The outputs of this command are donut images that are ready for curvature wavefront sensing.
- async process_comcam(intra_id, extra_id, config)¶
Process ComCam intra/extra focual images.
- reject_correction()¶
Reject the correction of subsystems.
- reject_unreasonable_wfe(listOfWfErr)¶
Reject the wavefront error that is unreasonable.
The input listOfWfErr might be updated after calling this function. Some elements might be pop out for the bad values.
- Parameters
- listOfWfErrlist[lsst.ts.wep.ctrlIntf.SensorWavefrontData]
List of wavefront error data.
- reset_fwhm_data()¶
Reset fhwm data.
- reset_wfe_correction()¶
Reset the current calculation contains the wavefront error and subsystem corrections to be empty.
This function is needed for the long slew angle of telescope.
- async run_wep(**kwargs)¶
Time execution of function
func
.The method can either me a normal method or a coroutine.
- async select_sources(ra, dec, sky_angle, obs_filter, mode)¶
Setup and run source selection algorithm.
- Parameters
- ra
float
Right ascension in degrees. The value should be in (0, 360).
- dec
float
Declination in degrees. The value should be in (-90, 90).
- sky_angle
float
The sky position angle in degrees (0 to 360). This is the angle measured relative to the north celestial pole (NCP), turning positive into the direction of the right ascension.
- obs_filter
lsst.ts.idl.enums.MTAOS.FilterType
Filter used while collecting the images.
- mode
lsst.ts.idl.enums.MTAOS.Mode
Enumeration specifying the wfs mode.
- ra
- Raises
- NotImplementedError
This function is not supported yet (DM-28708).
- set_fwhm_data(sensor_id, fwhm_data)¶
Set the FWHM sensor data.
FWHM: Full width at half maximum.
- Parameters
- sensorIdint
Sensor Id.
- fwhm_datanumpy.ndarray
FWHM values for this sensor.
- Raises
- RuntimeError
If input
sensor_id
is not in the list of ids for the configured camera.
- async set_ofc_data_values(**kwargs)¶
Set ofc data values.
- Parameters
- kwargs: `dict`
Input keyword arguments. The method does not expect any particular input.
- Returns
- original_ofc_data_values
dict
Original values in
ofc_data
.
- original_ofc_data_values
Notes
For each input argument, check whether it is a valid entry in
self.ofc.ofc_data
. If yes, save the original value to theoriginal_ofc_data_values
dictionary and so on. If it fails to set a particular value, undo all the other changes and raise the exception.Uppon success, return the original values so users can restore it later.