tkp.accessors
API reference¶
tkp.accessors
– Base data accessor utilities¶
Data accessors.
These can be used to populate ImageData objects based on some data source (FITS file, array in memory… etc).
-
tkp.accessors.
open
(path, *args, **kwargs)[source]¶ Returns an accessor object (if available) for the file or directory ‘path’.
We try all the possible accessors in order from most specific to least specific. That is, if possible, we prefer an accessor providing LofarAccessor to one providing DataAccessor, but we accept the latter if that’s the only possible match.
Will raise an exception if something went wrong or no matching accessor class is found.
-
tkp.accessors.
sourcefinder_image_from_accessor
(image, **args)[source]¶ Create a source finder ImageData object from an image ‘accessor’
Parameters: image (-) – FITS/AIPS/HDF5 image available through an accessor. Returns: a source finder image. Return type: ( tkp.sourcefinder.image.ImageData
)
tkp.accessors.detection
– File type detection¶
-
class
tkp.accessors.detection.
FitsTest
(accessor, test)¶ Create new instance of FitsTest(accessor, test)
-
accessor
¶ Alias for field number 0
-
test
¶ Alias for field number 1
-
-
tkp.accessors.detection.
casa_detect
(filename)[source]¶ Detect which telescope produced CASA data, return corresponding accessor.
Checks for known CASA table types where we expect additional metadata. If the telescope is unknown we return nothing.
-
tkp.accessors.detection.
detect
(filename)[source]¶ returns the accessor class that should be used to process filename
-
tkp.accessors.detection.
fits_detect
(filename)[source]¶ Detect which telescope produced FITS data, return corresponding accessor.
Checks for known FITS image types where we expect additional metadata. If the telescope is unknown we default to a regular FitsImage.