flint.summary ============= .. py:module:: flint.summary .. autoapi-nested-parse:: Summary containers intended to hold general information obtained throughout a processing run. Classes ------- .. autoapisummary:: flint.summary.BeamSummary flint.summary.FieldSummary Functions --------- .. autoapisummary:: flint.summary._get_pol_axis_as_rad flint.summary.add_linmos_fits_image flint.summary.add_ms_summaries flint.summary.add_rms_information flint.summary.create_beam_summary flint.summary.create_field_summary flint.summary.update_field_summary Module Contents --------------- .. py:class:: BeamSummary Bases: :py:obj:`NamedTuple` Structure intended to collect components from a measurement set as it is being processed through a continuum imaging pipeline .. py:method:: with_options(**kwargs) -> BeamSummary .. py:attribute:: components :type: flint.source_finding.aegean.AegeanOutputs | None :value: None The source finding components from the aegean source finder .. py:attribute:: image_set :type: flint.imager.wsclean.ImageSet | None :value: None A set of images that have been created from the measurement set represented by `summary` .. py:attribute:: ms_summary :type: flint.ms.MSSummary A summary object of a measurement set .. py:class:: FieldSummary Bases: :py:obj:`NamedTuple` The main information about a processed field. This structure is intended to store critical components that might be accumulated throughout processing of a pipeline, and may be most useful when data-products are zipped (or removed) throughout. Its intended usage is to hold key components that might be used in stages like validation plotting. It is not intended to become a catch-all to replace passing through items into functions directly. There are known issues around serialising astropy units within a dask/prefect environment, for example: https://github.com/astropy/astropy/issues/11317, This could become important if an instance of this object is exchanged between many prefect or dask like delayed tasks. Ye be warned. .. py:method:: with_options(**kwargs) -> FieldSummary .. py:attribute:: beam_summaries :type: list[BeamSummary] | None :value: None Summary information from each beam. Contains MSSummary, ImageSet and other information. .. py:attribute:: cal_sbid :type: str SBID of the bandpass calibrator .. py:attribute:: centre :type: astropy.coordinates.SkyCoord | None :value: None Centre of the field, which is calculated as the mean position of all phase directions of the `mss` measurement sets .. py:attribute:: elevations :type: astropy.coordinates.Latitude | None :value: None Computed elevations of the field .. py:attribute:: field_name :type: str The name of the field .. py:attribute:: holography_path :type: pathlib.Path | None :value: None Path to the file used for holography .. py:attribute:: hour_angles :type: astropy.coordinates.Longitude | None :value: None Computed hour-angles of the field .. py:attribute:: integration_time :type: int | None :value: None The integration time of the observation (seconds) .. py:attribute:: linmos_image :type: pathlib.Path | None :value: None The path to the linmos image of all beams .. py:attribute:: location :type: astropy.coordinates.EarthLocation | None :value: None The location of the telescope stored as (X,Y,Z) in meters .. py:attribute:: median_rms :type: float | None :value: None The meanian RMS computed from an RMS image .. py:attribute:: ms_summaries :type: tuple[flint.ms.MSSummary, Ellipsis] | None :value: None Summaries of measurement sets used in the processing of the filed .. py:attribute:: ms_times :type: astropy.time.Time | None :value: None The unique scan times of integrations stored in the measurement set .. py:attribute:: no_components :type: int | None :value: None Number of components found from the source finder .. py:attribute:: pol_axis :type: float | None :value: None The orientation of the ASKAP third-axis in radians. .. py:attribute:: round :type: int | None :value: None The self-cal round .. py:attribute:: sbid :type: str SBID of processed field .. py:function:: _get_pol_axis_as_rad(ms: flint.ms.MS | pathlib.Path) -> float Helper to get the appropriate pol_axis out of a MS. Prioritises the instrumental third-axis imprinted from fixms .. py:function:: add_linmos_fits_image(field_summary: FieldSummary, linmos_command: flint.coadd.linmos.LinmosResult) -> FieldSummary Extract the path of the linmos fits image from the LinmosResult the co-added the field :param field_summary: Existing field summary to update :type field_summary: FieldSummary :param linmos_command: Instance of a completed linmos command that coadded a field :type linmos_command: LinmosResult :returns: The updated field summary object with the linmos fits image added :rtype: FieldSummary .. py:function:: add_ms_summaries(field_summary: FieldSummary, mss: list[flint.ms.MS]) -> FieldSummary Obtain a MSSummary instance to add to a FieldSummary Quantities derived from the field centre (hour angles, elevations) are also calculated. The field centre position is estimated by taking the mean position of all phase directions. See `flint.utils.estimate_skycoord_centre` :param field_summary: Existing field summary object to update :type field_summary: FieldSummary :param mss: Set of measurement sets to describe :type mss: List[MS] :returns: Results from the inspected set of measurement sets :rtype: Tuple[MSSummary] .. py:function:: add_rms_information(field_summary: FieldSummary, aegean_outputs: flint.source_finding.aegean.AegeanOutputs) -> FieldSummary Add information derived from an RMS image and component catalogue to an existing `FieldSummary` instance. Some properteries, such as the center position, number of components etc, are taken directly from source finder products. On the center position -- there is not (at the moment) a simple way of getting the center position of a field. So the image itself is used to grab it. Other properties that require components of a measurement set, including the time and position, are also derived using existing fields which are created when a new instance is made. :param field_summary: Existing field summary object to update :type field_summary: FieldSummary :param aegean_outputs: Products of a source finding run :type aegean_outputs: AegeanOutputs :returns: Updated field summary object :rtype: FieldSummary .. py:function:: create_beam_summary(ms: flint.ms.MS | pathlib.Path, image_set: flint.imager.wsclean.ImageSet | flint.imager.wsclean.WSCleanResult | None = None, components: flint.source_finding.aegean.AegeanOutputs | None = None) -> BeamSummary Create a summary of a beam :param ms: The measurement set being considered :type ms: Union[MS, Path] :param image_set: Images produced from an imager. Defaults to None. :type image_set: Optional[ImageSet], optional :param components: Source finding output components. Defaults to None. :type components: Optional[AegeanOutputs], optional :returns: Summary object of a beam :rtype: BeamSummary .. py:function:: create_field_summary(mss: list[flint.ms.MS | pathlib.Path], cal_sbid_path: pathlib.Path | None = None, holography_path: pathlib.Path | None = None, aegean_outputs: flint.source_finding.aegean.AegeanOutputs | None = None, **kwargs) -> FieldSummary Create a field summary object using a measurement set. All other keyword arguments are passed directly through to `FieldSummary` :param ms: Measurement set information will be pulled from :type ms: Union[MS, Path] :param cal_sbid_path: Path to an example of a bandpass measurement set. Defaults to None. :type cal_sbid_path: Optional[Path], optional :param holography_path: The holography fits cube used (or will be) to linmos. Defaults to None. :type holography_path: Optional[Path], optional :param aegean_outputs: Should RMS / source information be added to the instance. Defaults to None. :type aegean_outputs: Optional[AegeanOutputs], optional :param mss: Set of measurement sets to describe :type mss: Optional[Collection[MS]], optionals :returns: A summary of a field :rtype: FieldSummary .. py:function:: update_field_summary(field_summary: FieldSummary, aegean_outputs: flint.source_finding.aegean.AegeanOutputs | None = None, mss: list[flint.ms.MS] | None = None, linmos_command: flint.coadd.linmos.LinmosResult | None = None, **kwargs) -> FieldSummary Update an existing `FieldSummary` instance with additional information. If special steps are required to be carried out based on a known input they will be. Otherwise all additional keyword arguments are passed through to the `FieldSummary.with_options`. :param field_summary: Field summary object to update :type field_summary: FieldSummary :param aegean_outputs: Will add RMS and aegean related properties. Defaults to None. :type aegean_outputs: Optional[AegeanOutputs], optional :param mss: Set of measurement sets to describe :type mss: Optional[Collection[MS]], optionals :param linmos_command: The linmos command created when co-adding all beam images together :type linmos_command: Optional[LinmosResult], optional :returns: An updated field summary objects :rtype: FieldSummary