Module: single_extension_fits#

class kbmod.standardizers.fits_standardizers.single_extension_fits.SingleExtensionFits(location=None, hdulist=None, config=None, **kwargs)[source]#

Suppports processing of a single, single-extension, FITS file.

The PRIMARY HDU contains the data and is the sole element of the exts. The WCS is extracted from the PRIMARY HDU as well.

Parameters:
locationstr

Location of the FITS file, can be an URI or local filesystem path.

Attributes:
hdulist~astropy.io.fits.HDUList

All HDUs found in the FITS file

primary~astropy.io.fits.PrimaryHDU

The primary HDU.

extslist

Any additional extensions marked by the standardizer for further processing, ~astropy.io.fits.CompImageHDU or ~astropy.io.fits.ImageHDU expected. Does not include the primary HDU if it doesn’t contain any image data. Contains at least 1 entry.

wcslist

A list of WCS’s or None for each entry marked as processable.

bboxlist

A list of bounding boxes or None for each entry marked as processable.

Methods

canStandardize(tgt)

Returns True when the standardizer knows how to process the given upload (file) type.

close([output_verify, verbose, closed])

Close the associated FITS file and memmap object, if any.

get(tgt[, force, config])

Get the standardizer class that can handle given file.

resolveFromPath(tgt)

Successfully resolves FITS files on a local file system, that are readable by AstroPy.

resolveTarget(tgt)

Returns True if the target is a FITS file on a local filesystem, that can be read by AstroPy FITS module, or an ~astropy.io.fits.HDUList.

standardize()

Invokes standardize metadata, image, variance, mask and PSF and returns the results as a dictionary.

standardizeBBox()

Calculate the standardized bounding box, the world coordinates at image corner and image center.

standardizeMaskImage()

Standardizes the mask data as an simple 0 (not masked) and 1 (masked) bitmap.

standardizeMetadata()

Standardizes required and optional metadata from the given data.

standardizePSF()

Returns PSF for each extension marked as processable.

standardizeScienceImage()

Standardizes the science image data.

standardizeVarianceImage()

Standardizes the variance data.

standardizeWCS()

Creates an WCS for every processable science image.

toLayeredImage()

Returns a list of ~kbmod.search.layered_image objects for each entry marked as processable.

translateHeader(*args, **kwargs)

Maps the header keywords to the required and optional metadata.

configClass

configClass#

alias of FitsStandardizerConfig

classmethod resolveTarget(tgt)[source]#

Returns True if the target is a FITS file on a local filesystem, that can be read by AstroPy FITS module, or an ~astropy.io.fits.HDUList.

Parameters:
tgtstr

Path to FITS file.

Returns:
canStandardizebool

True if target is a FITS file readable by AstroPy. False otherwise.

resourcesdict, optional

An empty dictionary when canStandardize is False. A dict containing ~fits.HDUList when canStandardize is True.

Raises:
FileNotFoundError - when target is path to file that doesn’t exist
TypeError - when target is not HDUList or a filepath.