shapepipe.modules.mccd_package.mccd_interpolation_script

shapepipe.modules.mccd_package.mccd_interpolation_script

MCCD INTERPOLATION SCRIPT.

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

Author

Tobias Liaudat

interp_MCCD(mccd_model_path, positions, ccd)[source]

Interpolate MCCD.

Interpolate MCCD model on requested positions.

Parameters
  • 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

Returns

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.

Parameters
  • 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()[source]

Get Position Parameters.

Read position parameters from a .psf file.

_get_galaxy_positions()[source]

Get Galaxy Positions.

Extract galaxy positions from a galaxy catalogue.

_get_psfshapes()[source]

Get PSF Shapes.

Compute shapes of PSF at galaxy positions using HSM.

_write_output()[source]

Write Output.

Save computed PSFs to fits file.

_get_starshapes(star_vign)[source]

Get Star Shapes.

Compute shapes of stars at stars positions using HSM.

Parameters

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

_get_psfexcatdict(psfex_cat_path)[source]

Get PSFEx Catalogue Dictionary.

Get data from a PSFEx .cat file.

Parameters

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

Returns

psfex_cat_dict – Dictionary containing information from PFSEx .cat file

Return type

dict

_write_output_validation(star_dict, psfex_cat_dict)[source]

Write Output Validation.

Save computed PSFs and stars to a FITS file.

Parameters
  • 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.

Parameters
  • 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_me()[source]

Interpolate Multi-Epoch.

Interpolate PSFs for multi-epoch run.

Returns

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

Return type

dict

_write_output_me(output_dict)[source]

Write Output Multi-Epoch.

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

Parameters

output_dict (dict) – Dictionnary of outputs to save