1# Load multiple MOCs
2import astropy.utils.data
3from firefly_client import FireflyClient
4fc = FireflyClient.make_client('http://127.0.0.1:8080/firefly', channel_override='moc-channel')
5print('firefly url: {}'.format(fc.get_firefly_url()))
6mocs = ['galex.fits', 'hershel.fits', 'nicmos.fits']
7
8meta = {'PREFERRED_HIPS': 'https://irsa.ipac.caltech.edu/data/hips/CDS/2MASS/Color'}
9for m in mocs:
10 result = input('load {}? (y or n): '.format(m))
11 if result == 'y':
12 downloadName = astropy.utils.data.download_file('http://web.ipac.caltech.edu/staff/roby/demo/moc/{}'.format(m),
13 timeout=120, cache=True)
14 serverFile= fc.upload_file(downloadName)
15 fc.fetch_table(serverFile, m, title=m, meta=meta)
16 print(m)