# Classes to manage Catalogs and WCS’s¶

This module provides the classes used to generate and manage source catalogs for each input chip. Those positions can be transformed to undistorted sky positions, written out to files, or plotted using various methods defined for these classes.

drizzlepac.catalogs.generateCatalog(wcs, mode='automatic', catalog=None, src_find_filters=None, **kwargs)[source]

Function which determines what type of catalog object needs to be instantiated based on what type of source selection algorithm the user specified.

Parameters: wcs : obj WCS object generated by STWCS or PyWCS catalog : str or ndarray Filename of existing catalog or ndarray of image for generation of source catalog. kwargs : dict Parameters needed to interpret source catalog from input catalog with findmode being required. catalog : obj A Catalog-based class instance for keeping track of WCS and associated source catalog
class drizzlepac.catalogs.ImageCatalog(wcs, catalog_source, src_find_filters=None, **kwargs)[source]

Class which generates a source catalog from an image using Python-based, daofind-like algorithms

Required input kwargs parameters:

computesig, skysigma, threshold, peakmin, peakmax,
hmin, conv_width, [roundlim, sharplim]

generateXY(**kwargs)[source]

Generate source catalog from input image using DAOFIND-style algorithm

class drizzlepac.catalogs.UserCatalog(wcs, catalog_source, **kwargs)[source]

Class to manage user-supplied catalogs as inputs.

Required input kwargs parameters:

xyunits, xcol, ycol[, fluxcol, [idcol]]

COLNAMES = ['xcol', 'ycol', 'fluxcol']
IN_UNITS = None
generateXY(**kwargs)[source]

Method to interpret input catalog file as columns of positions and fluxes.

plotXYCatalog(**kwargs)[source]

Plots the source catalog positions using matplotlib’s pyplot.plot()

Plotting kwargs that can also be passed include any keywords understood by matplotlib’s pyplot.plot() function such as:

vmin, vmax, cmap, marker

set_colnames()[source]

Method to define how to interpret a catalog file Only needed when provided a source catalog as input

class drizzlepac.catalogs.RefCatalog(wcs, catalog_source, **kwargs)[source]

Class which manages a reference catalog.

Notes

A reference catalog is defined as a catalog of undistorted source positions given in RA/Dec which would be used as the master list for subsequent matching and fitting.

COLNAMES = ['refxcol', 'refycol', 'rfluxcol']
IN_UNITS = 'degrees'
PAR_NBRIGHT_PREFIX = 'ref'
PAR_PREFIX = 'r'
buildXY(catalogs)[source]
generateRaDec()[source]

Convert XY positions into sky coordinates using STWCS methods.

generateXY(**kwargs)[source]

Method to interpret input catalog file as columns of positions and fluxes.

class drizzlepac.catalogs.Catalog(wcs, catalog_source, **kwargs)[source]

Bases: object

Base class for keeping track of a source catalog for an input WCS

Warning

This class should never be instantiated by itself, as necessary methods are not defined yet.

This class requires the input of a WCS and a source for the catalog, along with any arguments necessary for interpreting the catalog.

Parameters: wcs : obj Input WCS object generated using STWCS or HSTWCS catalog_source : str Name of the file from which to read the catalog. kwargs : dict Parameters for interpreting the catalog file or for performing the source extraction from the image. These will be set differently depending on the type of catalog being instantiated.
PAR_NBRIGHT_PREFIX = ''
PAR_PREFIX = ''
apply_exclusions(exclusions)[source]

Trim sky catalog to remove any sources within regions specified by exclusions file.

apply_flux_limits()[source]

Apply any user-specified limits on source selection Limits based on fluxes.

buildCatalogs(exclusions=None, **kwargs)[source]

Primary interface to build catalogs based on user inputs.

generateRaDec()[source]

Convert XY positions into sky coordinates using STWCS methods.

generateXY(**kwargs)[source]

Method to generate source catalog in XY positions Implemented by each subclass

plotXYCatalog(**kwargs)[source]

Method which displays the original image and overlays the positions of the detected sources from this image’s catalog.

Plotting kwargs that can be provided are:

vmin, vmax, cmap, marker

Default colormap is summer.

set_colnames()[source]

Method to define how to interpret a catalog file Only needed when provided a source catalog as input

writeXYCatalog(filename)[source]

Write out the X,Y catalog to a file