In [1]:
%matplotlib inline
import numpy as np
import skyrandoms 
import matplotlib.pyplot as plt
from skyrandoms import SkyRandoms
import pandas as pd

In [2]:
db = skyrandoms.SkyRandomsDatabase('../local_data/skyrandoms.db', overwrite=True)

In [3]:
%%time
db.add_batch(npoints=10000, chunk_size=1e6)


CPU times: user 216 ms, sys: 8.71 ms, total: 225 ms
Wall time: 227 ms

In [4]:
db.get_randoms([100, 1123, 1])


Out[4]:
skyrandoms_id skyrandoms_ra skyrandoms_dec skyrandoms_detected
0 1 345.164782 -9.461721 0
1 100 200.038998 16.852028 0
2 1123 178.951267 51.460546 0

In [5]:
db.set_detected([100, 1, 1123])

In [6]:
db.get_randoms([100, 1123, 1])


Out[6]:
skyrandoms_id skyrandoms_ra skyrandoms_dec skyrandoms_detected
0 1 345.164782 -9.461721 1
1 100 200.038998 16.852028 1
2 1123 178.951267 51.460546 1

In [7]:
db.set_all_undetected()

In [8]:
db.get_randoms([100, 1123, 1])


Out[8]:
skyrandoms_id skyrandoms_ra skyrandoms_dec skyrandoms_detected
0 1 345.164782 -9.461721 0
1 100 200.038998 16.852028 0
2 1123 178.951267 51.460546 0