flint.prefect.flows.bandpass_pipeline ===================================== .. py:module:: flint.prefect.flows.bandpass_pipeline .. autoapi-nested-parse:: Pipeline to calibrate a ASKAP style bandpass observation. At the moment this is expected to be performed against observations taken towards PKS1934-638. At the time of writing a typical ASKAP bandpass observation will cycle each beam so that it is centred on this source. This means that practically there are 36 separate fields at slightly different field centres. The bandpass calibration process will first have to split the correct field out before actually calibration. Attributes ---------- .. autoapisummary:: flint.prefect.flows.bandpass_pipeline.task_create_apply_solutions_cmd flint.prefect.flows.bandpass_pipeline.task_create_calibrate_cmd flint.prefect.flows.bandpass_pipeline.task_extract_correct_bandpass_pointing flint.prefect.flows.bandpass_pipeline.task_flag_ms_aoflagger flint.prefect.flows.bandpass_pipeline.task_preprocess_askap_ms flint.prefect.flows.bandpass_pipeline.task_select_solution_for_ms flint.prefect.flows.bandpass_pipeline.task_split_by_field Functions --------- .. autoapisummary:: flint.prefect.flows.bandpass_pipeline.calibrate_bandpass_flow flint.prefect.flows.bandpass_pipeline.cli flint.prefect.flows.bandpass_pipeline.get_parser flint.prefect.flows.bandpass_pipeline.run_bandpass_stage flint.prefect.flows.bandpass_pipeline.setup_run_bandpass_flow flint.prefect.flows.bandpass_pipeline.task_bandpass_create_apply_solutions_cmd flint.prefect.flows.bandpass_pipeline.task_flag_solutions Module Contents --------------- .. py:function:: calibrate_bandpass_flow(bandpass_path: pathlib.Path, split_path: pathlib.Path, bandpass_options: flint.options.BandpassOptions) -> pathlib.Path Create and run the prefect flow to calibrate a set of bandpass measurement sets. The measurement sets that will be calibreated are expected to: - be following the raw name format convention - reside in a directory whose name is the SBID of the observation The current bandpass procedure currently relies on the Andre Offringa's ``calibrate`` tool, with slight modification from Emil Lenc. The well known source PKS1934-638 is the only source supported for bandpass calibration, and its model is packaged inside ``flint``. This model is in the AO-style format. Each measurement set will correspond to a solutions file once the ``calibrate`` tool has been executed successfully. These should be kept together -- there is not enough meta-data in the single solutions file to denote the frequency / channels / beam number described in the measurement set. :param bandpass_path: Location to the folder containing the raw ASKAP bandpass measurement sets that will be calibrated :type bandpass_path: Path :param split_path: Location that will contain a folder, named after the SBID of the observation, that will contain the output bandpass measurement sets, solutions and plots :type split_path: Path :param bandpass_options: Options that specify configurables of the bandpass processing. :type bandpass_options: BandpassOptions :returns: Directory that contains the extracted measurement sets and the ao-style gain solutions files. :rtype: Path .. py:function:: cli() -> None .. py:function:: get_parser() -> argparse.ArgumentParser Create an argument parser for the bandpass prefect workflow :returns: CLI argument parser :rtype: ArgumentParser .. py:function:: run_bandpass_stage(bandpass_mss: Collection[flint.options.MS], output_split_bandpass_path: pathlib.Path, bandpass_options: flint.options.BandpassOptions, model_path: pathlib.Path, source_name_prefix: str = 'B1934-638', skip_rotation: bool = False) -> list[flint.calibrate.aocalibrate.CalibrateCommand] Executes the bandpass calibration (using ``calibrate``) against a set of input measurement sets. :param bandpass_mss: Set of bandpass measurement sets to calibrate :type bandpass_mss: Collection[MS] :param output_split_bandpass_path: The location where the extract field centred on the calibration field (typically PKSB19340638) :type output_split_bandpass_path: Path :param bandpass_options: Configurables that will specify the bandpass calibbration process :type bandpass_options: BandpassOptions :param model_path: Path to the model used to calibrate against :type model_path: Path :param source_name_prefix: Name of the field being calibrated. Defaults to "B1934-638". :type source_name_prefix: str, optional :param skip_rotation: If ``True`` the rotation of the ASKAP visibility from the antenna frame to the sky-frame will be skipped. Defaults to False. :type skip_rotation: bool, optional :returns: Set of calibration commands used :rtype: List[CalibrateCommand] .. py:function:: setup_run_bandpass_flow(bandpass_path: pathlib.Path, split_path: pathlib.Path, cluster_config: pathlib.Path, bandpass_options: flint.options.BandpassOptions) -> pathlib.Path Create and run the prefect flow to calibrate a set of bandpass measurement sets. The measurement sets that will be calibreated are expected to: - be following the raw name format convention - reside in a directory whose name is the SBID of the observation The current bandpass procedure currently relies on the Andre Offringa's ``calibrate`` tool, with slight modification from Emil Lenc. The well known source PKS1934-638 is the only source supported for bandpass calibration, and its model is packaged inside ``flint``. This model is in the AO-style format. Each measurement set will correspond to a solutions file once the ``calibrate`` tool has been executed successfully. These should be kept together -- there is not enough meta-data in the single solutions file to denote the frequency / channels / beam number described in the measurement set. :param bandpass_path: Location to the folder containing the raw ASKAP bandpass measurement sets that will be calibrated :type bandpass_path: Path :param split_path: Location that will contain a folder, named after the SBID of the observation, that will contain the output bandpass measurement sets, solutions and plots :type split_path: Path :param cluster_config: Path to a yaml file that is used to configure a prefect dask task runner. :type cluster_config: Path :param bandpass_options: Options that specify configurables of the bandpass processing. :type bandpass_options: BandpassOptions :returns: Directory that contains the extracted measurement sets and the ao-style gain solutions files. :rtype: Path .. py:function:: task_bandpass_create_apply_solutions_cmd(ms: flint.options.MS, calibrate_cmd: flint.calibrate.aocalibrate.CalibrateCommand, container: pathlib.Path, output_column: str | None = None) -> flint.calibrate.aocalibrate.ApplySolutions Apply an ao-calibrate style solutions file to an input measurement set. Internally the solutions path to apply to the nominaled measurement set is extracted from the incoming ``calibrate_cmd``. :param ms: The measurement set that will have solutions applied :type ms: MS :param calibrate_cmd: The calibrate command and meta-data describing the solutions to apply :type calibrate_cmd: CalibrateCommand :param container: Path to singularity container that will apply the solutions :type container: Path :param output_column: the output column name to create. Defaults to None. :type output_column: Optional[Path], optional :returns: The apply solutions command and meta-data :rtype: ApplySolutions .. py:function:: task_flag_solutions(calibrate_cmd: flint.calibrate.aocalibrate.CalibrateCommand, **kwargs) -> flint.calibrate.aocalibrate.CalibrateCommand Flag calibration solutions :param calibrate_cmd: Calibrate command that contains path to the solution file that will be flagged :type calibrate_cmd: CalibrateCommand :returns: Calibrate command with update meta-data describing the new solutions file :rtype: CalibrateCommand .. py:data:: task_create_apply_solutions_cmd :value: None .. py:data:: task_create_calibrate_cmd :value: None .. py:data:: task_extract_correct_bandpass_pointing :value: None .. py:data:: task_flag_ms_aoflagger :value: None .. py:data:: task_preprocess_askap_ms :value: None .. py:data:: task_select_solution_for_ms :value: None .. py:data:: task_split_by_field :value: None