flint.prefect.flows.subtract_cube_pipeline ========================================== .. py:module:: flint.prefect.flows.subtract_cube_pipeline .. autoapi-nested-parse:: This is a workflow to subtract a continuum model and image the channel-wise data Unlike the continuum imaging and self-calibnration pipeline this flow currently expects that all measurement sets are in the flint format, which means other than the naming scheme that they have been been preprocessed to place them in the IAU frame and have had their fields table updated. That is to say that they have already been preprocessed and fixed. Functions --------- .. autoapisummary:: flint.prefect.flows.subtract_cube_pipeline._check_and_verify_options flint.prefect.flows.subtract_cube_pipeline.cli flint.prefect.flows.subtract_cube_pipeline.find_and_setup_mss flint.prefect.flows.subtract_cube_pipeline.find_mss_to_image flint.prefect.flows.subtract_cube_pipeline.flow_addmodel_to_mss flint.prefect.flows.subtract_cube_pipeline.flow_subtract_cube flint.prefect.flows.subtract_cube_pipeline.get_parser flint.prefect.flows.subtract_cube_pipeline.setup_run_subtract_flow flint.prefect.flows.subtract_cube_pipeline.task_combine_all_linmos_images flint.prefect.flows.subtract_cube_pipeline.task_map_all_wsclean Module Contents --------------- .. py:function:: _check_and_verify_options(subtract_field_options: flint.options.SubtractFieldOptions | None = None, addmodel_subtract_field_options: flint.options.AddModelSubtractFieldOptions | None = None, crystalball_subtract_field_options: flint.predict.crystalball.CrystalBallOptions | None = None) -> None Verify that the options supplied to run the subtract field options make sense .. py:function:: cli() -> None .. py:function:: find_and_setup_mss(science_path_or_mss: pathlib.Path | tuple[flint.ms.MS, Ellipsis], expected_ms_count: int, data_column: str) -> tuple[flint.ms.MS, Ellipsis] Search for MSs in a directory and, if necessary, perform checks around their consistency. If the input data appear to be collection of MSs already assume they have already been set and checked for consistency. :param science_path_or_mss: Path to search or existing MSs :type science_path_or_mss: Union[Path, List[MS, ...]] :param expected_ms_count: Expected number of MSs to find :type expected_ms_count: int :param data_column: The data column to nominate if creating MSs after searching :type data_column: str :raises FrequencyMismatchError: Raised when frequency information is not consistent :returns: Collection of MSs :rtype: Tuple[MS, ...] .. py:function:: find_mss_to_image(mss_parent_path: pathlib.Path, expected_ms_count: int | None = None, data_column: str = 'CORRECTED_DATA', model_column: str = 'MODEL_DATA') -> tuple[flint.ms.MS, Ellipsis] Search for MSs to image. See ``flint.ms.find_mss`` for further details. :param mss_parent_path: Path to search for MSs in :type mss_parent_path: Path :param expected_ms_count: Expected number of measurement sets to find. Defaults to None. :type expected_ms_count: Optional[int], optional :param data_column: The nominated data column that should eb set. Defaults to "CORRECTED_DATA". :type data_column: str, optional :param model_column: The nominated model data column that should be set. Defaults to "MODEL_DATA". :type model_column: str, optional :returns: Collect of MSs :rtype: Tuple[MS, ...] .. py:function:: flow_addmodel_to_mss(science_path_or_mss: pathlib.Path | tuple[flint.ms.MS, Ellipsis], addmodel_subtract_field_options: flint.options.AddModelSubtractFieldOptions, expected_ms: int, data_column: str) -> tuple[flint.ms.MS, Ellipsis] Separate flow to perform the potentially expensive model prediction into MSs .. py:function:: flow_subtract_cube(science_path: pathlib.Path, subtract_field_options: flint.options.SubtractFieldOptions, addmodel_subtract_field_options: flint.options.AddModelSubtractFieldOptions, crystalball_subtract_field_options: flint.predict.crystalball.CrystalBallOptions) -> None .. py:function:: get_parser() -> configargparse.ArgumentParser .. py:function:: setup_run_subtract_flow(science_path: pathlib.Path, subtract_field_options: flint.options.SubtractFieldOptions, addmodel_subtract_field_options: flint.options.AddModelSubtractFieldOptions, crystalball_subtract_field_options: flint.predict.crystalball.CrystalBallOptions, cluster_config: pathlib.Path) -> None .. py:function:: task_combine_all_linmos_images(linmos_commands: list[flint.coadd.linmos.LinmosResult], remove_original_images: bool = False, combine_weights: bool = False, time_domain: bool = False, update_fits_cube_options: dict[str, Any] | None = None) -> pathlib.Path Use the fits-cube package to take all input images and create a single output cube. :param linmos_commands: The output linmos commands to concatenated into a single cube. :type linmos_commands: list[LinmosResult] :param remove_original_images: Remove the original images after the cube has been formed. Defaults to False. :type remove_original_images: bool, optional :param combine_weights: Whether to concatenated the images or the weights that are described by the input `linmos_commands`. Defaults to False. :type combine_weights: bool, optional :param time_domain: Whether images are to be formed on the spectral or time axis. Defaults to False. :type time_domain: bool, optional :param bounding_box: Whether to trim the output cube to include only valid pixels (see fitscube docs). Defaults to False. :type bounding_box: bool, optional :param invalidate_zeros: Where to mark pixels that are exactly zero as invalid (replace with a NaN). Defaults to False. :type invalidate_zeros: bool, optional :returns: The output cube path :rtype: Path .. py:function:: task_map_all_wsclean(in_mss: list[flint.ms.MS], *args, **kwargs) -> list[flint.imager.wsclean.WSCleanResult] A single task that internally runs the wsclean imager task while iterates over the input list of measurement sets when run. It performs the same operation as the prefect task enabled `map` operator, but unlike the `.map` method all outputs are tracked in a single prefect task. This is used to lower the load on the prefect server. :param in_mss: List of measurement sets to image :type in_mss: list[MS] :returns: The list of output wsclean results :rtype: list[WSCleanResult]