sourcefinder.accessors.dataaccessor =================================== .. py:module:: sourcefinder.accessors.dataaccessor Attributes ---------- .. autoapisummary:: sourcefinder.accessors.dataaccessor.logger Classes ------- .. autoapisummary:: sourcefinder.accessors.dataaccessor.DataAccessor Module Contents --------------- .. py:class:: DataAccessor Base class for accessors used with :class:`sourcefinder.image.ImageData`. Data accessors provide a uniform way for the ImageData class (i.e., 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 these optional properties. :Attributes: **beam** : tuple Restoring beam. Tuple of three floats: semi-major axis (in pixels), semi-minor axis (pixels), and position angle (radians). **centre_ra** : float Right ascension at the central pixel of the image. Units of J2000 decimal degrees. **centre_decl** : float Declination at the central pixel of the image. Units of J2000 decimal degrees. **data** : numpy.ndarray Two-dimensional numpy.ndarray of floating point pixel values. **freq_bw** : float The frequency bandwidth of this image in Hz. **freq_eff** : float Effective frequency of the image in Hz. That is, the mean frequency of all the visibility data which comprises this image. **pixelsize** : tuple (x, y) tuple representing the size of a pixel along each axis in units of degrees. **tau_time** : float Total time on sky in seconds. **taustart_ts** : float Timestamp of the first integration which constitutes part of this image. MJD in seconds. **url** : str A URL representing the location of the image at the time of processing. **wcs** : :class:`sourcefinder.utility.coordinates.WCS` An instance of :py:class:`sourcefinder.utility.coordinates.WCS`, describing the mapping from data pixels to sky-coordinates. .. rubric:: Notes The class also provides some common functionality: static methods used for parsing data files, and an 'extract_metadata' function which provides key info in a simple dict format. .. !! processed by numpydoc !! .. py:method:: degrees2pixels(bmaj, bmin, bpa, deltax, deltay) -> tuple[float, float, float] :staticmethod: Convert beam in degrees to beam in pixels and radians. For example, FITS beam parameters are in degrees. :Parameters: **bmaj** : float Beam major axis in degrees. **bmin** : float Beam minor axis in degrees. **bpa** : float Beam position angle in degrees. **deltax** : float Pixel size along the x-axis in degrees. **deltay** : float Pixel size along the y-axis in degrees. :Returns: **semimaj** : float Beam semi-major axis in pixels. **semimin** : float Beam semi-minor axis in pixels. **theta** : float Beam position angle in radians. .. !! processed by numpydoc !! .. py:method:: extract_metadata() -> dict Massage the class attributes into a flat dictionary with database-friendly values. While rather tedious, this is easy to serialize and store separately to the actual image data. May be extended by subclasses to return additional data. :Returns: dict A dictionary containing key-value pairs of class attributes formatted for database storage. .. !! processed by numpydoc !! .. py:method:: parse_pixelsize() -> tuple[float, float] Parse pixel size. :Returns: **deltax** : float Pixel size along the x axis in degrees. **deltay** : float Pixel size along the y axis in degrees. .. !! processed by numpydoc !! .. py:attribute:: beam :type: Optional[tuple[float, float, float]] :value: None .. py:attribute:: centre_decl :type: float .. py:attribute:: centre_ra :type: float .. py:attribute:: conf :type: Optional[sourcefinder.config.ImgConf] :value: None .. py:attribute:: data :type: numpy.ndarray .. py:attribute:: freq_bw :type: float .. py:attribute:: freq_eff :type: float .. py:attribute:: pixelsize :type: tuple .. py:attribute:: tau_time :type: float .. py:attribute:: taustart_ts :type: float .. py:attribute:: url :type: str .. py:attribute:: wcs :type: sourcefinder.utility.coordinates.WCS .. py:data:: logger