make_SEP_catalog¶
- grizli.prep.make_SEP_catalog(root='', sci=None, wht=None, threshold=2.0, get_background=True, bkg_only=False, bkg_params={'bh': 32, 'bw': 32, 'fh': 3, 'fw': 3}, verbose=True, phot_apertures='6, 8.33335, 11.66667, 16.66667, 20, 25, 50', aper_segmask=False, rescale_weight=True, err_scale=-inf, use_bkg_err=False, column_case=<method 'upper' of 'str' objects>, save_to_fits=True, include_wcs_extension=True, source_xy=None, compute_auto_quantities=True, autoparams=[2.5, <Quantity 0.35 arcsec>, 2.4, 3.8], flux_radii=[0.2, 0.5, 0.9], subpix=0, mask_kron=False, max_total_corr=2, detection_params={'clean': True, 'clean_param': 1, 'deblend_cont': 0.001, 'deblend_nthresh': 32, 'filter_kernel': array([[0.0049, 0.0213, 0.0513, 0.0687, 0.0513, 0.0213, 0.0049], [0.0213, 0.0921, 0.2211, 0.296 , 0.2211, 0.0921, 0.0213], [0.0513, 0.2211, 0.5307, 0.7105, 0.5307, 0.2211, 0.0513], [0.0687, 0.296 , 0.7105, 0.9511, 0.7105, 0.296 , 0.0687], [0.0513, 0.2211, 0.5307, 0.7105, 0.5307, 0.2211, 0.0513], [0.0213, 0.0921, 0.2211, 0.296 , 0.2211, 0.0921, 0.0213], [0.0049, 0.0213, 0.0513, 0.0687, 0.0513, 0.0213, 0.0049]]), 'filter_type': 'conv', 'minarea': 9}, bkg_mask=None, pixel_scale=0.06, log=False, gain=2000.0, extract_pixstack=30000000, sub_object_limit=4096, exposure_footprints=None, **kwargs)[source]¶
Make a catalog from drizzle products using the SEP implementation of SourceExtractor
- Parameters
- rootstr
Rootname of the FITS images to use for source extraction. This function is designed to work with the single-image products from
drizzlepac
, so the default data/science image is searched by>>> drz_file = glob.glob(f'{root}_dr[zc]_sci.fits*')[0]
Note that this will find and use gzipped versions of the images, if necessary.
The associated weight image filename is then assumed to be
>>> weight_file = drz_file.replace('_sci.fits', '_wht.fits') >>> weight_file = weight_file.replace('_drz.fits', '_wht.fits')
- sci, whtstr
Filenames to override
drz_file
andweight_file
derived from theroot
parameter.- thresholdfloat
Detection threshold for
sep.extract
- get_backgroundbool
Compute the background with
sep.Background
- bkg_onlybool
If
True
, then just return the background data array and don’t run the source detection- bkg_paramsdict
Keyword arguments for
sep.Background
. Note that this can include a separate optional keywordpixel_scale
that indicates that the background sizesbw
,bh
are set for a paraticular pixel size. They will be scaled to the pixel dimensions of the target images using the pixel scale derived from the image WCS.- verbosebool
Print status messages
- phot_aperturesstr or array-like
Photometric aperture diameters. If given as a string then assume units of pixels. If an array or list, can have units, e.g.,
astropy.units.arcsec
.- aper_segmaskbool
If true, then run SEP photometry with segmentation masking. This requires the sep fork at https://github.com/gbrammer/sep.git, or
sep >= 1.10.0
.- rescale_weightbool
If true, then a scale factor is calculated from the ratio of the weight image to the variance estimated by
sep.Background
.- err_scalefloat
Explicit value to use for the weight scaling, rather than calculating with
rescale_weight
. Only used iferr_scale > 0
- use_bkg_errbool
If true, then use the full error array derived by
sep.Background
. This is turned off by default in order to preserve the pixel-to-pixel variation in the drizzled weight maps.- column_casefunc
Function to apply to the catalog column names. E.g., the default
str.upper
results in uppercase column names- save_to_fitsbool
Save catalog FITS file
{root}.cat.fits
- include_wcs_extensionbool
An extension will be added to the FITS catalog with the detection image WCS
- source_xy(x, y) or (ra, dec) arrays
Force extraction positions. If the arrays have units, then pass them through the header WCS. If no units, positions are zero indexed array coordinates.
To run with segmentation masking (
1sep > 1.10`
), also provideaseg
andaseg_id
arrays withsource_xy
, like>>> source_xy = ra, dec, aseg, aseg_id
- compute_auto_quantitiesbool
Compute Kron/auto-like quantities with
compute_SEP_auto_params
- autoparamslist
Parameters of Kron/AUTO calculations with
compute_SEP_auto_params
.- flux_radiilist
Light fraction radii to compute with
compute_SEP_auto_params
, e.g.,[0.5]
will calculate the half-light radius (FLUX_RADIUS
)- subpixint
Pixel oversampling
- mask_kronbool
Not used
- max_total_corrfloat
Not used
- detection_paramsdict
Parameters passed to
sep.extract
- bkg_maskarray
Additional mask to apply to
sep.Background
calculation- pixel_scalefloat
Not used
- logbool
Send log message to
grizli.utils.LOGFILE
- gainfloat
Gain value passed to
sep.sum_circle
- extract_pixstackint
See
sep.set_extract_pixstack
- sub_object_limitint
See
sep.set_sub_object_limit
- exposure_footprintslist, None
An optional list of objects that can be parsed with
sregion.SRegion
. If specified, add a columnnexp
to the catalog corresponding to the number of entries in the list that overlap with a particular source position
- Returns
- tab
Table
Source catalog
- tab