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

MAX_LEN_QUEUE

user_gain

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

Get the aggregated DOF.

get_dof_lv()

Get the DOF correction from the last visit.

get_field_idx_wfe_from_data_container(…)

Parse data container generated from calling WavefrontCollection.getListOfWavefrontErrorAvgInTakenData into an array with field indices and an array of wavefront errors.

get_fwhm_data()

Get an ndarray with the FWHM data for all the sensors.

get_fwhm_sensors()

Get list of fwhm sensor ids.

get_rejected_wavefront_errors()

Get rejected wavefront errors.

get_rejected_wfe()

Get the list of rejected wavefront error from the collection.

get_wavefront_errors()

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

Reject the correction of subsystems.

reject_unreasonable_wfe(listOfWfErr)

Reject the wavefront error that is unreasonable.

reset_fwhm_data()

Reset fhwm data.

reset_wfe_correction()

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.

Parameters
wavefront_errorsnp.array or list of float

Input wavefront errors (in um). If an array or list it must have the same number of elements of the intrinsic zernike coeffients.

configdict, optional

Optional additional configuration parameters to customize ofc. Default is None.

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.

Parameters
instrumentstr

Name of the instrument.

reference_idint

Id of the reference image.

configdict

Additional configuration overrides provided by the user.

Returns
wep_configurationdict

Configuration dictionary validated against the WEP schema.

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.

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

Get list of fwhm sensor ids.

Returns
list

List with the fwhm sensors ids.

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.

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.

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.

Parameters
visit_idint

Image visit id number.

configdict

Configuration for the image processing algorithm.

Raises
NotImplementedError

This function is not supported yet (DM-28708).

async process_comcam(intra_id, extra_id, config)

Process ComCam intra/extra focual images.

Parameters
intra_idint

Id of the intra-focal image.

extra_idint

Id of the extra-focal image.

configdict
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
rafloat

Right ascension in degrees. The value should be in (0, 360).

decfloat

Declination in degrees. The value should be in (-90, 90).

sky_anglefloat

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_filterlsst.ts.idl.enums.MTAOS.FilterType

Filter used while collecting the images.

modelsst.ts.idl.enums.MTAOS.Mode

Enumeration specifying the wfs mode.

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_valuesdict

Original values in ofc_data.

Notes

For each input argument, check whether it is a valid entry in self.ofc.ofc_data. If yes, save the original value to the original_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.