sourcefinder.accessors.casaimage#
Attributes#
Classes#
Provides common functionality for pulling data from the CASA image format. |
Module Contents#
- class sourcefinder.accessors.casaimage.CasaImage(url, plane=0, beam=None)[source]#
Bases:
sourcefinder.accessors.dataaccessor.DataAccessorProvides common functionality for pulling data from the CASA image format.
(Technically known as the ‘MeasurementSet’ format.)
- Parameters:
- urlstr
The location of the CASA image file.
- planeint, default: 0
The data plane to extract from the image cube.
- beamtuple, default: None
Beam parameters (major axis, minor axis, position angle) in degrees. If not provided, these are extracted from the CASA table.
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.
- parse_beam(table)[source]#
Extract beam parameters from the CASA table.
- Parameters:
- tablecasacore.tables.table
The CASA table from which the beam parameters are extracted.
- Returns:
- bmajfloat
The semi-major axis of the beam in degrees.
- bminfloat
The semi-minor axis of the beam in degrees.
- bpafloat
The angle of the major axis of the synthesized beam, measured east from local north, in degrees.
- parse_coordinates(table)[source]#
Parse and return a WCS (World Coordinate System) object from the CASA table.
- Parameters:
- tablecasacore.tables.table
The CASA table from which the WCS information is extracted.
- Returns:
- wcsWCS
A WCS object containing the coordinate system information extracted from the CASA table.
- parse_data(table, plane=0)[source]#
Extract and squeeze data from a CASA table, select desired plane and transpose. Squeezing is done to remove any singleton dimensions.
- Parameters:
- tablecasacore.tables.table
The CASA table from which data is extracted.
- planeint, default: 0
The data plane to extract from the image cube.
- Returns:
- datanumpy.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.
- parse_frequency(table)[source]#
Extract frequency-related information from the CASA table headers.
- Parameters:
- tablecasacore.tables.table
The CASA table from which frequency information is extracted.
- Returns:
- freq_efffloat
The effective frequency (rest frequency) in Hz.
- freq_bwfloat
The frequency bandwidth (channel width) in Hz.
- static parse_phase_centre(table)[source]#
Assume the units for the pointing centre are in radians and return the RA modulo 360.
- Parameters:
- tablecasacore.tables.table
The CASA table from which the pointing centre is extracted.
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.
- static parse_taustartts(table)[source]#
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:
- tablecasacore.tables.table
The MAIN table of the CASA image.
- Returns:
- datetime.datetime
Time of observation start as an instance of datetime.datetime.
- static unique_column_values(table, column_name)[source]#
Find all the unique values in a particular column of a CASA table.
- Parameters:
- tablecasacore.tables.table
The CASA table from which the column values are extracted.
- column_namestr
The name of the column to extract unique values from.
- Returns:
- numpy.ndarray
An array containing the unique values in the specified column.