#!/usr/bin/env python
"""Search Vizier for published ALMA core catalogs (ALMAGAL, ATOMS, SQUALO, CORE)
to enable a realistic core-scale dust-mass pass without imaging."""
from astroquery.vizier import Vizier
LOG=open('find_corecat.log','w')
def p(*a):
    s=' '.join(str(x) for x in a);print(s);print(s,file=LOG);LOG.flush()
v=Vizier(row_limit=5)
for q in ['ALMAGAL','ATOMS ALMA dense cores Liu','SQUALO ALMA','high-mass cores ALMA continuum 1.3mm']:
    try:
        cats=v.find_catalogs(q)
        p(f'\n=== query: {q} ===')
        for k,val in list(cats.items())[:8]:
            p(' ',k,'|',val.description[:90])
    except Exception as e:
        p(q,'ERR',repr(e)[:80])
LOG.close()
