This module computes the PSFs from a MCCD model at several galaxy positions.


Tobias Liaudat

interp_MCCD(mccd_model_path, positions, ccd)[source]

Interpolate MCCD.

Interpolate MCCD model on requested positions.

  • mccd_model_path (str) – Path to the correct MCCD model

  • positions (numpy.ndarray) – Positions for the PSF recovery in local coordinates with respect to the ccd; array shape: (n_pos, 2)

  • ccd (int) – CCD from where the positions were taken


PSFs – Recovered PSFs at the required positions; the returned array has the shape: (n_pos, n_pix, n_pix); a str is returned if some error occurs

Return type

numpy.ndarray or str

class MCCDinterpolator(dotpsf_path, galcat_path, output_path, img_number, w_log, pos_params=None, get_shapes=True)[source]

Bases: object

The MCCD Interpolator Class.

This class uses a PSFEx output file to compute the PSF at desired positions.

  • dotpsf_path (str) – Path to PSFEx output file

  • galcat_path (str) – Path to SExtractor-like galaxy catalogue

  • output_path (str) – Path to folder where output PSFs should be written

  • img_number (str) – Corresponds to shapepipe’s module input file_number_string which is the input file ID

  • w_log (logging.Logger) – Logging instance

  • pos_params (list, optional) – Desired position parameters, if provided, there should be exactly two, and they must also be present in the galaxy catalogue; otherwise, they are read directly from the .psf file.

  • get_shapes (bool) – If True will compute shapes for the PSF model


Get Position Parameters.

Read position parameters from a .psf file.


Get Galaxy Positions.

Extract galaxy positions from a galaxy catalogue.


Get PSF Shapes.

Compute shapes of PSF at galaxy positions using HSM.


Write Output.

Save computed PSFs to fits file.


Get Star Shapes.

Compute shapes of stars at stars positions using HSM.


star_vign (numpy.ndarray) – Array containing the star’s vignets


Get PSFEx Catalogue Dictionary.

Get data from a PSFEx .cat file.


psfex_cat_path (str) – Path to the .cat file from PSFEx


psfex_cat_dict – Dictionary containing information from PFSEx .cat file

Return type


_write_output_validation(star_dict, psfex_cat_dict)[source]

Write Output Validation.

Save computed PSFs and stars to a FITS file.

  • star_dict (dict) – Dictionary containing star informations

  • psfex_cat_dict (dict) – Dictionary containing information from PFSEx .cat file

process_me(dot_psf_dir, dot_psf_pattern, f_wcs_path)[source]

Process Multi-Epoch.

  • dot_psf_dir (str) – Path to the directory containing the PSF model files.

  • dot_psf_pattern (str) – Common pattern of the PSF model files; e.g. fitted_model

  • f_wcs_path (str) – Path to the log file containing the WCS for each CCD


Interpolate Multi-Epoch.

Interpolate PSFs for multi-epoch run.


output_dict – Dictionnary containing object IDs, the interpolated PSFs and shapes (optionally)

Return type



Write Output Multi-Epoch.

Save computed PSFs to numpy object file for multi-epoch run.


output_dict (dict) – Dictionnary of outputs to save