<p>I'm going to work up the config file from the bottom and suggest settings that need to be changed generally and then finish up with discussing <code>DETECT_THRESH</code> as that depends on what you're trying to do. First off, you should bear in mind that SExtractor was designed for optical CCD data from the ground through a blurring atmosphere (and that's where I'm familiar with it) and so JWST NIR data from space will be different.</p>
<p>First off, you will want to set <code>SEEING_FWHM</code> to something more appropriate for NIR space data. [This page] discuss the JWST NIRCam Point Spread Function (PSF) and Table 1 has expected FWHMs for the different filters; for the SMACS0723 data I looked at (<a href="https://mast.stsci.edu/portal/Mashup/Clients/Mast/Portal.html?searchQuery=%7B%22service%22:%22DOIOBS%22,%22inputText%22:%2210.17909/rwdx-k029%22%7D" rel="nofollow noreferrer">MAST query results</a>) and the F150W filter I downloaded, the FWHM value from Table 1 was 0.050 arcsec so this should go in <code>SEEING_FWHM</code>; adjust for the filter of your data as this is much more wavelength dependent than it will be from the ground. Note that the <code>SEEING_FWHM</code> is only used for the star/galaxy separation - things that look round to the size of the <code>SEEING_FWHM</code> are more likely to be classified as stars, extended objects that are larger than <code>SEEING_FWHM</code> and which are more elongated are more likely to be classified as a galaxy (it's a 0 (star) ... 1.0 (galaxy) scale). If you don't care about this, then this value isn't critical.</p>
<p>Next, <code>PIXEL_SCALE</code> should be set to <code>0</code> so it will read the WCS from the FITS header; the JWST instruments have complex and variable orientation and distortions and you're much better off having SExtractor figure this out itself. Now <code>GAIN</code>: this should be set to <code>1.0</code> as calibrated JWST data are in surface brightness units of MegaJanskys/steradian (MJy/sr as indicated by <code>BUNIT1</code> in the FITS header) and not the counts, electrons or ADUs from CCDs that <code>GAIN</code> applies to. More information on the units and how to convert from MJy/sr to AB or Vega magnitudes is given <a href="https://jwst-docs.stsci.edu/jwst-near-infrared-camera/nircam-performance/nircam-absolute-flux-calibration-and-zeropoints#gsc.tab=0" rel="nofollow noreferrer">here</a>.</p>
<p>Finally, the actual source detection part... SExtractor works by running a filter (given by <code>FILTER_NAME</code>) over the image after a background mesh has been fitted looking for cluster of pixels that are larger than <code>DETECT_MINAREA</code> pixels and which are <code>DETECT_THRESH</code> times greater than the standard deviation of the &quot;sky&quot; in the fitted background mesh. For ground-based data, where the PSF is blurred to a near-Gaussian by the atmosphere, this filter makes sense. Given the multi-segment mirror and 6 spider spikes of the JWST PSF, this sort of Gaussian filter may not make sense (you can substitute different filters (see the SExtractor documentation) so a more WebbPSF-like may work better).
The detection parameters of <code>DETECT_MINAREA</code> and <code>DETECT_THRESH</code> (<em>always</em> set <code>ANALYSIS_THRESH</code> to the same value as <code>DETECT_THRESH</code> otherwise Bad Things will happen) need to be tweaked and adjusted, SExtractor run and then the results overplotted over the image to get a good tradeoff between picking up the things you want and are interested in and junk/artifacts from the image. Since every dataset and science case is different, these will need to be experimented with and adjusted for the particular case - there is no &quot;magic set&quot; of parameters that will work for all data and science.</p>

CC BY-SA 4.0
2024-06-25T19:14:29.600Z
Yes, the linked dataset shows 6 filters (not sure if it's the same dataset as you are looking at). I've never used the dual image mode but could imagine if you had a deeper image (or stacked multiple exposures) then that could be used as the detection image. In this case, it's going to depend on the science case; for high-z galaxies which don't appear in the bluer bands like F090W/F150W I could imagine you would want to do forced measurements at that position based on the detection in a redder band rather than merging the 6 individual detection catalogs in code. No great insights I'm afraid
astrosnapper
CC BY-SA 4.0
2024-06-21T01:43:07.293Z
2024-06-21T01:43:07.293Z
astrosnapper
<p>I am new to this tool for catalogue creation(SExtractor). I want to know about how to set parameters for the extraction for JWST data.</p>
<p>The parameter file looks like this.</p>
<pre><code>#-------------------------------- Catalog ------------------------------------
 
CATALOG_NAME     SMACS0723_jwst.cat       # name of the output catalog
CATALOG_TYPE     ASCII_HEAD     # NONE,ASCII,ASCII_HEAD, ASCII_SKYCAT,
                                # ASCII_VOTABLE, FITS_1.0 or FITS_LDAC
PARAMETERS_NAME  default.param  # name of the file containing catalog contents
 
#------------------------------- Extraction ----------------------------------
 
DETECT_TYPE      CCD            # CCD (linear) or PHOTO (with gamma correction)
DETECT_MINAREA   5              # min. # of pixels above threshold
DETECT_THRESH    1.5            # &lt;sigmas&gt; or &lt;threshold&gt;,&lt;ZP&gt; in mag.arcsec-2
ANALYSIS_THRESH  1.5            # &lt;sigmas&gt; or &lt;threshold&gt;,&lt;ZP&gt; in mag.arcsec-2
 
FILTER           N              # apply filter for detection (Y or N)?
FILTER_NAME      default.conv   # name of the file containing the filter
 
DEBLEND_NTHRESH  32             # Number of deblending sub-thresholds
DEBLEND_MINCONT  0.005          # Minimum contrast parameter for deblending
 
CLEAN            Y              # Clean spurious detections? (Y or N)?
CLEAN_PARAM      1.0            # Cleaning efficiency
 
MASK_TYPE        CORRECT        # type of detection MASKing: can be one of
                                # NONE, BLANK or CORRECT
 
#------------------------------ Photometry -----------------------------------
 
PHOT_APERTURES   5              # MAG_APER aperture diameter(s) in pixels
PHOT_AUTOPARAMS  2.5, 3.5       # MAG_AUTO parameters: &lt;Kron_fact&gt;,&lt;min_radius&gt;
PHOT_PETROPARAMS 2.0, 3.5       # MAG_PETRO parameters: &lt;Petrosian_fact&gt;,
                                # &lt;min_radius&gt;
 
SATUR_LEVEL      50000.0        # level (in ADUs) at which arises saturation
SATUR_KEY        SATURATE       # keyword for saturation level (in ADUs)
 
MAG_ZEROPOINT    0.0            # magnitude zero-point
MAG_GAMMA        4.0            # gamma of emulsion (for photographic scans)
GAIN             0.0            # detector gain in e-/ADU
GAIN_KEY         GAIN           # keyword for detector gain in e-/ADU
PIXEL_SCALE      1.0            # size of pixel in arcsec (0=use FITS WCS info)
 
#------------------------- Star/Galaxy Separation ----------------------------
 
SEEING_FWHM      1.2            # stellar FWHM in arcsec
STARNNW_NAME     default.nnw    # Neural-Network_Weight table filename
</code></pre>
<p>I want to know how could i get these extraction values, specifically DETECT_THRESH and GAIN.
Also suggest me some platforms where I could get interact with peers working on JWST.</p>

<observational-astronomy><galaxy><james-webb-space-telescope>
Using SExtractor for JWST data
Walker
# Using SExtractor for JWST data

(Asked by: username_0 on 2024-06-20)

I am new to this tool for catalogue creation(SExtractor). I want to know about how to set parameters for the extraction for JWST data.
The parameter file looks like this.
#-------------------------------- Catalog ------------------------------------
 
CATALOG_NAME     SMACS0723_jwst.cat       # name of the output catalog
CATALOG_TYPE     ASCII_HEAD     # NONE,ASCII,ASCII_HEAD, ASCII_SKYCAT,
                                # ASCII_VOTABLE, FITS_1.0 or FITS_LDAC
PARAMETERS_NAME  default.param  # name of the file containing catalog contents
 
#------------------------------- Extraction ----------------------------------
 
DETECT_TYPE      CCD            # CCD (linear) or PHOTO (with gamma correction)
DETECT_MINAREA   5              # min. # of pixels above threshold
DETECT_THRESH    1.5            #  or , in mag.arcsec-2
ANALYSIS_THRESH  1.5            #  or , in mag.arcsec-2
 
FILTER           N              # apply filter for detection (Y or N)?
FILTER_NAME      default.conv   # name of the file containing the filter
 
DEBLEND_NTHRESH  32             # Number of deblending sub-thresholds
DEBLEND_MINCONT  0.005          # Minimum contrast parameter for deblending
 
CLEAN            Y              # Clean spurious detections? (Y or N)?
CLEAN_PARAM      1.0            # Cleaning efficiency
 
MASK_TYPE        CORRECT        # type of detection MASKing: can be one of
                                # NONE, BLANK or CORRECT
 
#------------------------------ Photometry -----------------------------------
 
PHOT_APERTURES   5              # MAG_APER aperture diameter(s) in pixels
PHOT_AUTOPARAMS  2.5, 3.5       # MAG_AUTO parameters: ,
PHOT_PETROPARAMS 2.0, 3.5       # MAG_PETRO parameters: ,
                                # 
 
SATUR_LEVEL      50000.0        # level (in ADUs) at which arises saturation
SATUR_KEY        SATURATE       # keyword for saturation level (in ADUs)
 
MAG_ZEROPOINT    0.0            # magnitude zero-point
MAG_GAMMA        4.0            # gamma of emulsion (for photographic scans)
GAIN             0.0            # detector gain in e-/ADU
GAIN_KEY         GAIN           # keyword for detector gain in e-/ADU
PIXEL_SCALE      1.0            # size of pixel in arcsec (0=use FITS WCS info)
 
#------------------------- Star/Galaxy Separation ----------------------------
 
SEEING_FWHM      1.2            # stellar FWHM in arcsec
STARNNW_NAME     default.nnw    # Neural-Network_Weight table filename

I want to know how could i get these extraction values, specifically DETECT_THRESH and GAIN.
Also suggest me some platforms where I could get interact with peers working on JWST.

**Tags:** observational-astronomy, galaxy, james-webb-space-telescope

---

## 1 answers

### Answer by username_1 on 2024-06-21. Score: 2

I'm going to work up the config file from the bottom and suggest settings that need to be changed generally and then finish up with discussing `DETECT_THRESH` as that depends on what you're trying to do. First off, you should bear in mind that SExtractor was designed for optical CCD data from the ground through a blurring atmosphere (and that's where I'm familiar with it) and so JWST NIR data from space will be different.

First off, you will want to set `SEEING_FWHM` to something more appropriate for NIR space data. [This page] discuss the JWST NIRCam Point Spread Function (PSF) and Table 1 has expected FWHMs for the different filters; for the SMACS0723 data I looked at ([MAST query results](https://mast.stsci.edu/portal/Mashup/Clients/Mast/Portal.html?searchQuery=%7B%22service%22:%22DOIOBS%22,%22inputText%22:%2210.17909/rwdx-k029%22%7D)) and the F150W filter I downloaded, the FWHM value from Table 1 was 0.050 arcsec so this should go in `SEEING_FWHM`; adjust for the filter of your data as this is much more wavelength dependent than it will be from the ground. Note that the `SEEING_FWHM` is only used for the star/galaxy separation - things that look round to the size of the `SEEING_FWHM` are more likely to be classified as stars, extended objects that are larger than `SEEING_FWHM` and which are more elongated are more likely to be classified as a galaxy (it's a 0 (star) ... 1.0 (galaxy) scale). If you don't care about this, then this value isn't critical.

Next, `PIXEL_SCALE` should be set to `0` so it will read the WCS from the FITS header; the JWST instruments have complex and variable orientation and distortions and you're much better off having SExtractor figure this out itself. Now `GAIN`: this should be set to `1.0` as calibrated JWST data are in surface brightness units of MegaJanskys/steradian (MJy/sr as indicated by `BUNIT1` in the FITS header) and not the counts, electrons or ADUs from CCDs that `GAIN` applies to. More information on the units and how to convert from MJy/sr to AB or Vega magnitudes is given [here](https://jwst-docs.stsci.edu/jwst-near-infrared-camera/nircam-performance/nircam-absolute-flux-calibration-and-zeropoints#gsc.tab=0).

Finally, the actual source detection part... SExtractor works by running a filter (given by `FILTER_NAME`) over the image after a background mesh has been fitted looking for cluster of pixels that are larger than `DETECT_MINAREA` pixels and which are `DETECT_THRESH` times greater than the standard deviation of the "sky" in the fitted background mesh. For ground-based data, where the PSF is blurred to a near-Gaussian by the atmosphere, this filter makes sense. Given the multi-segment mirror and 6 spider spikes of the JWST PSF, this sort of Gaussian filter may not make sense (you can substitute different filters (see the SExtractor documentation) so a more WebbPSF-like may work better).
The detection parameters of `DETECT_MINAREA` and `DETECT_THRESH` (*always* set `ANALYSIS_THRESH` to the same value as `DETECT_THRESH` otherwise Bad Things will happen) need to be tweaked and adjusted, SExtractor run and then the results overplotted over the image to get a good tradeoff between picking up the things you want and are interested in and junk/artifacts from the image. Since every dataset and science case is different, these will need to be experimented with and adjusted for the particular case - there is no "magic set" of parameters that will work for all data and science.

> **Comments:**
> **username_1**: Yes, the linked dataset shows 6 filters (not sure if it's the same dataset as you are looking at). I've never used the dual image mode but could imagine if you had a deeper image (or stacked multiple exposures) then that could be used as the detection image. In this case, it's going to depend on the science case; for high-z galaxies which don't appear in the bluer bands like F090W/F150W I could imagine you would want to do forced measurements at that position based on the detection in a redder band rather than merging the 6 individual detection catalogs in code. No great insights I'm afraid  

---

