0 votes
1 view

Hi!

I'm working with a set of galaxies derived from DESI DR1. I've uploaded a table containing their DESI TARGETIDs to a workspace, and I'm attempting to retrieve their forced photometry (i.e. https://datalab.noirlab.edu/data-explorer?showTable=ls_dr9.apflux) from LS DR9. As the DESI targets were identified from LS DR9, it is my understanding that there should be measurements in this table for each DESI target. However, when I run my query (pasted below), I tend to get many empty rows. Am I doing something wrong here, or is it expected that some DESI targets have no associated apflux measurement?

sql = '''SELECT  m.TargetID_DESI, a.apflux_g_1, a.apflux_g_2, a.apflux_g_3, a.apflux_g_4, a.apflux_g_5, a.apflux_g_6, a.apflux_g_7, a.apflux_g_8, a.apflux_ivar_g_1, a.apflux_ivar_g_2, a.apflux_ivar_g_3, a.apflux_ivar_g_4, a.apflux_ivar_g_5, a.apflux_ivar_g_6, a.apflux_ivar_g_7, a.apflux_ivar_g_8

         FROM mydb://snr5_matched225 AS m

         LEFT JOIN desi_dr1.photometry as p

         ON m.TargetID_DESI = p.targetid

         LEFT JOIN ls_dr9.apflux as a

         ON p.ls_id = a.ls_id '''

qu = qc.query(sql=sql,async_=True,wait=True,poll=15,verbose=1,timeout=1800)

df_out = convert(qu)

df_out.to_csv('../apflux_catalogs/apflux_matched_snr5_225.csv')

by amizener (140 points) | 1 view

1 Answer

0 votes
What happens when you replace both "LEFT JOIN"s with just "JOIN"?
by baweaver (540 points)

500 questions

511 answers

498 comments

681 users

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

Categories