I have been successfully running the code below for several months. Now I get an error: DALServiceError: Cannot wait for job completion. Job is not active!
I have tried repeatedly over the week-end and today and cannot get it to run.
# Get an instance of the TRILEGAL TAP service using PyVO and assert that it exists.
trilegal_tap_url = '
https://datalab.noirlab.edu/tap'
trilegal_tap = pyvo.dal.TAPService(trilegal_tap_url)
assert trilegal_tap is not None
assert trilegal_tap.baseurl == trilegal_tap_url
# Count the stars located in a 9.6°squared area
trilegal_query = """
SELECT COUNT(*)
FROM lsst_sim.simdr2
WHERE ra > 265.92 AND ra < 269.02 AND dec > -31.86 AND dec < -28.76
"""
job = trilegal_tap.submit_job(trilegal_query)
job.run()
job.wait(phases=['COMPLETED', 'ERROR'])
print('Count stars in selected patch')
print('Job phase is', job.phase)
uttot = job.fetch_result().to_table()
print('count = ',uttot[0][0])