0 votes
119 views

I am trying to download the DECaLS photometric outputs for every galaxy in the SDSS spectroscopy catalog. I've tried a couple of ways like: 

sdss = ''' SELECT t.ls_id, t.ra, t.dec, t.dered_flux_g, t.dered_flux_r, t.dered_flux_z, t.flux_g, t.flux_r, t.flux_z, t.shape_r, t.sersic, t.flux_w1, t.flux_w2, t.flux_w3, t.flux_w4, t.flux_ivar_w1, t.flux_ivar_w2,  t.flux_ivar_w3,  t.flux_ivar_w4, t.w1_w2, t.w2_w3, t.w3_w4 

FROM ls_dr9.tractor as t, sdss_dr17.x1p5__specobj__ls_dr9__tractor as s 

            INNER JOIN ls_dr9.x1p5__tractor__sdss_dr17__specobj as s

            ON t.ls_id = s.id1 

'''

response = qc.query(sql=neighbors, out='mydb://decalsdr9_specobjmatch', drop=True, async_=True)

I've also tried using ra/dec matching using q3c_join. None of the methods seem to work and I consistently get error messages. What is the best way to perform this crossmatch? Thanks

by mugdhapolimera (120 points) | 119 views

1 Answer

0 votes

Hello, thanks for reaching out, and sorry for the long delay in responding. Your query is almost correct. I ran this one (using the 'datalab' command line client on my laptop), and it produced a file of over 4M rows in 2 minutes:

datalab query sql="SELECT t.ls_id, t.ra, t.dec, t.dered_flux_g, t.dered_flux_r, t.dered_flux_z, t.flux_g, t.flux_r, t.flux_z, t.shape_r, t.sersic, t.flux_w1, t.flux_w2, t.flux_w3, t.flux_w4, t.flux_ivar_w1, t.flux_ivar_w2,  t.flux_ivar_w3,  t.flux_ivar_w4, t.w1_w2, t.w2_w3, t.w3_w4 FROM ls_dr9.tractor AS t INNER JOIN ls_dr9.x1p5__tractor__sdss_dr17__specobj as s ON t.ls_id = s.id1" > xmatch.csv

You can install  the command line client with pip:

pip install --ignore-installed --no-cache-dir astro-datalab

Then, log in once (datalab login), and finally run your query.

Best,
Robert

by robertdemo (8.9k points)

449 questions

463 answers

473 comments

658 users

Welcome to Data Lab Help Desk, where you can ask questions and receive answers from other members of the community.

Categories