wf_psf.psf_models.psf_models module

PSF_Models.

A module which provides general utility methods to manage the parameters of the psf model.

Authors:

Tobias Liaudat <tobiasliaudat@gmail.com> and Jennifer Pollack <jennifer.pollack@cea.fr>

exception wf_psf.psf_models.psf_models.PsfModelError(message='An error with your PSF model parameter settings occurred.')[source]

Bases: Exception

PSF Model Parameter Error exception class for specific error scenarios.

wf_psf.psf_models.psf_models.get_psf_model(model_params, training_hparams, *coeff_matrix)[source]

Get PSF Model Class Instance.

A function to instantiate a PSF model class.

Parameters:
  • model_name (str) – Short name of PSF model

  • model_params (type) – Recursive Namespace object

  • training_hparams (type) – Recursive Namespace object

  • coeff_matrix (Tensor or None, optional) – Initialization of the coefficient matrix defining the parametric psf field model

Returns:

psf_class – PSF model class instance

Return type:

class instance

wf_psf.psf_models.psf_models.get_psf_model_weights_filepath(weights_filepath)[source]

Get PSF model weights filepath.

A function to return the basename of the user-specified psf model weights path.

Parameters:

weights_filepath (str) – Basename of the psf model weights to be loaded.

Returns:

The absolute path concatenated to the basename of the psf model weights to be loaded.

Return type:

str

wf_psf.psf_models.psf_models.register_psfclass(psf_class)[source]

Register PSF Class.

A wrapper function to register all PSF model classes in a dictionary.

Parameters:

psf_class (type) – PSF Class

Returns:

psf_class – PSF class

Return type:

type

wf_psf.psf_models.psf_models.set_psf_model(model_name)[source]

Set PSF Model Class.

A function to select a class of the PSF model from a dictionary.

Parameters:

model_name (str) – Name of PSF model

Returns:

psf_class – Name of PSF model class

Return type:

class

wf_psf.psf_models.psf_models.simPSF(model_params)[source]

Simulated PSF model.

A function to instantiate a simulated PSF model object.

wf_psf.psf_models.psf_models.tf_obscurations(pupil_diam, N_filter=2)[source]

Tensor Flow Obscurations.

A function to generate obscurations as a tensor.

Parameters:
  • pupil_diam (float) – Size of the pupil diameter

  • N_filters (int) – Number of filters

Returns:

TensorFlow EagerTensor type

Return type:

Obscurations tensor

wf_psf.psf_models.psf_models.tf_zernike_cube(n_zernikes, pupil_diam)[source]

Tensor Flow Zernike Cube.

A function to generate Zernike maps on a three-dimensional tensor.

Parameters:
  • n_zernikes (int) – Number of Zernike polynomials

  • pupil_diam (float) – Size of the pupil diameter

Returns:

TensorFlow EagerTensor type

Return type:

Zernike map tensor