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)
; astr
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 IDw_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_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.
- _write_output_validation(star_dict, psfex_cat_dict)[source]¶
Write Output Validation.
Save computed PSFs and stars to a FITS file.