Source Extractor: a starter guide - anjavdl/PHY517_AST443 GitHub Wiki

Purpose

SExtractor takes an input image (.fits file) and returns a catalog with various object properties (position, flux, and many more).

Syntax

SExtractor is run via the command sex on the command line. Just typing sex should bring up this helpfile:

            SExtractor  version 2.8.6 (2013-01-07)

by Emmanuel BERTIN <[email protected]>
visit http://astromatic.iap.fr/software/sextractor
    
> SYNTAX: sex <image> [<image2>][-c <configuration_file>][-<keyword> <value>]
> to dump a default configuration file:          sex -d
> to dump a default extended configuration file: sex -dd
> to dump a full list of measurement parameters: sex -dp

To adjust the software settings, you will need to make a configuration file. You can also specify settings directly on the command line using keywords. These will override the corresponding settings in the configuration file.

Set-up

Copy the following files to your directory:
https://github.com/anjavdl/PHY517_AST443/blob/master/exoplanet/default.se
https://github.com/anjavdl/PHY517_AST443/blob/master/exoplanet/default.param
These are your default configuration and default parameter files, respectively. Also copy
https://github.com/anjavdl/PHY517_AST443/blob/master/exoplanet/default.conv
https://github.com/anjavdl/PHY517_AST443/blob/master/exoplanet/default.nnw
These files relate to optimizing the object detection, but we will not modify them in the labs. Other version of these files can be found in /usr/share/sextractor/.

##The Configuration File

The configuration file is written in the following format:

KEYWORD    value          #comment

Making changes is easy: open default.se in your favorite text editor and adjust value next to the relevant keywords. Check the documentation for a full list of SExtractor keywords. Below are some keywords you should change to get started:

CATALOG_NAME the default is test.cat. Change this to something meaningful (make sure you have a naming convention so you don't drown in a sea of mystery files later on)

PARAMETERS_NAME this file tells SExtractor what to put into the catalog. See below for more information on the parameter file.

Running Sextractor and specifying keywords on the Command Line

You may specify any of the configuration file keywords on the command line as in the following example:

sex image_04.fits -c default.se -CATALOG_NAME image_04.cat

If a keyword appears both on the command line and in the configuration file, SExtractor will use the last instance.

##The Parameter File

The parameter file specifies which object attributes SExtractor returns for every detected object. The default file above is only a small subset of the available keywords; you can see a full list by typing sex -dp. Note that # at the beginning of a line means the parameter is commented out and is not returned.
If you write your own parameter file, make sure that you set the keyword PARAMETERS_NAME to the path of your new .param file.

Vector parameters

Some parameters can return multiple values. For example, we may want to measure aperture fluxes in more than aperture radius. In default.se, you could specify to measure aperture fluxes within 4, 8, and 16 pixels diameters:

PHOT_APERTURES   4,8,16          # MAG_APER aperture diameter(s) in pixels

We would then also need to tell the parameters file default.param that there are 3 values for this parameters:

FLUX_APER(3)             # Flux vector within fixed circular aperture(s)             [count]
FLUXERR_APER(3)          # RMS error vector for aperture flux(es)                    [count]

In the output catalog, FLUX_APER and FLUXERR_APER then have 3 columns (each).

More information

SExtractor on readthedocs:
https://sextractor.readthedocs.io/en/latest/
SExtractor on github:
https://github.com/astromatic/sextractor
SExtractor's webpage at Astromatic:
http://www.astromatic.net/software/sextractor
SExtractor forum:
http://www.astromatic.net/forum/forumdisplay.php?fid=4
"SExtractor for Dummies":
http://star-www.dur.ac.uk/~pdraper/extractor/Guide2source_extractor.pdf

⚠️ **GitHub.com Fallback** ⚠️