-
Notifications
You must be signed in to change notification settings - Fork 0
/
example3.py
40 lines (29 loc) · 857 Bytes
/
example3.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#! /usr/bin/ python
# -*- coding=utf-8 -*-
from astropy.table import Table
import pyvo
import sys
import warnings
if not sys.warnoptions:
warnings.simplefilter("ignore")
query="""
SELECT
TOP 50
*
FROM ivoa.obscore AS db
JOIN TAP_UPLOAD.lt AS mine
ON 1=CONTAINS (POINT('ICRS', db.s_ra, db.s_dec),
CIRCLE('ICRS', mine.RA, mine.Decl, mine.Beta))
AND db.dataproduct_type='image'
"""
def main(query):
# Try to load table of neutrinos
lt = Table.read('neutrinos.vot', format='votable')
# Make Service Object
service = pyvo.dal.TAPService ("http://dc.zah.uni-heidelberg.de/tap")
# Run Search on obscore table on the GAVO dc
result = service.run_async(query=query, uploads={"lt":lt})
# Send resulting table to Topcat via SAMP
result.broadcast_samp("topcat")
if __name__=="__main__":
main(query)