sourcefinder.accessors.detection ================================ .. py:module:: sourcefinder.accessors.detection Attributes ---------- .. autoapisummary:: sourcefinder.accessors.detection.casa_telescope_keyword_mapping sourcefinder.accessors.detection.casafiles sourcefinder.accessors.detection.fits_type_mapping sourcefinder.accessors.detection.logger Classes ------- .. autoapisummary:: sourcefinder.accessors.detection.FitsTest Functions --------- .. autoapisummary:: sourcefinder.accessors.detection.casa_detect sourcefinder.accessors.detection.detect sourcefinder.accessors.detection.fits_detect sourcefinder.accessors.detection.iscasa sourcefinder.accessors.detection.isfits sourcefinder.accessors.detection.islofarhdf5 Module Contents --------------- .. py:class:: FitsTest Bases: :py:obj:`tuple` .. py:attribute:: accessor .. py:attribute:: test .. py:function:: casa_detect(filename) Detect which telescope produced CASA data, return corresponding accessor. This function identifies the telescope that produced the CASA data by checking for known CASA table types with expected metadata. If the telescope cannot be determined, it returns `None`. :Parameters: **filename** : str The path to the CASA table to be analyzed. :Returns: subclass of FitsImage or None The accessor class corresponding to the detected telescope, or `None` if the telescope is unknown. .. !! processed by numpydoc !! .. py:function:: detect(filename) Determine the accessor class to process the given file. This function checks the format of the provided file and returns the appropriate accessor class to handle it. It supports FITS files, CASA directories, and LOFAR HDF5 containers. If the format is unsupported, an `OSError` is raised. :Parameters: **filename** : str The path to the file or directory to be processed. :Returns: FitsImage or subclass The accessor class corresponding to the detected file format. :Raises: OSError If the file format is unsupported. .. !! processed by numpydoc !! .. py:function:: fits_detect(filename) Detect which telescope produced FITS data, return corresponding accessor. This function identifies the telescope that produced the FITS data by checking for known FITS image types with expected metadata. If the telescope cannot be determined, it defaults to using a regular FitsImage accessor. :Parameters: **filename** : str The path to the FITS file to be analyzed. :Returns: FitsImage or subclass The accessor class corresponding to the detected telescope. .. !! processed by numpydoc !! .. py:function:: iscasa(filename) Determine if the given filename corresponds to a LOFAR CASA directory. This function checks if the specified directory exists, contains the expected files for a CASA table and can be opened using the `casacore.tables.table` module. :Parameters: **filename** : str The path to the directory to be checked. :Returns: bool True if the directory is a valid LOFAR CASA directory, False otherwise. .. !! processed by numpydoc !! .. py:function:: isfits(filename) Check if the given file is a FITS file. This function verifies whether the specified file exists, has a `.fits` extension, and can be opened using the `astropy.io.fits` module. :Parameters: **filename** : str The path to the file to be checked. :Returns: bool True if the file is a valid FITS file, False otherwise. .. !! processed by numpydoc !! .. py:function:: islofarhdf5(filename) Check if the given file is a LOFAR HDF5 container. This function verifies whether the specified file exists, has a `.h5` extension, and can be opened using the `casacore.images.image` module. :Parameters: **filename** : str The path to the file to be checked. :Returns: bool True if the file is a valid LOFAR HDF5 container, False otherwise. .. !! processed by numpydoc !! .. py:data:: casa_telescope_keyword_mapping .. py:data:: casafiles :value: ('table.dat', 'table.f0', 'table.f0_TSM0', 'table.info', 'table.lock') .. py:data:: fits_type_mapping .. py:data:: logger