#!/usr/bin/env python """Locate ALMA-IMF line cubes (H2CO 303-202 optically-thick infall tracer; and an optically-thin one) for the active + a few free-free sources.""" import os, glob LOG=open('find_cubes.log','w') def p(*a): s=' '.join(str(x) for x in a);print(s);print(s,file=LOG);LOG.flush() R='/orange/adamginsburg/ALMAIMF_Images' for field in ['W51-IRS2','G010.62','G338.93']: p(f'\n=== {field} ===') for sub in ['linecubes_12m','fullcubes_12m',os.path.join('B6','cleanest'),'B6']: d=os.path.join(R,field,sub) if os.path.isdir(d): # look for spw3 (h2co 303-202) and c18o cubes for tok in ['spw3','h2co','c18o','spw1']: hits=glob.glob(os.path.join(d,f'*{tok}*.image*.fits'))[:4] if hits: p(f' {sub}/ [{tok}]:') for h in hits: p(' ',os.path.basename(h)) break # also just list what cube dirs exist cubedirs=[x for x in (glob.glob(os.path.join(R,field,'*cube*'))+glob.glob(os.path.join(R,field,'B6','*cube*'))) if os.path.isdir(x)] if cubedirs: p(' cube dirs:',[os.path.basename(x) for x in cubedirs]) LOG.close()