In [114]:
import numpy as np
import matplotlib.pyplot as plt
%matplotlib notebook
from astropy.table import Table as tbl
import pycurl

source_file = tbl.read('C:/Users/nicke/Desktop/NUREU17/positions_oids.tbl', format = 'ascii.ipac')

In [111]:
print(source_file['oid'])


       oid       
-----------------
 4.6802110005e+13
4.68021100058e+13
4.68021000064e+13
4.68021000099e+13
4.68021000139e+13
4.68021100127e+13
4.68021100119e+13
4.68020400057e+13
4.68020900144e+13
4.68020900071e+13
              ...
   1.00020211e+15
   1.00020211e+15
   1.00020211e+15
   1.00020211e+15
1.00041202001e+15
1.00041211001e+15
1.00041204001e+15
   1.00041201e+15
1.00041207001e+15
   1.00041207e+15
   1.00041207e+15
Length = 18849 rows

In [115]:
curl -o lightcurves.tbl "http://irsa.ipac.caltech.edu/cgi-bin/Gator/nph-query?catalog=ptf_lightcurves&spatial=None&outfmt=1&"

In [17]:
base_url = "http://irsa.ipac.caltech.edu/cgi-bin/Gator/nph-query?"

In [4]:
catalog = "catalog=ptf_objects&"

In [5]:
spatial = "spatial=None&"

In [9]:
fmt = "outfmt=1&"

In [13]:
allsky_constraints = "constraints=(bestchisq>100)and(ngoodobs>500)"

In [18]:
url = base_url+catalog+spatial+fmt+allsky_constraints
print(url)


http://irsa.ipac.caltech.edu/cgi-bin/Gator/nph-query?catalog=ptf_objects&spatial=None&outfmt=1&constraints=(bestchisq>100)and(ngoodobs>500)

In [ ]:
curl -o objects.tbl url

In [ ]: