sourcefinder.testutil.mock ========================== .. py:module:: sourcefinder.testutil.mock .. autoapi-nested-parse:: Mock / synthetic data objects for use in testing. .. !! processed by numpydoc !! Classes ------- .. autoapisummary:: sourcefinder.testutil.mock.Mock sourcefinder.testutil.mock.SyntheticImage Functions --------- .. autoapisummary:: sourcefinder.testutil.mock.make_wcs Module Contents --------------- .. py:class:: Mock(returnvalue=None) Bases: :py:obj:`object` .. py:attribute:: callcount :value: 0 .. py:attribute:: callvalues :value: [] .. py:attribute:: returnvalue :value: None .. py:class:: SyntheticImage(wcs=None, data=None, beam=(1.5, 1.5, 0), freq_eff=150000000.0, freq_bw=2000000.0, tau_time=1800, taustart_ts=datetime.datetime(2015, 1, 1)) Bases: :py:obj:`sourcefinder.accessors.dataaccessor.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:: calculate_phase_centre() Calculate the equatorial coordinates of the center of the synthetic image, based on the image dimensions. :Returns: tuple A tuple containing the right ascension and declination of the image center in degrees. .. !! processed by numpydoc !! .. py:attribute:: beam :value: (1.5, 1.5, 0) .. py:attribute:: data :value: None .. py:attribute:: freq_bw :value: 2000000.0 .. py:attribute:: freq_eff :value: 150000000.0 .. py:attribute:: pixelsize .. py:attribute:: tau_time :value: 1800 .. py:attribute:: taustart_ts .. py:attribute:: url :value: 'SyntheticImage' .. py:attribute:: wcs :value: None .. py:function:: make_wcs(crval=None, cdelt=None, crpix=None) Make a WCS object for insertion into a synthetic image. Args: crval : tuple, default : None Tuple of (RA, Dec) in decimal degrees at the reference position. crpix : tuple, default : None Tuple of (x, y) coordinates describing the reference pixel location corresponding to the crval sky-position. cdelt : tuple, default : None Tuple of (cdelt0, cdelt1) in decimal degrees. This is the pixel width in degrees of arc, but not necessarily aligned to RA, Dec unless `crota` is (0, 0). If that *is* the case, then typically cdelt0 is negative since the x-axis is in the direction of West (decreasing RA). .. !! processed by numpydoc !!