wf_psf.psf_models.psf_models
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>
Functions
|
Define the model-compilation parameters. |
|
Generate 3D Zernike Maps. |
|
Get PSF Model Class Instance. |
|
Get PSF model weights filepath. |
|
Register PSF Factory Class. |
|
Set PSF Model Class. |
|
Instantiate and configure a Simulated PSF model. |
|
Tensor Flow Obscurations. |
Classes
Base factory class for PSF models. |
Exceptions
|
PSF Model Parameter Error exception class. |
- class wf_psf.psf_models.psf_models.PSFModelBaseFactory[source]
Bases:
objectBase factory class for PSF models.
This class serves as the base factory for instantiating PSF (Point Spread Function) models. Subclasses should implement the get_model_instance method to provide specific PSF model instances.
- None
- get_model_instance(model_params, training_params, data=None, coeff_matrix=None)[source]
Instantiates a PSF model with the provided parameters.
Notes
Subclasses of PSFModelBaseFactory should override the get_model_instance method to provide implementation-specific logic for instantiating PSF model instances.
Methods
get_model_instance(model_params, training_params)Instantiate a PSF model instance.
- get_model_instance(model_params, training_params, data=None, coeff_matrix=None)[source]
Instantiate a PSF model instance.
- Parameters:
model_params (Recursive Namespace) – A Recursive Namespace object containing parameters for this PSF model class.
training_params (Recursive Namespace) – A Recursive Namespace object containing training hyperparameters for this PSF model class.
data (DataConfigHandler) – A DataConfigHandler object that provides access to training and test datasets, as well as prior knowledge like Zernike coefficients.
coeff_mat (Tensor or None, optional) – Coefficient matrix defining the parametric PSF field model.
- Returns:
An instance of the PSF model.
- Return type:
PSF model instance
- exception wf_psf.psf_models.psf_models.PSFModelError(message='An error with your PSF model parameter settings occurred.')[source]
Bases:
ExceptionPSF Model Parameter Error exception class.
This exception class is used to handle errors related to PSF (Point Spread Function) model parameters.
- Parameters:
message (str, optional) – Error message to be raised. Defaults to “An error with your PSF model parameter settings occurred.”
- wf_psf.psf_models.psf_models.build_PSF_model(model_inst, optimizer=None, loss=None, metrics=None)[source]
Define the model-compilation parameters.
Specially the loss function, the optimizer and the metrics.
- wf_psf.psf_models.psf_models.generate_zernike_maps_3d(n_zernikes, pupil_diam)[source]
Generate 3D Zernike Maps.
This function generates Zernike maps on a three-dimensional tensor.
- Parameters:
- Returns:
A TensorFlow EagerTensor containing the Zernike map tensor.
- Return type:
tf.Tensor
Notes
The Zernike maps are generated using the specified number of Zernike polynomials and the size of the pupil diameter. The resulting tensor contains the Zernike maps in a three-dimensional format.
- wf_psf.psf_models.psf_models.get_psf_model(*psf_model_params)[source]
Get PSF Model Class Instance.
A function to instantiate a PSF model class.
- Parameters:
*psf_model_params (tuple) – Positional arguments representing the parameters required to instantiate the PSF model.
- Returns:
An instance of the PSF model class based on the provided parameters.
- Return type:
PSF model 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.
- wf_psf.psf_models.psf_models.register_psfclass(psf_factory_class)[source]
Register PSF Factory Class.
A function to register a PSF factory class in a dictionary.
- Parameters:
factory_class (type) – PSF Factory Class
- 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]
Instantiate and configure a Simulated PSF model.
This function creates a PSFSimulator instance with the given model parameters, generates random Zernike coefficients, normalizes them, and produces a monochromatic PSF.
- Parameters:
model_params (Recursive Namespace) – A recursive namespace object storing model parameters
- Returns:
A configured PSFSimulator instance with the specified model parameters.
- Return type: