flint.bandpass ============== .. py:module:: flint.bandpass .. autoapi-nested-parse:: Procedure to calibrate bandpass observation Functions --------- .. autoapisummary:: flint.bandpass.calibrate_bandpass flint.bandpass.cli flint.bandpass.extract_correct_bandpass_pointing flint.bandpass.flag_bandpass_offset_pointings flint.bandpass.get_parser flint.bandpass.plot_solutions Module Contents --------------- .. py:function:: calibrate_bandpass(ms_path: pathlib.Path, data_column: str, mode: str, calibrate_container: pathlib.Path, plot: bool = True, aoflagger_container: pathlib.Path | None = None, ms_out_dir: pathlib.Path | None = None) -> flint.options.MS Entry point to extract the appropriate field from a bandpass observation, run AO-style calibrate, and plot results. In its current form a new measurement set will be created container just the appropriate field to calibrate. :param ms_path: Path the the measurement set containing bandpass observations of B1934-638 :type ms_path: Path :param data_column: The column that will be calibrated. :type data_column: str :param mode: The calibration approach to use. Currently only `calibrate` is supported. :type mode: str :param calibrate_container: The path to the singularity container that holds the appropriate software. :type calibrate_container: Path :param plot: Whether plotting should be performed. Defaults to True. :type plot: bool, optional :param aoflagger_container: The path to the singularity container that holds aoflagger. If this is not `None` that flagging will be performed on the extracted field-specific measurement set. :type aoflagger_container: Path :param ms_out_dir: If not None, place the split field measurement sets into this directory. Defaults to None. :type ms_out_dir: Optional[Path], optional :returns: The calibrated measurement set with nominated column :rtype: MS .. py:function:: cli() -> None .. py:function:: extract_correct_bandpass_pointing(ms: flint.options.MS | pathlib.Path, source_name_prefix: str = 'B1934-638', ms_out_dir: pathlib.Path | None = None) -> flint.options.MS The typical bandpass style observation in ASKAP will shift each beam so that it is centred on the bandpass-calibration object (here B1934-638). During each offset position all beams are recording data still. The trick here is that all 36 fields are still recorded in the measurement set, and are generally of the form: >>> ['B1934-638_beam0', 'B1934-638_beam1', 'B1934-638_beam10', 'B1934-638_beam11', >>> 'B1934-638_beam12', 'B1934-638_beam13', 'B1934-638_beam14', 'B1934-638_beam15', >>> 'B1934-638_beam16', 'B1934-638_beam17', 'B1934-638_beam18', 'B1934-638_beam19', >>> 'B1934-638_beam2', 'B1934-638_beam20', 'B1934-638_beam21', 'B1934-638_beam22', >>> 'B1934-638_beam23', 'B1934-638_beam24', 'B1934-638_beam25', 'B1934-638_beam26', >>> 'B1934-638_beam27', 'B1934-638_beam28', 'B1934-638_beam29', 'B1934-638_beam3', >>> 'B1934-638_beam30', 'B1934-638_beam31', 'B1934-638_beam32', 'B1934-638_beam33', >>> 'B1934-638_beam34', 'B1934-638_beam35', 'B1934-638_beam4', 'B1934-638_beam5', >>> 'B1934-638_beam6', 'B1934-638_beam7', 'B1934-638_beam8', 'B1934-638_beam9'] This function will attempt to deduce the intended field name for the beam in question, and then create a new measurement set with just these data. It internally uses `taql` to create a selection statement: >>> with table(ms_path) as tab: >>> sub_ms = taql("select * from $tab where FIELD_ID==field_idx") >>> sub_ms.copy(out_path, deep=True) Therefore, some properties from other tables (e.g. FIELDS) may still contain references to other fields. :param ms: Path or instance of MS describing the measurement set to flag all other bandpass field. :type ms: Union[MS, Path] :param source_name_prefix: The beginning of the source name stored in the NAME column of the FIELD table. Field names are of the form B1934-638_beam1, where B1934-638 would be the prefix name, and beam is constructed based on the beam among the 36 observing the target source (for example). :type source_name_prefix: str, optional :param ms_out_dir: If not None, place the split field measurement sets into this directory. Defaults to None. :type ms_out_dir: Optional[Path], optional :returns: A description of the new measurement set created with the file name ending .beamN.ms. :rtype: MS .. py:function:: flag_bandpass_offset_pointings(ms: flint.options.MS | pathlib.Path) -> flint.options.MS The typical bandpass style observation in ASKAP will shift each beam so that it is centred on the bandpass-calibration object (here B1934-638). During each offset position all beams are recording data still. The trick here is that all 36 fields are still recorded in the measurement set, and are generally of the form: >>> ['B1934-638_beam0', 'B1934-638_beam1', 'B1934-638_beam10', 'B1934-638_beam11', >>> 'B1934-638_beam12', 'B1934-638_beam13', 'B1934-638_beam14', 'B1934-638_beam15', >>> 'B1934-638_beam16', 'B1934-638_beam17', 'B1934-638_beam18', 'B1934-638_beam19', >>> 'B1934-638_beam2', 'B1934-638_beam20', 'B1934-638_beam21', 'B1934-638_beam22', >>> 'B1934-638_beam23', 'B1934-638_beam24', 'B1934-638_beam25', 'B1934-638_beam26', >>> 'B1934-638_beam27', 'B1934-638_beam28', 'B1934-638_beam29', 'B1934-638_beam3', >>> 'B1934-638_beam30', 'B1934-638_beam31', 'B1934-638_beam32', 'B1934-638_beam33', >>> 'B1934-638_beam34', 'B1934-638_beam35', 'B1934-638_beam4', 'B1934-638_beam5', >>> 'B1934-638_beam6', 'B1934-638_beam7', 'B1934-638_beam8', 'B1934-638_beam9'] This function will attempt to deduce the intended field name for the beam in question, and then flag all other fields. :param ms: Path or instance of MS describing the measurement set to flag all other bandpass field. :type ms: Union[MS, Path] :returns: A description of the ms :rtype: MS .. py:function:: get_parser() -> argparse.ArgumentParser .. py:function:: plot_solutions(solutions_path: pathlib.Path, ref_ant: int | None = 0) -> None Plot solutions for AO-style solutions :param solutions_path: Path to the solutions file :type solutions_path: Path :param ref_ant: Reference antenna to use. If None is specified there is no division by a reference antenna. Defaults to 0. :type ref_ant: Optional[int], optional