wf_psf.psf_models.psf_model_semiparametric
PSF Model Semi-Parametric.
A module which defines the classes and methods to manage the parameters of the psf semi-parametric model.
- Authors:
Tobias Liaudat <tobiasliaudat@gmail.com> and Jennifer Pollack <jennifer.pollack@cea.fr>
Classes
Factory class for the SemiParametric PSF Field Model. |
|
|
PSF field forward model. |
- class wf_psf.psf_models.psf_model_semiparametric.SemiParamFieldFactory[source]
Bases:
PSFModelBaseFactoryFactory class for the SemiParametric PSF Field Model.
This factory class is responsible for instantiating instances of the SemiParametric PSF Field Model. It is registered with the PSF model factory registry.
- Parameters:
ids (tuple) – A tuple containing identifiers for the factory class.
- get_model_instance(model_params, training_params, data=None, coeff_mat=None)[source]
Instantiates an instance of the SemiParametric PSF Field Model with the provided parameters.
Methods
get_model_instance(model_params, training_params)Get Model Instance.
- get_model_instance(model_params, training_params, data=None, coeff_mat=None)[source]
Get Model Instance.
This method creates an instance of the SemiParametric PSF Field Model using the provided parameters.
- Parameters:
model_params (Recursive Namespace) – Recursive Namespace object containing parameters for this PSF model class.
training_params (Recursive Namespace) – Parameters for training the PSF model.
data (object or None, optional) – Data used for training the PSF model.
coeff_mat (Tensor or None, optional) – Zernike coefficient matrix for the parametric PSF field model.
- Returns:
An instance of the SemiParametric PSF Field Model.
- Return type:
- ids = ('poly',)
- class wf_psf.psf_models.psf_model_semiparametric.TFSemiParametricField(*args: Any, **kwargs: Any)[source]
Bases:
ModelPSF field forward model.
Semi parametric model based on the Zernike polynomial basis.
- Parameters:
model_params (Recursive Namespace) – Recursive Namespace object containing parameters for this PSF model class.
training_params (Recursive Namespace) – Recursive Namespace object containing training hyperparameters for this PSF model class.
coeff_mat (Tensor or None) – Zernike coefficient matrix for the parametric PSF field model.
Methods
__call__(*args, **kwargs)Call self as a function.
assign_S_mat(s_mat)Assign DD features matrix.
assign_coeff_matrix(coeff_mat)Assign coefficient matrix.
call(inputs)Define the PSF field forward model.
Get coefficient matrix.
predict_mono_psfs(input_positions, ...)Predict a set of monochromatic PSF at desired positions.
predict_opd(input_positions)Predict the OPD at some positions.
project_DD_features([tf_zernike_cube])Project data-driven features.
Set to non-zero the non-parametric part.
set_output_Q(output_Q[, output_dim])Set the value of the output_Q parameter.
set_trainable_layers([param_bool, nonparam_bool])Set Trainable Layers.
Set to zero the non-parametric part.
- assign_coeff_matrix(coeff_mat)[source]
Assign coefficient matrix.
A function to set the coefficient matrix.
- Parameters:
coeff_mat (float) – Tensor Flow coefficient matrix for the parametric PSF field model
- call(inputs)[source]
Define the PSF field forward model.
[1] From positions to Zernike coefficients [2] From Zernike coefficients to OPD maps [3] From OPD maps and SED info to polychromatic PSFs
OPD: Optical Path Differences
- get_coeff_matrix()[source]
Get coefficient matrix.
A function to get the coefficient matrix for parametric model.
- Returns:
coefficient matrix – Tensor Flow coefficient matrix for the parametric PSF field model
- Return type:
- predict_mono_psfs(input_positions, lambda_obs, phase_N)[source]
Predict a set of monochromatic PSF at desired positions.
- predict_opd(input_positions)[source]
Predict the OPD at some positions.
- Parameters:
input_positions (tf.Tensor) – Positions to predict the OPD. Tensor dimensions are (batch_dim, 2)
- Returns:
opd_maps – OPD at requested positions. Tensor dimensions are (batch, opd_dim, opd_dim)
- Return type:
tf.Tensor
- project_DD_features(tf_zernike_cube=None)[source]
Project data-driven features.
Project non-parametric wavefront onto first n_z Zernikes and transfer their parameters to the parametric model. This method updates the value of the S matrix in the non-parametric layer self.tf_np_poly_opd.
- Parameters:
tf_zernike_cube (tf.Tensor) – Zernike maps used for the projection.
- set_nonzero_nonparam()[source]
Set to non-zero the non-parametric part.
A function to set non-parametric alpha parameters equal to non-zero values.
- set_output_Q(output_Q, output_dim=None)[source]
Set the value of the output_Q parameter.
Useful for generating/predicting PSFs at a different sampling wrt the observation sampling.