Examples for LIFE TAP examples

Filter objects by type

In LIFE, we have a single table for all kinds of objects (planets, stars, disks, multi-star systems). They are kept in life_td.object:

SELECT TOP 10 object_id, main_id FROM life_td.object
WHERE type='st'

All children of an object

Objects in LIFE are in a hierarchy (e.g., a planet belongs to a star). The parent/child relationships are given in the life_td.h_link table which you can join to all other tables that have an object_idref column. For instance, to find (direct) children of a star, you would run:

SELECT main_id as Child_main_id, object_id as child_object_id
FROM life_td.h_link
JOIN life_td.ident as p on p.object_idref=parent_object_idref
JOIN life_td.object on object_id=child_object_idref
WHERE p.id = '* alf Cen'

All parents of an object

Objects in LIFE are in a hierarchy (e.g., a planet belongs to a star). The parent/child relationships are given in the life_td.h_link table which you can join to all other tables that have an object_idref column. For instance, to find (direct) parents of a star, you would run:

SELECT main_id as parent_main_id, object_id as parent_object_id
FROM life_td.h_link
JOIN life_td.ident as c on c.object_idref=child_object_idref
JOIN life_td.object on object_id=parent_object_idref
WHERE c.id =  '* alf Cen A'

All specific measurements of an object

In LIFE, we have individual tables for all kinds of parameters where multiple measurements for the same object are available. They are kept in the tables starting with mes_ e.g. life_td.mes_teff_st:

SELECT *
FROM life_td.mes_teff_st
JOIN life_td.ident USING(object_idref)
WHERE id = '* alf Cen A'

All basic stellar data from an object name

In LIFE we keep for each object the best measurements of its kind in the basic data table corresponding to the object type. For instance, to find the best measurements for the star '* alf Cen' you would run:

SELECT  *
FROM life_td.star_basic
JOIN life_td.ident USING(object_idref)
WHERE id = '* alf Cen'

All basic disk data from host name

In LIFE we keep for each object the best measurements of its kind in the basic data table corresponding to the object type. For instance, to find the best measurements for the disk around the star '* bet Cas' you would run:

SELECT main_id disk_main_id, object_id as disk_object_id, db.*
FROM life_td.h_link
JOIN life_td.disk_basic as db ON
 db.object_idref=child_object_idref
JOIN life_td.ident as p on p.object_idref=parent_object_idref
JOIN life_td.object on object_id=child_object_idref
WHERE p.id = '* bet Cas' and type='di'

Missing reliable measurements

In LIFE we keep information about the quality of a measurement. This can serve as motivation for future observations to fill in knowledge gaps. For instance, to find where reliable measurements for the parallax are missing you would run:

SELECT star_ob.main_id as star_name, plx_value, plx_err,
plx_qual, plx_source_idref
FROM life_td.star_basic as s
JOIN life_td.object as star_ob on
(s.object_idref=star_ob.object_id)
WHERE plx_value is Null or plx_qual in ('D','E') or
plx_qual is Null

LIFE-StarCat candidates

The input catalog for the LIFE yield estimations (LIFE-StarCat) is created using the following query in addition to some postprocessing in regards of multiplicity afterwards.

SELECT o.main_id, sb.coo_ra, sb.coo_dec, sb.plx_value,
 sb.dist_st_value, sb.sptype_string, sb.coo_gal_l,
 sb.coo_gal_b, sb.teff_st_value, sb.mass_st_value,
 sb.radius_st_value, sb.binary_flag, sb.mag_i_value,
 sb.mag_j_value,  sb.class_lum, sb.class_temp,
 o_parent.main_id AS parent_main_id,
 sb_parent.sep_ang_value
FROM life_td.star_basic AS sb
JOIN life_td.object AS o ON sb.object_idref=o.object_id
LEFT JOIN life_td.h_link AS h ON
 o.object_id=h.child_object_idref
LEFT JOIN life_td.object AS o_parent ON
 h.parent_object_idref=o_parent.object_id
LEFT JOIN life_td.star_basic AS sb_parent ON
 o_parent.object_id=sb_parent.object_idref
WHERE o.type = 'st' AND sb.dist_st_value < 30.