I am trying to get magnitude errors for g, r, z, w1, w2, w3, and w4. This doesn't seem to be listed as a column. I am trying to use the snr_BAND columns along with the flux_BAND columns to get a flux error I can covert to a magnitude error. If there is a more straightforward way to get magnitude error please let me know. I am running into the problem that when I run the query it says flux_g, flux_r, flux_z don't exist. I am able to get flux_w1-4.
Here is the query:
sql_ls = '''SELECT o.id, gg.ls_id, gg.ra, gg.dec,
gg.flux_g, gg.flux_r, gg.flux_z,
gg.flux_w1, gg.flux_w2, gg.flux_w3, gg.flux_w4,
gg.mag_g, gg.mag_r, gg.mag_w1, gg.mag_w2, gg.mag_w3, gg.mag_w4, gg.mag_z,
gg.ebv, gg.snr_g, gg.snr_r, gg.snr_w1, gg.snr_w2, gg.snr_w3, gg.snr_w4, gg.snr_z,
(q3c_dist(o.ra,o.dec,gg.ra,gg.dec)*3600.0) as dist_arcsec
FROM mydb://hdx_o3_objects AS o
LEFT JOIN LATERAL (
SELECT gg.*
FROM
ls_dr8.tractor AS gg
WHERE
q3c_join(o.ra, o.dec, gg.ra, gg.dec, 0.01)
ORDER BY
q3c_dist(o.ra,o.dec,gg.ra,gg.dec)
ASC LIMIT 1
) as gg ON true;'''