JWSTSourceCatalog

class jwst.source_catalog.source_catalog.JWSTSourceCatalog(model, catalog, kernel_fwhm, aperture_params, abvega_offset, ci_star_thresholds)[source]

Bases: object

Class for the JWST source catalog.

Parameters:
modelImageModel

The input ImageModel. The data is assumed to be background-subtracted. Units are expected to be Jy.

catalogQTable

Source catalog table, e.g., as output from make_tweakreg_catalog().

kernel_fwhmfloat

The full-width at half-maximum (FWHM) of the 2D Gaussian kernel. This is needed to calculate the DAOFind sharpness and roundness properties (DAOFind uses a special kernel that sums to zero).

aperture_paramsdict

A dictionary containing the aperture parameters (radii, aperture corrections, and background annulus inner and outer radii).

abvega_offsetfloat

Offset to convert from AB to Vega magnitudes. The value represents m_AB - m_Vega.

ci_star_thresholdsarray-like of 2 floats

The concentration index thresholds for determining whether a source is a star. The first threshold corresponds to the concentration index calculated from the smallest and middle aperture radii (see aperture_params). The second threshold corresponds to the concentration index calculated from the middle and largest aperture radii. An object is considered extended if both concentration indices are greater than the corresponding thresholds, otherwise it is considered a star.

Notes

model.err is assumed to be the total error array corresponding to the input science model.data array. It is assumed to include all sources of error, including the Poisson error of the sources, and have the same shape and units as the science data array.

Attributes Summary

aper_bkg_flux

Return aperture local background fluxes (per pixel).

aper_bkg_flux_err

Return aperture local background flux errors (per pixel).

aper_total_abmag

Return the aperture-corrected total AB magnitude.

aper_total_abmag_err

Return the aperture-corrected total AB magnitude error.

aper_total_flux

Return the aperture-corrected total flux for sources.

aper_total_flux_err

Return the aperture-corrected total flux error for sources.

aper_total_vegamag

Return the aperture-corrected total Vega magnitude.

aper_total_vegamag_err

Return the aperture-corrected total Vega magnitude error.

aperture_abmag_colnames

Return the aperture AB magnitude column names.

aperture_abmag_descriptions

Return the aperture AB magnitude column descriptions.

aperture_colnames

Update the column_desc dictionary to include background flux information.

aperture_flux_colnames

Return the aperture flux column names.

aperture_flux_descriptions

Return the aperture flux column descriptions.

aperture_vegamag_colnames

Return the aperture Vega magnitude column names.

aperture_vegamag_descriptions

Return the aperture Vega magnitude column descriptions.

catalog

Build the final source catalog.

ci_colname_descriptions

Return the concentration indices column descriptions.

ci_colnames

Return the column names of the three concentration indices.

colnames

Return the column names in order for the final source catalog.

concentration_indices

Determine the concentration indices.

extras_colnames

Update the column_desc dictionary to include DAO starfinder computed quantities.

is_extended

Return a boolean indicating whether the source is extended.

isophotal_abmag

Return the isophotal AB magnitudes.

isophotal_abmag_err

Return the isophotal AB magnitude errors.

isophotal_vegamag

Return the isophotal Vega magnitudes.

isophotal_vegamag_err

Return the isophotal Vega magnitude errors.

nn_dist

Return the distance in pixels to the nearest neighbor for each source.

nn_label

Return the label number of the nearest neighbor for each source.

roundness

Compute the DAOFind source roundness statistic based on symmetry.

segment_colnames

Update the column_desc dictionary to include column names and descriptions.

sharpness

Compute the DAOFind source sharpness statistic.

sky_centroid

Compute the sky coordinate of the source centroid.

sky_orientation

Compute the orientation of the source major axis.

xypos

Return the (x, y) source centroids defined from the segmentation image.

Methods Summary

convert_flux_to_abmag(flux, flux_err)

Convert flux (and error) to AB magnitude (and error).

convert_jy_to_mjysr(model)

Convert data and errors from Jy to MJy/sr, and from Quantity to ndarray.

convert_mjysr_to_jy(model)

Convert data and errors from MJy/sr to Jy, and into Quantity objects.

format_columns(catalog)

Format the values in the output catalog.

set_aperture_properties()

Calculate the aperture photometry and set the values as dynamic attributes.

set_ci_properties()

Set the concentration indices as dynamic attributes.

set_segment_properties()

Calculate the segment-based source photometry and morphologies.

Attributes Documentation

aper_bkg_flux

Return aperture local background fluxes (per pixel).

Returns:
Quantity

The aperture local background fluxes.

aper_bkg_flux_err

Return aperture local background flux errors (per pixel).

Returns:
Quantity

The aperture local background flux errors.

aper_total_abmag

Return the aperture-corrected total AB magnitude.

Should be used only for unresolved sources.

Returns:
ndarray

The aperture-corrected total AB magnitude.

aper_total_abmag_err

Return the aperture-corrected total AB magnitude error.

Should be used only for unresolved sources.

Returns:
ndarray

The aperture-corrected total AB magnitude error.

aper_total_flux

Return the aperture-corrected total flux for sources.

Computed based on the flux in largest aperture. Should be used only for unresolved sources.

Returns:
Quantity

The aperture-corrected total flux

aper_total_flux_err

Return the aperture-corrected total flux error for sources.

Computed based on the flux in largest aperture. Should be used only for unresolved sources.

Returns:
Quantity

The aperture-corrected total flux error

aper_total_vegamag

Return the aperture-corrected total Vega magnitude.

Should be used only for unresolved sources.

Returns:
ndarray

The aperture-corrected total Vega magnitude.

aper_total_vegamag_err

Return the aperture-corrected total Vega magnitude error.

Should be used only for unresolved sources.

Returns:
ndarray

The aperture-corrected total Vega magnitude error.

aperture_abmag_colnames

Return the aperture AB magnitude column names.

Returns:
list of str

The aperture AB magnitude column names.

aperture_abmag_descriptions

Return the aperture AB magnitude column descriptions.

Returns:
list of str

The aperture AB magnitude column descriptions.

aperture_colnames

Update the column_desc dictionary to include background flux information.

Returns:
colnameslist of str

A list of the column names that were updated by this function.

aperture_flux_colnames

Return the aperture flux column names.

Returns:
list of str

The aperture flux column names.

aperture_flux_descriptions

Return the aperture flux column descriptions.

Returns:
list of str

The aperture flux column descriptions.

aperture_vegamag_colnames

Return the aperture Vega magnitude column names.

Returns:
list of str

The aperture Vega magnitude column names.

aperture_vegamag_descriptions

Return the aperture Vega magnitude column descriptions.

Returns:
list of str

The aperture Vega magnitude column descriptions.

catalog

Build the final source catalog.

Returns:
catalogTable

The final source catalog.

ci_colname_descriptions

Return the concentration indices column descriptions.

Returns:
list of str

The concentration indices column descriptions.

ci_colnames

Return the column names of the three concentration indices.

Returns:
list of str

The concentration indices column names.

colnames

Return the column names in order for the final source catalog.

Returns:
list of str

The column names.

concentration_indices

Determine the concentration indices.

These are calculated as the flux ratios of:

  • the middle / smallest aperture radii/EE, e.g., CI_50_30 = aper50_flux / aper30_flux

  • the largest / middle aperture radii/EE, e.g., CI_70_50 = aper70_flux / aper50_flux

  • the largest / smallest aperture radii/EE, e.g., CI_70_30 = aper70_flux / aper30_flux

Returns:
list of float

The concentration indices.

extras_colnames

Update the column_desc dictionary to include DAO starfinder computed quantities.

Returns:
colnameslist of str

A list of the column names that were updated by this function.

is_extended

Return a boolean indicating whether the source is extended.

Returns:
ndarray

A boolean array where True values denote extended sources.

isophotal_abmag

Return the isophotal AB magnitudes.

Returns:
ndarray

The isophotal AB magnitudes.

isophotal_abmag_err

Return the isophotal AB magnitude errors.

Returns:
ndarray

The isophotal AB magnitudes.

isophotal_vegamag

Return the isophotal Vega magnitudes.

Returns:
ndarray

The isophotal Vega magnitudes.

isophotal_vegamag_err

Return the isophotal Vega magnitude errors.

Returns:
ndarray

The isophotal Vega magnitude errors.

nn_dist

Return the distance in pixels to the nearest neighbor for each source.

Returns NaN if there is only one detected source or for non-finite xypos.

Returns:
Quantity

The distances in pixels to the nearest neighbors.

nn_label

Return the label number of the nearest neighbor for each source.

A label value of -1 is returned if there is only one detected source and for sources with a non-finite xcentroid or ycentroid.

Returns:
ndarray

The label number of the nearest neighbor.

roundness

Compute the DAOFind source roundness statistic based on symmetry.

The roundness characteristic computes the ratio of a measure of the bilateral symmetry of the object to a measure of the four-fold symmetry of the object.

“Round” objects have a roundness close to 0, generally between -1 and 1.

Returns:
ndarray

The DAOFind source roundness statistic.

segment_colnames

Update the column_desc dictionary to include column names and descriptions.

Returns:
colnameslist of str

A list of the column names that were updated by this function.

sharpness

Compute the DAOFind source sharpness statistic.

The sharpness statistic measures the ratio of the difference between the height of the central pixel and the mean of the surrounding non-bad pixels to the height of the best fitting Gaussian function at that point.

Stars generally have a sharpness between 0.2 and 1.0.

Returns:
ndarray

The DAOFind source sharpness statistic.

sky_centroid

Compute the sky coordinate of the source centroid.

The output coordinate frame is the same as the input wcs.

Returns:
SkyCoord or None

The sky coordinate of the source centroid, or None if the WCS is not set.

sky_orientation

Compute the orientation of the source major axis.

Returns:
Quantity

The position angle of the source major axis, measured East of North.

xypos

Return the (x, y) source centroids defined from the segmentation image.

Returns:
xyposndarray

A 2D array of the (x, y) source positions.

Methods Documentation

static convert_flux_to_abmag(flux, flux_err)[source]

Convert flux (and error) to AB magnitude (and error).

Parameters:
flux, flux_errQuantity

The input flux and error arrays in units of Jy.

Returns:
abmag, abmag_errndarray

The output AB magnitude and error arrays.

static convert_jy_to_mjysr(model)[source]

Convert data and errors from Jy to MJy/sr, and from Quantity to ndarray.

static convert_mjysr_to_jy(model)[source]

Convert data and errors from MJy/sr to Jy, and into Quantity objects.

static format_columns(catalog)[source]

Format the values in the output catalog.

Parameters:
catalogTable

The catalog to format.

Returns:
resultTable

The formatted catalog.

set_aperture_properties()[source]

Calculate the aperture photometry and set the values as dynamic attributes.

set_ci_properties()[source]

Set the concentration indices as dynamic attributes.

set_segment_properties()[source]

Calculate the segment-based source photometry and morphologies.

The values are set as dynamic attributes.