shapepipe.modules.mccd_package.shapepipe_auxiliary_mccd

shapepipe.modules.mccd_package.shapepipe_auxiliary_mccd

MCCD AUXILIARY FUNCTIONS.

This module contains auxiliary functions for the MCCD package that are needed by the MCCD runners.

Author

Tobias Liaudat

mccd_preprocessing_pipeline(input_file_list, output_path, input_file_position=0, min_n_stars=20, separator='-', CCD_id_filter_list=None, outlier_std_max=100.0, save_masks=True, save_name='train_star_selection', save_extension='.fits', verbose=True, print_fun=None)[source]

Preprocess Input Catalogue.

Parameters
  • input_file_list (list) – Input file list as taken from shapepipe’s input

  • output_path (str) – Path to the folder where to save the preprocessed files

  • input_file_position (int) – Element position from the input_file_list to preprocess; default is 0

  • min_n_stars (int) – Minimum number of stars in order to preprocess the CCD; default is 20

  • separator (str) – Separator string that separates the catalogue id and the CCD id; default is '-'

  • CCD_id_filter_list (list) – A list that corresponds to the CCDs that should be preprocessed, if it is None, all the CCDs are preprocessed (the current version is hardcoded for MegaCam)

  • outlier_std_max (float) – Parameter regulating the shape outlier removal, the default is very high so as it is not done at all, a decent number would be 10; default is 100.

  • save_masks (bool) – If masks should be saved in the new file; default is True

  • save_name (str) – Name to save the preprocessed file; default is train_star_selection

  • save_extension (str) – Extension of the saved file, default is .fits

  • verbose (bool) – Verbose mode; default is True

  • print_fun (callable, optional) – Output message function

Returns

An instance of MccdInputs class used for the input preprocessing

Return type

mccd.mccd_utils.MccdInputs

mccd_fit_pipeline(trainstar_path, file_number_string, mccd_parser, output_dir, verbose, saving_name='fitted_model', w_log=None)[source]

Fit MCCD Model.

Fit the MCCD model to the Observations.

Parameters
  • trainstar_path (str) – Path to training stars

  • file_number_string (str) – File number string

  • mccd_parser (mccd.auxiliary_fun.MCCDParamsParser) – MCCD parser

  • output_dir (str) – Output directory

  • verbose (bool) – MCCD verbose option

  • saving_name (str) – Name for output file

  • w_log (logging.Logger) – Logging instance

mccd_validation_pipeline(teststar_path, mccd_model_path, mccd_parser, output_dir, file_number_string, w_log, val_saving_name)[source]

Validate MCCD Pipeline.

Validate the MCCD trained model against a set of observations.

Parameters
  • teststar_path (str) – Path to test stars

  • mccd_model_path (str) – Path to MCCD model

  • mccd_parser (mccd.auxiliary_fun.MCCDParamsParser) – MCCD parser

  • output_dir (str) – Output directory

  • file_number_string (str) – File number string

  • w_log (logging.Logger) – Logging instance

  • val_saving_name (str) – Name for validation file

mccd_interpolation_pipeline(mccd_model_path, galcat_path, pos_params, ccd_id, saving_path, get_shapes)[source]

Interpolate the MCCD Model.

Parameters
  • mccd_model_path (str) – Path to MCCD model

  • galcat_path (str) – Path to galaxy catalogue

  • pos_params (numpy.ndarray) – Position parameters

  • ccd_id (int) – CCD identifier

  • saving_path (str) – Path to save output

  • get_shapes (bool) – Option to save PSF shapes

Returns

String returned if not enough stars found

Return type

str or None

shapepipe_write_output(saving_path, example_fits_path, get_shapes, interp_PSFs, PSF_shapes=None)[source]

Write ShapePipe Output.

Save interpolated PSFs dictionary to FITS file. The saved files are compatible with the previous ShapePipe’s standard.

Parameters
  • saving_path (str) – Path to save output

  • example_fits_path (str) – Path to example FITS file

  • get_shapes (bool) – Option to save PSF shapes

  • interp_PSFs (numpy.ndarray) – PSF interpolation

  • PSF_shapes (numpy.ndarray) – PSF shapes