I tried the crossmatch service and it was still giving me the same connection or timeout errors so I downloaded the datalab modules and tried it through python two different ways:
#First way:
import numpy as np
from astropy import units as u
from astropy.coordinates import SkyCoord
from astropy.table import Table, Column
from math import log10
import matplotlib.pyplot as plt
from astropy.io import fits
import dl
from dl import authClient as ac, queryClient as qc
from dl.helpers.utils import convert
from getpass import getpass
#token = ac.login('kedd58',getpass("Enter password (+ENTER): "))
#ac.whoAmI()
cows_official = Table.read('/Users/kedd58/Desktop/cows_official.fits') #catalog of clusters
for cluster in cows_official:
RA=cluster['RA']
DEC=cluster['DEC']
query= '''
SELECT ra, dec, brick_primary, mag_g, mag_r, mag_z, objid, snr_g, snr_r, snr_z, type
FROM ls_dr7.tractor
WHERE q3c_join (ra, dec, RA, DEC, 0.041667) #tried this with the radial query function as well
'''
sources=qc.query(sql=query,output='catalogs.fits')
#Second Way:
cows_official = Table.read('cows_official.fits')
RA=cows_official['RA']
DEC=cows_official['DEC']
ID=cows_official['ID']
DEF_ACCESS_URL = "
http://datalab.noao.edu/tap/ls_dr7"
service = pyvo.dal.TAPService(DEF_ACCESS_URL)
for ID in cows_official:
try:
cluster_catalog=service.submit_job('SELECT * FROM ls_dr7.tractor WHERE q3c_radial_query(ra,dec,RA,DEC,0.041667)',maxrec=100000).to_table()
cluster_catalog.run()
url=cluster_catalog.url
urllib.urlretrieve(url, ID + "_catalog.fits")
except IndexError:
pass
Both methods produce time out errors or this error:
ConnectionError: ('Connection aborted.', BadStatusLine("''",))