Catalog¶
-
class
mpdaf.sdetect.
Catalog
(*args, **kwargs)[source]¶ Bases:
astropy.table.Table
This class inherits from
astropy.table.Table
. Its goal is to manage a list of objects.Methods Summary
edgedist
(wcs[, ra, dec])Return the smallest distance of all catalog sources center to the edge of the WCS of the given image. from_path
(path[, fmt, pattern])Construct a catalog from a list of source objects which are contains in the directory given as input. from_sources
(sources[, fmt])Construct a catalog from a list of source objects. masked_invalid
()Mask where invalid values occur (NaNs or infs or -9999 or ‘’). match
(cat2[, radius, colc1, colc2, full_output])Match elements of the current catalog with an other (in RA, DEC). plot_id
(ax, wcs[, iden, ra, dec, symb, ...])This function displays the id of the catalog. plot_symb
(ax, wcs[, ra, dec, symb, col, alpha])This function plots the sources location from the catalog. read
(*args, **kwargs)select
(wcs[, ra, dec, margin])Select all sources from catalog which are inside the given WCS and return a new catalog. Methods Documentation
-
edgedist
(wcs, ra='RA', dec='DEC')[source]¶ Return the smallest distance of all catalog sources center to the edge of the WCS of the given image.
Parameters: wcs :
WCS
Image WCS
ra : str
Name of the column that contains RA values in degrees
dec : str
Name of the column that contains DEC values in degrees
Returns: out :
numpy.array
in arcsec units
-
classmethod
from_path
(path, fmt='default', pattern='*.fits')[source]¶ Construct a catalog from a list of source objects which are contains in the directory given as input.
The new catalog will contain all data stored in the primary headers and in the tables extensions of the sources:
- a column per header fits (‘SIMPLE’, ‘BITPIX’, ‘NAXIS’, ‘EXTEND’, ‘DATE’, ‘AUTHOR’, ‘COM*’ and ‘HIST*’ are excluded)
- two columns per magnitude band: [BAND] [BAND]_ERR
- three columns per redshift Z_[Z_DESC], Z_[Z_DESC]_MIN and Z_[Z_DESC]_MAX
- several columns per line.
The lines columns depend of the format. By default the columns names are created around unique LINE name [LINE]_[LINES columns names]. But it is possible to use a working format. [LINES columns names]_xxx where xxx is the number of lines present in each source.
Parameters: path : str
Directory containing Source files
fmt : str ‘working’|’default’
Format of the catalog. The format differs for the LINES table.
pattern : str
Pattern used to select the files, default to
*.fits
.
-
classmethod
from_sources
(sources, fmt='default')[source]¶ Construct a catalog from a list of source objects.
The new catalog will contain all data stored in the primary headers and in the tables extensions of the sources:
- a column per header fits (‘SIMPLE’, ‘BITPIX’, ‘NAXIS’, ‘EXTEND’, ‘DATE’, ‘AUTHOR’, ‘COM*’ and ‘HIST*’ are excluded)
- two columns per magnitude band: [BAND] [BAND]_ERR
- three columns per redshift Z_[Z_DESC], Z_[Z_DESC]_MIN and Z_[Z_DESC]_MAX
- several columns per line.
The lines columns depend of the format. By default the columns names are created around unique LINE name [LINE]_[LINES columns names]. But it is possible to use a working format. [LINES columns names]_xxx where xxx is the number of lines present in each source.
Parameters: sources : list<
mpdaf.sdetect.Source
>List of
mpdaf.sdetect.Source
objectsfmt : str ‘working’|’default’
Format of the catalog. The format differs for the LINES table.
-
match
(cat2, radius=1, colc1=('RA', 'DEC'), colc2=('RA', 'DEC'), full_output=True)[source]¶ Match elements of the current catalog with an other (in RA, DEC).
Parameters: cat2 :
astropy.table.Table
Catalog to match.
radius : float
Matching size in arcsec (default 1).
colc1: tuple
(‘RA’,’DEC’) name of ra,dec columns of input table
colc2: tuple
(‘RA’,’DEC’) name of ra,dec columns of cat2
Returns: if full_output is True
out : astropy.Table, astropy.Table, astropy.Table
match, nomatch1, nomatch2
else
out : astropy.Table
match
match: table of matched elements in RA,DEC
nomatch1: sub-table of non matched elements of the current catalog
nomatch2: sub-table of non matched elements of the catalog cat2
-
plot_id
(ax, wcs, iden='ID', ra='RA', dec='DEC', symb=0.2, alpha=0.5, col='k', **kwargs)[source]¶ This function displays the id of the catalog.
Parameters: ax : matplotlib.axes._subplots.AxesSubplot
Matplotlib axis instance (eg ax = fig.add_subplot(2,3,1)).
wcs :
mpdaf.obj.WCS
Image WCS
iden : str
Name of the column that contains ID values
ra : str
Name of the column that contains RA values
dec : str
Name of the column that contains DEC values
symb : float
Size of the circle in arcsec
col : str
Symbol color.
alpha : float
Symbol transparency
kwargs : matplotlib.artist.Artist
kwargs can be used to set additional plotting properties.
-
plot_symb
(ax, wcs, ra='RA', dec='DEC', symb=0.4, col='k', alpha=1.0, **kwargs)[source]¶ This function plots the sources location from the catalog.
Parameters: ax : matplotlib.axes._subplots.AxesSubplot
Matplotlib axis instance (eg ax = fig.add_subplot(2,3,1)).
wcs :
mpdaf.obj.WCS
Image WCS
ra : str
Name of the column that contains RA values (in degrees)
dec : str
Name of the column that contains DEC values (in degrees)
symb : list or str or float
- List of 3 columns names containing FWHM1,
FWHM2 and ANGLE values to define the ellipse of each source.
- Column name containing value that will be used
to define the circle size of each source.
float in the case of circle with constant size in arcsec
col : str
Symbol color.
alpha : float
Symbol transparency
kwargs : matplotlib.artist.Artist
kwargs can be used to set additional plotting properties.
-
select
(wcs, ra='RA', dec='DEC', margin=0)[source]¶ Select all sources from catalog which are inside the given WCS and return a new catalog.
Parameters: wcs :
WCS
Image WCS
ra : str
Name of the column that contains RA values in degrees.
dec : str
Name of the column that contains DEC values in degrees.
margin : int
Margin from the edges.
Returns: out :
mpdaf.sdetect.Catalog
-