Tom's Corner - Sextractor Source Extraction
 


Source Extractor/
Sextractor
CCD image example
courtesy Mt. Evans Womble - Meyer observatory

Background

This page is an attempt to demonstrate how to use the Source Extraction routines used in CCDSoft effectively with an example image. Source Extractor (SExtractor) is very well documented on the web and I strongly recommend the document SExtractor for Dummies referenced here. Note I do not consider this "light reading" by any means but accurate image analysis like this is not a simple task.

 

Because fully documenting all of SExtractor's capabilities is beyond the scope of this page if you wish to further research the routines (including all calculations used) visit the SExtractor Home Page, an/or read the document "SExtractor for Dummies, Everything You Wanted to Know About Source Extractor and I was Forced to Find Out" (98 pages) by Benne W. Holwerda of the Space Telescope Science Institute.

 

The reason for choosing the SEXtractor routines for CCD image analysis in CCDSoft, as opposed to writing them in-house, are simple. The routines have been years in the making, this is a very involved task not to be taken lightly, and the routines work extremely well and they have been refined over many years. Why re-write the wheel?  As is the case with the astrometric routines used in CCDSoft namely PC-ASTROM.  

 

Please refer also the CCDSoft help file for more details on both the astrometric routines and the Source Extractor routines and how to use them.
 

Case scenario

The following scenario uses an image provided by Dr. Robert Stencil and Matt Dahl taken from the Meyer-Womble Observatory located on top of Mt. Evans in Colorado. The telescope is a dual 28 inch (0.7 meter) f/21 Ritchey Chrétien system. The CCD camera is the smaller detector (by today's standards) ST-7E which yields a very small field of view. A focal reducer (f/ 3.3) was used to increase the size of the field and without it the field would not be usable. See below for image details.

Sample SBIG ST-7E CCD image

Image courtesy Dr. Stencil - Matt Dahl - Steve Howell
Meyer - Womble Observatory

Their objective

The goal was to determine the variability of faint stars in the cluster NGC6791 in an attempt to find candidates for extra-solar planets. Dr. Stencil/Matt Dahl will be presenting a paper on their results at the next AAS 207th Meeting, 8-12 January 2006. On line details are here,

http://www.aas.org/publications/baas/v37n4/aas207/276.htm

Field of View reported by Image Link

Using Image Link technology we get the following data from the image,

Object name: Image Link Information
Equatorial: RA: 19h 20m 45s   Dec: +37°48'26"(current)
Equatorial 2000: RA: 19h 20m 56s   Dec: +37°48'51"
Horizon: Azim: 351°59'03"   Alt: -11°54'38"
Visibility: Rise 03:57,  Set 21:26
Transit time: 12:42  
Position angle: 182°17'
Hour angle: 11h 20m 03s
Screen x,y: 623.00, 463.00
Sidereal time: 06:41
Click distance: 500.0000
Scale: 0.7878
Height: 3.3504
Width: 5.0457
Note the small field of view at only 3.3 by 5.0457 arcminutes!

Issue with the CCD image

In addition to the field of view being very small ( 3 by 5 arcminutes) the coordinates stamped in the original FITS image were those of the cluster NGC 6791 not the actual telescope's position. By using the default coordinates in the image with CCDSoft's AutoAstrometry the astrometry routines will not work directly because the position in the image is off far enough to cause the matching to fail. Image Link to the rescue.

Image Link

Solution:  By knowing the scale of the image at 0.78 arcseconds/pixel using TheSky's Image Link Technology the precise coordinates of the center of the CCD image can be found automatically then modified for use with the Astrometry routines in CCDSoft accordingly. Here is exactly how!
 

Use the Image Link setup to enter the known scale and increase the search radius in fields of view. This allows Image Link to search "x" times the field of view for a match covering a much wider area.

Tools | Image Link Setup

Increase the search area

Now Image Link Technology can find a match for the image even if the TheSky display is centered on NGC 6791.

 

Coordinates for NGC 6791

 Equatorial 2000: RA: 19h 20m 53s Dec: +37°46'18"

Actual center from Image Link  Equatorial 2000: RA: 19h 20m 56s Dec: +37°48'51"

 

Does this small discrepancy in coordinates really matter? It does when you are using CCDSoft's Auto-Astrometry routines. In that case you must enter both accurate scale and accurate coordinates or the routines will fail. Garbage in Garbage out. This is why it is often helpful to perform an Image Link first to refine the coordinates for you. That is if you are unsure about the center of the image or have problems getting auto-astrometry to work right off the bat.

Auto-Astrometry

When trying to perform the automated Astrometry (Research | Insert WCS/Auto-Astrometry) when using the coordinates for the cluster NGC 6791 as stamped in the CCD image, CCDsoft will return the following error message. The small error in the coordinates is the reason for this. Basically it is trying to use stars in the wrong field.

Error message

Unable to find a match due to bad input coordinates

Back to Image Link to the rescue!

Edit Copy the Image Link Coordinates

To the Clip Board

In order to see the Image Link information you must be on the object "Image Link Information" as shown above!  It will NOT be the first entry in the dialog!  Use the Down "v" arrow to bring up the drop down list showing the Image Link Information. The list will depend on where you have clicked and what data is present in the image.

 

Next, use the other minimize double "v" button located on the lower right of the Object Information dialog to shrink (minimize) the Object Information dialog OR you will NOT be able to mouse drag and  copy the text out of the dialog!

Drop down list use "V"

Your list may vary!

Here is the text (RIGHT MOUSE Click and then choose Copy) from the above minimized dialog.

Left Mouse button Drag
the Equatorial 2000 coordinates


Start at 19h then drag through to 52"
Right Mouse Click and choose Copy!

19h 20m 56s Dec: +37°48'52"

 

Now Edit | Paste the text into CCDSoft's Auto-Astrometry dialog. That is Research | Insert WCS/AutoAstrometry as shown. Also double check the scale. Entering 0.786, again as reported to us by Image Link.

 

NOTE:  You must make the following changes to the Image Link Information text!  Remove Dec:, change +37° to 37d, 48' to 48m and lastly 52" to 52s or the astrometry will fail. The proper format is shown below.

Properly formatted coordinates

From Image Link for use with the Astrometry

Warning enter the scale as shown above!  Entering just a 0.7 will not work since the scale is more like 0.8 arcseconds/pixel. Again if you are not sure of the scale try to use Image Link first to find it for you.

Astrometry for the image using stars from the UCAC2

Results may vary read on!

Residual Filter

By changing the residual filter (see CCDSoft help file for complete details) you will get different astrometric solutions. The smaller the number used for the filter the better the astrometry. However, if you have too few stars in the field choosing a very small residual filter will not yield enough stars to perform accurate astrometry. Shooting for 12+ stars in the solution is a good number. By changing the residual filter to a very low number in this case 0.13 for example this will yield an RMS solution of 0.06 arcseconds RMS using 9 stars.

The Residual Filter

Setup located on the above Astrometry dialog

The change will take effect immediately. The astrometry is not performed again.

Using a residual filter of 0.13 yields the following result
0.06 arcseconds RMS with 9 stars


Note the RMS solution and total number of stars used

Source Extraction Setup Parameters

Use Research | Analyze Folder of Images | Pre-Analyze to access the "Data Analysis" dialog shown below.

Data Analysis | Source Extraction Setup!

Choose Source Extraction Setup highlighted

Default settings

Defaults settings not always ideal!

The Source Extraction routines are extremely flexible but with this power and flexibility comes user responsibility. Keep in mind that most of the parameters are not necessarily intuitive and should not be changed without a good reason. Again, please refer to Source Extraction for Dummies for complete in-depth details on how to use the routines effectively!  Because there are so many options playing musical parameters is simply not going to work and will most likely cause poor image analysis. Also, generally I don't make changes to any more than one setup parameter at a time noting the effect the change has. See below.

Show Inventory

A very nice feature of CCDSoft is the ability to show you the effect the Source Extraction Setup changes have on the image analysis. Use Research | Show Inventory to create a graphic representation of the .SRC inventory text file created by using SExtractor.

 

In order to re-do the Source Extraction on the image you will have to perform a Show Inventory again on the image after making any changes. Again, Research | Show Inventory will toggle this on and off refreshing the image employing the change. The changes made will also effect the astrometry in most cases!  So yes the astrometry will need to be performed on the image again as well. Why? See below examples.

 

When using the default SEXtractor parameters here is the following inventory created for the image. Note the number of stars being identified in the image along with their respective sizes.

Research | Show Inventory using defaults

Yellow markers are stars used for Astrometry!

To plot the yellow markers identifying the stars found in TheSky's stellar data use Research | Show Astrometric Stars. By altering the Residual Filter as described above you will also see the change indicated by more or less yellow markers showing the stars being used for the astrometry. Very handy indeed!

 

Now alter the default Source Extraction parameter "Detection threshold (1.0 - 2.0)" and use a value of 25 instead of the 1.25 (default). A single change can have huge ramifications!

Huge difference in stars found!

A single SExtractor Setup change to the detection threshold!

Consider what happens if you use a Detection threshold of 0.11!  See Below.

Whoops! Not good

Too low to use

Often times it is best to just re-set to the default settings first then try again. The settings to use are dependent on the image and what you are trying to accomplish. Again, If you wish to further research this software, visit the SExtractor Home Page, and read "SExtractor for Dummies, Everything You Wanted to Know About Source Extractor and I was Forced to Find Out" (98 pages) by Benne W. Holwerda of the Space Telescope Science Institute.

Sample .SRC text created by SEXtractor

Here is a partial sample of the .SRC file created by the Sextractor routines. The data below is used to plot the above graphics directly on the CCD image. The .SRC text files are located in the folder where the image was loaded.  They can be used anyway you see FIT, i.e. graphing the date say in Microsoft Excel for example.
 

#HEIGHT=   255
#WIDTH =   382
#TIME  =  5.223772
#       #
#   1 X_IMAGE         Object position along x                         [pixel]
#   2 Y_IMAGE         Object position along y                         [pixel]
#   3 MAG_APER        Fixed aperture magnitude vector                 [mag]
#   4 FWHM_IMAGE      FWHM assuming a gaussian core                   [pixel]
#   5 FLAGS           Extraction flags
#   6 CLASS_STAR      S/G classifier output
#   7 ELONGATION      A_IMAGE/B_IMAGE
#   8 ELLIPTICITY     1 - B_IMAGE/A_IMAGE
#   9 A_IMAGE         Profile RMS along major axis                    [pixel]
#  10 B_IMAGE         Profile RMS along minor axis                    [pixel]
#  11 THETA_IMAGE     Position angle (CCW/x)                          [deg]
   246.629     62.375   1.0308    21.08 002  0.03    3.574    0.720     6.64     1.86  84.0
   206.027     41.620   1.2775    19.94 002  0.03    2.826    0.646     5.59     1.98 -46.6
   223.499     57.366   1.2730    26.38 002  0.03    1.171    0.146     6.73     5.75  57.1
   225.689     36.192  -4.4064     2.63 006  0.84    1.182    0.154     2.66     2.25  38.0
   112.770     12.957   1.6145     7.59 002  0.02    1.885    0.469     2.57     1.37  53.0
    96.510     12.282   1.3214    19.79 002  0.02    3.149    0.682     5.85     1.86  25.1
   104.733     33.304   0.3026     7.52 002  0.03    1.860    0.462     3.95     2.12 -87.8

and so on...

Cursor Information - View | Cursor Information

Another handy feature found in CCDSoft is View | Cursor Information. After performing the astrometry on an image and the Source Extraction routines have been applied additional information can be found for any object in the image.

Handy tool View | Cursor Information

How to get even more information from an image

The yellow markers are the stars used in the astrometric solution - Research | Show Inventory, the blue circle markers the last two mouse clicks on the image. Note the information provided in the Cursor Information dialog, Click 1, Click 2, distance between clicks, position angle (great for SN reporting), the scale of the image, FWHM, centroid, and so on.

Known objects in the field

Now that the image can be placed directly in TheSky the known objects in the field can be identified by simply labeling the objects. That is the known stars and variable stars from TheSky can be labeled. For additional datasets a query using the Simbad on-line astronomical database can also be plotted as an SDB file too, allowing searching and identifying additional objects in the field. Details on using the Simbad data with TheSky can be found here. This comes in handy at times.

The known objects identified in the field

Along with the results from the
Simbad query plotted

Minor Planets and SEXtractor

At one point in time I had to make another change to the SEXtractor paraamers before I could get it to work with CCDSoft's automated minor planet detection routines. In that case the minor planet had not moved appreciably in the sequence of exposures (not enough time between them) so the setting Minimum Movement in pixels was changed from the default value of 3 to 1 and like magic the minor planet was then detected.

 

Warning!  Again, when making changes to the default SEXtractor settings needed to accommodate different imaging conditions you may have to put them back to the default values later on. Keep this in mind. Speaking from experience here ;).

 

For an example of automated minor planet detection and reduction <-- in the form of a light curve click here for details.