Examples for Gaia EB Classification TAP Examples

Compare OGLE and UPJŠ EB classifications. Simple match

Match the ogle.objects_all table with upjs_gaia_eb.classification by coordinates and compare the types assigned to the common eclipsing binaries by both sources. Here we perform a simple coordinate match, ignoring proper motion.

Why do we choose 0.5 arcsec? Try increasing the matching radius, retrieve a larger sample, and plot a histogram of sep in TOPCAT. The histogram shows a peak at small separations produced by genuine matches. Beyond the peak, the contribution of true matches decreases, while the contribution of false matches increases with radius. We see a local minimum around 0.5 arcsec and choose it as a reasonable compromise between copleteness and contamination.

Note that we use the new unit conversion operator @{arcsec} on the distance function. This not only automatically transforms degrees to arcseconds but also explicitly embeds the correct unit metadata into the resulting table.

SELECT TOP 1000 object_id, main_class, spot_class, ogle_vartype, subtype, ssa_targclass,
  DISTANCE(o.raj2000, o.dej2000, g.ra, g.dec)@{arcsec} AS sep
FROM ogle.objects_all o
JOIN upjs_gaia_eb.classification g
  ON DISTANCE(o.raj2000, o.dej2000, g.ra, g.dec) < 0.5/3600

Compare OGLE and UPJŠ EB classifications. Match with sky position propagation

Match the ogle.objects_all table with upjs_gaia_eb.classification by coordinates, taking into account the 16-year epoch difference between the Gaia DR3 and OGLE equatorial coordinates.

Many TAP services provide coordinate propagation through the ivo_epoch_prop_pos UDF. However, here, we should perform the propagation explicitly in the query.

Note that matching large tables using calculated coordinates instead of indexed values is generally inefficient. Therefore, we first apply a rough spatial pre-filter using indexed coordinates and only then perform the match on the preselected subset.

If you need the complete result set, remove TOP 1000 and increase the MAXREC (MAX ROWS in TOPCAT) value. The input Gaia table contain slightly more than two million rows.

 SELECT TOP 1000
   res.object_id, res.main_class, res.spot_class, res.ogle_vartype,
   res.subtype, res.ssa_targclass, res.sep_j2000
 FROM (
   SELECT
     o.object_id, o.raj2000, o.dej2000, o.ogle_vartype, o.subtype,
     o.ssa_targclass, gc.main_class, gc.spot_class,
     gs.ra AS gaia_ra_2016, gs.dec AS gaia_dec_2016, gs.pmra, gs.pmdec,
     DISTANCE(         --  propagate Gaia positions to 2000.0
       o.raj2000, o.dej2000,
       -- Mention there gc to force planner filter tables first:
       gc.ra + ((COALESCE(gs.pmra@{deg/yr}, 0.0)) * -16.0) / COS(gc.dec@{rad}),
       -- Use these additional brackets around COALESCE in the expression
       gc.dec + ((COALESCE(gs.pmdec@{deg/yr}, 0.0)) * -16.0)
     )@{arcsec} AS sep_j2000
   FROM ogle.objects_all AS o
   JOIN upjs_gaia_eb.classification AS gc
     ON
       -- Rough spatial pre-filter using indexed J2016 coordinates
       DISTANCE(o.raj2000, o.dej2000, gc.ra, gc.dec) < 10.0 / 3600.0
   JOIN gaiadr3_eb.gaia_source_lite_eb AS gs
     ON gc.source_id = gs.source_id
) AS res
 WHERE res.sep_j2000 < 0.5