LIFE Target Database Access¶
Introduction¶
To access the data from the LIFE database you can either use the graphical user interface TOPCAT https://www.star.bris.ac.uk/~mbt/topcat/ or do it in a python environment.
TOPCAT¶
Install TOPCAT. Lunch TOPCAT. Click the “VO” button on the top header. Click on “Table Access Protocol (TAP) Query”. In the newly opened window choose from the dropdown menue of “All TAP services” the “GAVO DC TAP” one.
Python¶
We’ll use the virtual observatory tool PyVO to query the database.
[1]:
import pyvo as vo
Feel free to adapt the adql_query variable to your liking. If you are unsure of what else you could query have a look at the provided examples http://dc.zah.uni-heidelberg.de/life/q/ex/examples
[2]:
adql_query = """
SELECT TOP 10 object_id, main_id FROM life_td.object
WHERE type='st'"""
[3]:
link = "http://dc.zah.uni-heidelberg.de/tap"
# alternative link if above does not work
# link = "http://dc.g-vo.org/tap"
[4]:
service = vo.dal.TAPService(link)
[5]:
result = service.run_async(adql_query.format(**locals()), maxrec=160000)
[6]:
catalog = result.to_table()
[7]:
print(catalog)
object_id main_id
--------- -----------
1 * 1 Hya
2 * 1 Hya B
3 * 1 Hya C
4 * 3 Cyg
6 * 5 Pup
7 * 5 Ser
8 * 5 Ser B
9 * 6 And
10 * 6 Cet
11 * 7 And