sourcefinder.accessors.casaimage ================================ .. py:module:: sourcefinder.accessors.casaimage Attributes ---------- .. autoapisummary:: sourcefinder.accessors.casaimage.logger Classes ------- .. autoapisummary:: sourcefinder.accessors.casaimage.CasaImage Module Contents --------------- .. py:class:: CasaImage(url, plane=0, beam=None) Bases: :py:obj:`sourcefinder.accessors.dataaccessor.DataAccessor` Provides common functionality for pulling data from the CASA image format. (Technically known as the 'MeasurementSet' format.) :Parameters: **url** : str The location of the CASA image file. **plane** : int, default: 0 The data plane to extract from the image cube. **beam** : tuple, default: None Beam parameters (major axis, minor axis, position angle) in degrees. If not provided, these are extracted from the CASA table. .. rubric:: Notes CasaImage does not provide tau_time or taustart_ts, as there was no clear standard for these metadata, so cannot be instantiated directly - subclass it and extract these attributes as appropriate to a given telescope. .. !! processed by numpydoc !! .. py:method:: parse_beam(table) Extract beam parameters from the CASA table. :Parameters: **table** : casacore.tables.table The CASA table from which the beam parameters are extracted. :Returns: **bmaj** : float The semi-major axis of the beam in degrees. **bmin** : float The semi-minor axis of the beam in degrees. **bpa** : float The angle of the major axis of the synthesized beam, measured east from local north, in degrees. .. !! processed by numpydoc !! .. py:method:: parse_coordinates(table) Parse and return a WCS (World Coordinate System) object from the CASA table. :Parameters: **table** : casacore.tables.table The CASA table from which the WCS information is extracted. :Returns: **wcs** : WCS A WCS object containing the coordinate system information extracted from the CASA table. .. !! processed by numpydoc !! .. py:method:: parse_data(table, plane=0) Extract and squeeze data from a CASA table, select desired plane and transpose. Squeezing is done to remove any singleton dimensions. :Parameters: **table** : casacore.tables.table The CASA table from which data is extracted. **plane** : int, default: 0 The data plane to extract from the image cube. :Returns: **data** : numpy.ndarray The extracted and transposed data array. If the data cube has more than two dimensions - after removing singleton dimensions - the plane specified by the `plane` parameter is selected from the first axis. .. !! processed by numpydoc !! .. py:method:: parse_frequency(table) Extract frequency-related information from the CASA table headers. :Parameters: **table** : casacore.tables.table The CASA table from which frequency information is extracted. :Returns: **freq_eff** : float The effective frequency (rest frequency) in Hz. **freq_bw** : float The frequency bandwidth (channel width) in Hz. .. !! processed by numpydoc !! .. py:method:: parse_phase_centre(table) :staticmethod: Assume the units for the pointing centre are in radians and return the RA modulo 360. :Parameters: **table** : casacore.tables.table The CASA table from which the pointing centre is extracted. .. rubric:: Notes The units for the pointing centre are not given in either the image cube itself nor in the image content description. Assume radians. The Right Ascension (RA) is returned modulo 360 to ensure it is always within the range 0 <= RA < 360. .. !! processed by numpydoc !! .. py:method:: parse_taustartts(table) :staticmethod: Extract integration start-time from CASA table header. This applies to some CASA images (typically those created from uvFITS files) but not all, and so should be called for each sub-class. :Parameters: **table** : casacore.tables.table The MAIN table of the CASA image. :Returns: datetime.datetime Time of observation start as an instance of `datetime.datetime`. .. !! processed by numpydoc !! .. py:method:: unique_column_values(table, column_name) :staticmethod: Find all the unique values in a particular column of a CASA table. :Parameters: **table** : casacore.tables.table The CASA table from which the column values are extracted. **column_name** : str The name of the column to extract unique values from. :Returns: numpy.ndarray An array containing the unique values in the specified column. .. !! processed by numpydoc !! .. py:attribute:: data .. py:attribute:: pixelsize .. py:attribute:: url .. py:attribute:: wcs .. py:data:: logger