Data Accessor Variants¶
Basic data accessors¶
-
class
tkp.accessors.dataaccessor.
DataAccessor
[source]¶ Base class for accessors used with
tkp.sourcefinder.image.ImageData
.Data accessors provide a uniform way for the ImageData class (ie, generic image representation) to access the various ways in which images may be stored (FITS files, arrays in memory, potentially HDF5, etc).
This class cannot be instantiated directly, but should be subclassed and the abstract properties provided. Note that all abstract properties are required to provide a valid accessor.
Additional properties may also be provided by subclasses. However, TraP components are required to degrade gracefully in the absence of this optional properties.
The required attributes are as follows:
-
beam
¶ Restoring beam. Tuple of three floats: semi-major axis (in pixels), semi-minor axis (pixels) and position angle (radians).
Type: tuple
-
centre_ra
¶ Right ascension at the central pixel of the image. Units of J2000 decimal degrees.
Type: float
-
centre_decl
¶ Declination at the central pixel of the image. Units of J2000 decimal degrees.
Type: float
-
data
¶ Two dimensional numpy.ndarray of floating point pixel values. (TODO: Definitive statement on orientation/transposing.)
Type: numpy.ndarray
-
freq_eff
¶ Effective frequency of the image in Hz. That is, the mean frequency of all the visibility data which comprises this image.
Type: float
-
pixelsize
¶ (x, y) tuple representing the size of a pixel along each axis in units of degrees.
Type: tuple
-
taustart_ts
¶ Timestamp of the first integration which constitutes part of this image. MJD in seconds.
Type: float
-
url
¶ A (string) URL representing the location of the image at time of processing.
Type: string
-
wcs
¶ An instance of
tkp.utility.coordinates.WCS
, describing the mapping from data pixels to sky-coordinates.Type: tkp.utility.coordinates.WCS
The class also provides some common functionality: static methods used for parsing datafiles, and an ‘extract_metadata’ function which provides key info in a simple dict format.
-
static
degrees2pixels
(bmaj, bmin, bpa, deltax, deltay)[source]¶ Convert beam in degrees to beam in pixels and radians. For example Fits beam parameters are in degrees.
Parameters: - bmaj (-) – Beam major axis in degrees
- bmin (-) – Beam minor axis in degrees
- bpa (-) – Beam position angle in degrees
- deltax (-) – Pixel size along the x axis in degrees
- deltay (-) – Pixel size along the y axis in degrees
Returns: Beam semi-major axis in pixels - semimin: Beam semi-minor axis in pixels - theta: Beam position angle in radians
Return type: - semimaj
-
The following acessors are derived from the basic DataAccessor
class:
-
class
tkp.accessors.fitsimage.
FitsImage
¶ Generic FITS data access.
-
class
tkp.accessors.casaimage.
CasaImage
¶ Generic CASA image access.
-
class
tkp.accessors.kat7casaimage.
Kat7CasaImage
¶ KAT-7 specific CASA image access.
LOFAR-specific data accessors¶
The following accessors are derived from the generic LofarAccessor
:
-
class
tkp.accessors.lofarfitsimage.
LofarFitsImage
¶ LOFAR FITS access.
-
class
tkp.accessors.lofarcasaimage.
LofarCasaImage
¶ LOFAR CASA image access.