lsst-uk / lasair-lsst

Apache License 2.0
0 stars 0 forks source link

Using watchlist with query api; JSON in queries #69

Closed RoyWilliams closed 9 months ago

RoyWilliams commented 1 year ago

Document how to use the query api that includes a watchlist.

import json, sys
import lasair
import settings
token = settings.token
L = lasair.lasair_client(token)

selected    = 'objects.objectId, ramean, decmean, watchlist_hits.name'
tables      = 'objects, watchlist:1021'
conditions  = ''
results = L.query(selected, tables, conditions, limit=10, offset=20)

for result in results:
    objectId = result['objectId']
    ra = result['ramean']
    de = result['decmean']
    name = result['name']
    print(objectId, ra, de, name)
RoyWilliams commented 1 year ago

Document how to use JSON in queries