Objects Detections

Everything related to objects detection is documented bellow:

hostphot.objects_detect.cross_match(objects, img_wcs, coord, dist_thresh=1.0)

Cross-matches objects with a given set of coordinates. Those with a distance of less than dist_thresh are selected.

Parameters:
  • objects (array) – Objects detected with sep.extract().

  • img_wcs (WCS) – WCS of the image from which the objects were extracted.

  • coord (SkyCoord object) – Coordinates for the cross-match.

  • dist_thresh (float, default 1.0) – Distance in arcsec to crossmatch the objects with the given coordinates.

hostphot.objects_detect.extract_objects(data, bkg, host_ra, host_dec, threshold, img_wcs, dist_thresh=-1, deblend_cont=0.005)

Extracts objects and their ellipse parameters. The function sep.extract() is used.

If there is no detected object within a distance of dist_thresh from the galaxy coordinates, it means that the galaxy was not correctly identified.

Parameters:
  • data (ndarray) – Image data.

  • bkg (2D array) – Background level of the image.

  • host_ra (float) – Host-galaxy Right ascension of the galaxy in degrees.

  • host_dec (float) – Host-galaxy Declination of the galaxy in degrees.

  • threshold (float) – Source with flux above threshold*bkg_rms are extracted. See sep.extract() for more information.

  • img_wcs (WCS) – Image’s WCS.

  • pixel_scale (float) – Pixel scale, in units of arcsec/pixel, used to convert from pixel units to arcseconds.

  • dist_thresh (float, default -1.) – Distance in arcsec to crossmatch the galaxy coordinates with a detected object, where the object nearest to the galaxy position is considered as the galaxy (within the given threshold). If no objects are found within the given distance threshold, the galaxy is considered as not found and a warning is printed. If a non-positive value is given, the threshold is considered as infinite, i.e. the closest detected object is considered as the galaxy (default option).

  • deblend_cont (float, default 0.005) – Minimum contrast ratio used for object deblending. Default is 0.005. To entirely disable deblending, set to 1.0.

Returns:

  • gal_obj (numpy array) – Galaxy object extracted.

  • nogal_objs (numpy array) – All objects extracted except for the galaxy.

hostphot.objects_detect.find_catalog_objects(ra, dec, rad=0.15)

Finds objects using the TESS image cutouts (Tic) catalog for the given coordinates in a given radius.

Note: this catalog includes objects from these sources:

HIP, TYC, UCAC, TWOMASS, SDSS, ALLWISE, GAIA, APASS, KIC

Parameters:
  • ra (float) – Right ascension in degrees.

  • dec (float) – Declination in degrees.

  • rad (float, default 0.15) – Search radius in degrees.

Returns:

cat_coord – Coordinates of the objects found.

Return type:

SkyCoord object

hostphot.objects_detect.find_gaia_objects(ra, dec, rad=0.15)

Finds objects using the Gaia DR3 catalog for the given coordinates in a given radius.

Parameters:
  • ra (float) – Right ascension in degrees.

  • dec (float) – Declination in degrees.

  • rad (float, default 0.15) – Search radius in degrees.

Returns:

gaia_coord – Coordinates of the objects found.

Return type:

SkyCoord object

hostphot.objects_detect.plot_detected_objects(hdu, objects, scale, ra=None, dec=None, host_ra=None, host_dec=None, title=None, outfile=None)

Plots the objects extracted with sep.extract()`().

Parameters:
  • hdu (fits) – Header Data Unit.

  • objects (array) – Objects detected with sep.extract().

  • scale (float) – Scale of the ellipse’s semi-mayor and semi-minor axes.

  • img_wcs (WCS) – Image’s WCS.

  • ra (float, default None) – Right ascension of an object, in degrees. Used for plotting the position of the object.

  • dec (float, default None) – Declination of an object, in degrees. Used for plotting the position of the object.

  • host_ra (float, default None) – Right ascension of a galaxy.

  • host_dec (float, default None) – Declination of a galaxy.

  • title (str, default None) – Title of the image.

  • outfile (str, default None) – If given, path where to save the output figure.