sourcefinder.accessors.detection#
Attributes#
Classes#
Functions#
|
Detect which telescope produced CASA data, return corresponding accessor. |
|
Determine the accessor class to process the given file. |
|
Detect which telescope produced FITS data, return corresponding accessor. |
|
Determine if the given filename corresponds to a LOFAR CASA directory. |
|
Check if the given file is a FITS file. |
|
Check if the given file is a LOFAR HDF5 container. |
Module Contents#
- sourcefinder.accessors.detection.casa_detect(filename)[source]#
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:
- filenamestr
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.
- sourcefinder.accessors.detection.detect(filename)[source]#
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:
- filenamestr
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.
- sourcefinder.accessors.detection.fits_detect(filename)[source]#
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:
- filenamestr
The path to the FITS file to be analyzed.
- Returns:
- FitsImage or subclass
The accessor class corresponding to the detected telescope.
- sourcefinder.accessors.detection.iscasa(filename)[source]#
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:
- filenamestr
The path to the directory to be checked.
- Returns:
- bool
True if the directory is a valid LOFAR CASA directory, False otherwise.
- sourcefinder.accessors.detection.isfits(filename)[source]#
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:
- filenamestr
The path to the file to be checked.
- Returns:
- bool
True if the file is a valid FITS file, False otherwise.
- sourcefinder.accessors.detection.islofarhdf5(filename)[source]#
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:
- filenamestr
The path to the file to be checked.
- Returns:
- bool
True if the file is a valid LOFAR HDF5 container, False otherwise.