shapepipe.modules.psfex_interp_package.psfex_interp

shapepipe.modules.psfex_interp_package.psfex_interp

PSFEX INTERPOLATION SCRIPT.

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

Authors

Morgan Schmitz and Axel Guinot

interpsfex(dotpsfpath, pos, thresh_star, thresh_chi2)[source]

Interpolate PSFEx.

Use PSFEx generated model to perform spatial PSF interpolation.

Parameters
  • dotpsfpath (str) – Path to .psf file (PSFEx output)

  • pos (numpy.ndarray) – Positions where the PSF model should be evaluated

  • thresh_star (int) – Threshold of stars under which the PSF is not interpolated

  • thresh_chi2 (int) – Threshold for chi squared

Returns

Array of PSFs, each row is the PSF image at the corresponding position requested

Return type

numpy.ndarray

class PSFExInterpolator(dotpsf_path, galcat_path, output_path, img_number, w_log, pos_params=None, get_shapes=True, star_thresh=20, chi2_thresh=2)[source]

Bases: object

The PSFEx 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) – File number string

  • w_log (logging.Logger) – Logging instance

  • pos_params (list, optional) – Desired position parameters, ff 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

  • star_thresh (int) – Threshold of stars under which the PSF is not interpolated

  • thresh_chi2 (int) – Threshold for chi squared

process()[source]

Process.

Process the PSF interpolation single-epoch run.

_get_position_parameters()[source]

Get Position Parameters.

Read position parameters from .psf file.

_get_galaxy_positions()[source]

Get Galaxy Positions.

Extract galaxy positions from galaxy catalogue.

_interpolate()[source]

Interpolate.

Run Sheldon and Rykoff’s PSFEx interpolator method at the desired positions.

_get_psfshapes()[source]

Get PSF Shapes.

Compute shapes of PSF at galaxy positions using HSM.

_write_output()[source]

Write Output.

Save computed PSFs to a FITS file.

process_validation(psfex_cat_path)[source]

Process Validation.

Process validation steps.

Parameters

str – Path to PSFEx catalogue

_get_starshapes(star_vign)[source]

Get Star Shapes.

Compute shapes of stars at stars positions using HSM.

Parameters

numpy.ndarray – Array containing the star’s vignets.

_get_psfexcatdict(psfex_cat_path)[source]

Get PSFEx Catalogue Dictionary.

Get data from PSFEx .cat file.

Parameters

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

Returns

Dictionary containing information from the PFSEx .cat file

Return type

dict

_write_output_validation(star_dict, psfex_cat_dict)[source]

Write Output Validation.

Save computed PSFs and stars to fits file.

Parameters
  • star_dict (dict) – Dictionary containing star information

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

process_me(dot_psf_dir, dot_psf_pattern, f_wcs_path)[source]

Process Multi-Epoch.

Process the multi-epoch.

Parameters
  • dot_psf_dir (str) – Path to the directory containing the .psf files

  • dot_psf_pattern (str) – Common pattern of the .psf files

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

_interpolate_me()[source]

Interpolate Multi-Epoch.

Interpolate PSFs for multi-epoch run.

Returns

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