Sorry, I should've given way more details. The crossmatch was between the CatWISE2020 Reject catalog and VHS DR5. The resulting table has ~2,400 rows. I've uploaded it to mydb as 'catw_rjct_vhs_cmatch' and 'mydb_index'ed the ra and dec column.
The crossmatch (3° deg. stripes in VHS & CatWISE2020 Reject catalog) looked like this:
'''SELECT c.*, v.japermag3
FROM mydb://cat_rjct_%c%02d AS c, mydb://vhs_j18t19_%c%02d AS v
WHERE q3c_join(c.ra, c.dec, v.ra2000, v.dec2000, 0.0006)
AND v.japermag3-c.w2mpro >= 2 ''' % ('m' if fnr < 0.0 else 'p',abs(fnr),'m' if fnr < 0.0 else 'p',abs(fnr))
I haven't used Pandas dataframe yet, so I don't know if this would work but I'm willing to give it a try if you think this would work.
I was trying out something the last few days and thought something like "NOT q3c_join" would work, but the sync query timed out and async went on for more than 20 hours, so I aborted the job. The query looked like:
'''SELECT t.*
FROM %s AS t, gaia_dr3.gaia_source as g
WHERE NOT q3c_join(t.ra, t.dec, g.ra, g.dec, 0.0006)
''' % (tname_source)
('tname_source' was 'mydb://catw_rjct_vhs_cmatch')
I've searched the forum today and found a discussion about cone searches. So the next idea would be to use something like 'NOT q3c_radial_query(t.ra, t.dec, g.ra, g.dec, 0.0006)' but I haven't tried it yet and don't know if this would be the right approach.