morphfits.wrappers.galfit ========================= .. py:module:: morphfits.wrappers.galfit .. autoapi-nested-parse:: Main program execution for the GALFIT morphology fitter wrapper package. Attributes ---------- .. autoapisummary:: morphfits.wrappers.galfit.logger morphfits.wrappers.galfit.FLAGS morphfits.wrappers.galfit.FAIL morphfits.wrappers.galfit.GALFIT_LOG_REGEX morphfits.wrappers.galfit.GALFIT_LOG_FLOAT_REGEX Functions --------- .. autoapisummary:: morphfits.wrappers.galfit.generate_feedfiles morphfits.wrappers.galfit.run_galfit morphfits.wrappers.galfit.record_parameters morphfits.wrappers.galfit.main Module Contents --------------- .. py:data:: logger Logging object for this module. .. py:data:: FLAGS GALFIT flags as written in the model headers, and their corresponding bit-mask exponent, where 2 is the base. .. py:data:: FAIL :value: 495 GALFIT flags which indicate a failed run. .. seealso:: :obj:`README.md` Breakdown on binary flag values, and which flags result in failed runs. .. py:data:: GALFIT_LOG_REGEX :value: '[\\*|\\[]?\\d{1,10}[\\.]\\d{1,2}[\\*|\\[]?' .. py:data:: GALFIT_LOG_FLOAT_REGEX :value: '\\d{1,10}[\\.]\\d{1,2}' Regex for seven .2f numbers found in GALFIT logs, which may or may not be enveloped by * or [] characters. .. seealso:: :obj:`None` Function using this expression to record the fitting parameters from logs. .. py:function:: generate_feedfiles(input_root: pathlib.Path, product_root: pathlib.Path, output_root: pathlib.Path, field: str, image_version: str, catalog_version: str, filter: str, objects: list[int], image_sizes: list[int], pixscale: tuple[float, float], regenerate: bool = False, feedfile_template_path: pathlib.Path = GALFIT_DATA_ROOT / 'feedfile.jinja', constraints_path: pathlib.Path = GALFIT_DATA_ROOT / 'default.constraints', path_length: int = 64, float_length: int = 12, display_progress: bool = False) Generate feedfiles for all objects in a FICL. :param input_root: Path to root MorphFITS input directory. :type input_root: Path :param product_root: Path to root MorphFITS products directory. :type product_root: Path :param output_root: Path to root MorphFITS output directory. :type output_root: Path :param field: Field of observation. :type field: str :param image_version: Version of image processing used on observation. :type image_version: str :param catalog_version: Version of cataloguing used for field. :type catalog_version: str :param filter: Filter used for observation. :type filter: str :param objects: List of object IDs in catalog for which to generate feedfiles. :type objects: list[str] :param image_sizes: List of image sizes corresponding to each object's stamp. :type image_sizes: list[int] :param pixscale: Pixel scale along x and y axes, in arcseconds per pixel. :type pixscale: tuple[float, float] :param regenerate: Regenerate existing feedfiles, by default False. :type regenerate: bool, optional :param feedfile_template_path: Path to jinja2 feedfile template, by default from the repository data directory. :type feedfile_template_path: Path, optional :param constraints_path: Path to the GALFIT constraints file, by default from the repository data directory. :type constraints_path: Path, optional :param path_length: Length of path strings in the template for comment alignment, by default 64, so that comments start at column 69. :type path_length: int, optional :param float_length: Length of float strings in the template for comment alignment, by default 12. :type float_length: int, optional :param display_progress: Display progress on terminal screen, by default False. :type display_progress: bool, optional .. py:function:: run_galfit(galfit_path: pathlib.Path, input_root: pathlib.Path, product_root: pathlib.Path, output_root: pathlib.Path, field: str, image_version: str, catalog_version: str, filter: str, objects: list[int], display_progress: bool = False) -> list[str] Run GALFIT over all objects in a FICL. :param galfit_path: Path to GALFIT binary file. :type galfit_path: Path :param input_root: Path to root MorphFITS input directory. :type input_root: Path :param product_root: Path to root MorphFITS products directory. :type product_root: Path :param output_root: Path to root MorphFITS output directory. :type output_root: Path :param field: Field of observation. :type field: str :param image_version: Version of image processing used on observation. :type image_version: str :param catalog_version: Version of cataloguing used for field. :type catalog_version: str :param filter: Filter used for observation. :type filter: str :param objects: List of object IDs in catalog for which to generate feedfiles. :type objects: list[str] :param display_progress: Display progress on terminal screen, by default False. :type display_progress: bool, optional :returns: List of GALFIT return codes for each FICLO. :rtype: list[int] .. py:function:: record_parameters(return_codes: list[int], datetime: datetime.datetime, run_number: int, output_root: pathlib.Path, run_root: pathlib.Path, field: str, image_version: str, catalog_version: str, filter: str, objects: list[int], display_progress: bool = False) Record GALFIT fitting parameters to the corresponding run directory. :param return_codes: List of GALFIT return codes for each FICLO. :type return_codes: list[int] :param datetime: Datetime of start of run. :type datetime: datetime :param run_number: Number of run in runs directory when other runs have the same datetime. :type run_number: int :param output_root: Path to root MorphFITS output directory. :type output_root: Path :param run_root: Path to root runs directory. :type run_root: Path :param field: Field of observation. :type field: str :param image_version: Version of image processing used on observation. :type image_version: str :param catalog_version: Version of cataloguing used for field. :type catalog_version: str :param filter: Filter used for observation. :type filter: str :param objects: List of object IDs in catalog for which to generate feedfiles. :type objects: list[str] :param display_progress: Display progress on terminal screen, by default False. :type display_progress: bool, optional :param for_run: :type for_run: bool, optional .. py:function:: main(morphfits_config: morphfits.config.MorphFITSConfig, regenerate_products: bool = False, regenerate_stamps: bool = False, regenerate_psfs: bool = False, regenerate_masks: bool = False, regenerate_sigmas: bool = False, keep_feedfiles: bool = False, skip_products: bool = False, skip_fits: bool = False, make_plots: bool = False, display_progress: bool = False) Orchestrate GalWrap functions for passed configurations. :param morphfits_config: Configuration object for this program run. :type morphfits_config: MorphFITSConfig :param regenerate_products: Regenerate all products, by default False. :type regenerate_products: bool, optional :param regenerate_stamps: Regenerate stamps, by default False. :type regenerate_stamps: bool, optional :param regenerate_masks: Regenerate masks, by default False. :type regenerate_masks: bool, optional :param regenerate_psfs: Regenerate psfs, by default False. :type regenerate_psfs: bool, optional :param regenerate_sigmas: Regenerate sigmas, by default False. :type regenerate_sigmas: bool, optional :param keep_feedfiles: Reuse existing feedfiles, by default False. :type keep_feedfiles: bool, optional :param skip_products: Skip all product generation, by default False. :type skip_products: bool, optional :param skip_fits: Skip all morphology fitting via GALFIT, by default False. :type skip_fits: bool, optional :param make_plots: Generate model plots, by default False. :type make_plots: bool, optional :param display_progress: Display progress as loading bar and suppress logging, by default False. :type display_progress: bool, optional