wf_psf.psf_models.psf_model_parametric
PSF Model Parametric.
A module which defines the classes and methods to manage the parameters of the psf parametric model.
- Authors:
Tobias Liaudat <tobiasliaudat@gmail.com> and Jennifer Pollack <jennifer.pollack@cea.fr>
Classes
|
Parametric PSF field model. |
- class wf_psf.psf_models.psf_model_parametric.TFParametricPSFFieldModel(*args: Any, **kwargs: Any)[source]
Bases:
ModelParametric PSF field model.
Fully parametric model based on the Zernike polynomial basis.
- Parameters:
ids (tuple) – A tuple storing the string attribute of the PSF model class
zernike_maps (Tensor(n_batch, opd_dim, opd_dim)) – Zernike polynomial maps.
obscurations (Tensor(opd_dim, opd_dim)) – Predefined obscurations of the phase.
batch_size (int) – Batch size.
output_Q (float) – Oversampling used. This should match the oversampling Q used to generate the diffraction zero padding that is found in the input packed_SEDs. We call this other Q the input_Q. In that case, we replicate the original sampling of the model used to calculate the input packed_SEDs. The final oversampling of the generated PSFs with respect to the original instrument sampling depend on the division input_Q/output_Q. It is not recommended to use output_Q < 1. Although it works with float values it is better to use integer values.
l2_param (float) – Parameter going with the l2 loss on the opd. If it is 0. the loss is not added. Default is 0..
output_dim (int) – Output dimension of the PSF stamps.
n_zernikes (int) – Order of the Zernike polynomial for the parametric model.
d_max (int) – Maximum degree of the polynomial for the Zernike coefficient variations.
x_lims ([float, float]) – Limits for the x coordinate of the PSF field.
y_lims ([float, float]) – Limits for the x coordinate of the PSF field.
coeff_mat (Tensor or None) – Initialization of the coefficient matrix defining the parametric psf field model.
Methods
__call__(*args, **kwargs)Call self as a function.
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.
set_output_Q(output_Q[, output_dim])Set the value of the output_Q parameter.
- 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
- ids = ('parametric',)
- predict_mono_psfs(input_positions, lambda_obs, phase_N)[source]
Predict a set of monochromatic PSF at desired positions.
input_positions: Tensor(batch_dim x 2)
- lambda_obs: float
Observed wavelength in um.
- phase_N: int
Required wavefront dimension. Should be calculated with as:
simPSF_np = wf_psf.sims.psf_simulator.PSFSimulator(...)phase_N = simPSF_np.feasible_N(lambda_obs)
- predict_opd(input_positions)[source]
Predict the OPD at some positions.
- Parameters:
input_positions (Tensor(batch_dim x 2)) – Positions to predict the OPD.
- Returns:
opd_maps – OPD at requested positions.
- Return type:
Tensor [batch x opd_dim x opd_dim]