flint.selfcal.utils =================== .. py:module:: flint.selfcal.utils .. autoapi-nested-parse:: Gemeral help functions that could be used for self-calibration across different packages. Functions --------- .. autoapisummary:: flint.selfcal.utils.consider_skip_selfcal_on_round flint.selfcal.utils.create_and_check_caltable_path flint.selfcal.utils.get_channel_ranges_given_nspws flint.selfcal.utils.get_channel_ranges_given_nspws_for_ms Module Contents --------------- .. py:function:: consider_skip_selfcal_on_round(current_round: int, skip_selfcal_on_rounds: int | list[int] | None) -> bool Consider whether the self-calibration process (derive and applying solutions) should be skipped on a particular imaging round. Should `current_round` be in `skip_selfcal_on_round` then the self-calibration should be skipped and a `True` is returned. :param current_round: The current imaging round being considered :type current_round: int :param skip_selfcal_on_rounds: The set of rounds that should be considerede for skipping. If None a False is returned. :type skip_selfcal_on_rounds: Union[int, List[int], None] :returns: Whether the round is skipped (True) or performed (False) :rtype: bool .. py:function:: create_and_check_caltable_path(ms: flint.options.MS, channel_range: tuple[int, int] | None = None, remove_if_exists: bool = False) -> pathlib.Path Create the output name path for the gaincal solutions table. If the table already exists it will be removed. :param cal_ms: A description of the measurement set :type cal_ms: MS :param channel_range: Channel start and end, which will be appended. Defaults to None. :type channel_range: tuple[int,int] | None, optional :param remove_if_exists: If ``True`` and the table exists, remove it. Defaults to False. :type remove_if_exists: bool, optional :returns: Output path of the solutions table :rtype: Path .. py:function:: get_channel_ranges_given_nspws(num_channels: int, nspws: int) -> tuple[tuple[int, int], Ellipsis] Given the number of channels construct the start and end channel indices for the specified number of spectral windows. The interval step size will be ceiled should the the ``num_channels / nspw`` not be whole. In this case the last interval will be smaller than the others. :param num_channels: The number of channels spanning some band :type num_channels: int :param nspws: The number of segments across the band :type nspws: int :returns: The start and end channel index spanning the number of channels. :rtype: tuple[tuple[int,int]] .. py:function:: get_channel_ranges_given_nspws_for_ms(ms: flint.options.MS | pathlib.Path, nspw: int) -> tuple[tuple[int, int], Ellipsis] Construct channel range intervals for the channels in a measurement set given a desired number of spectral windows :param ms: The measurement set to construct channel ranges for :type ms: MS | Path :param nspw: Number of channel intervals to construct :type nspw: int :returns: The collection of start and end channel intervals. The length will be ``nspw`` :rtype: tuple[tuple[int,int], ...]