Hello everyone. I am an astrophysics undergrad still trying to get acquainted with the RSP and am running into an issue with retrieving the dp02_dc2_catalogs.object table. My goal is to query the server for this data, which will give me regions to inject simulated satellites into and characterize the performance of a searching algorithm. Here is the code I use to query:
def query(service, ra, dec, radius=1.0, gmax=23.5):
"""Return data queried from Rubin TAP
Parameters
----------
service : TAP service [str]
ra : Right Ascension [deg]
dec : Declination [deg]
radius : radius around (ra, dec) [deg]
Returns
-------
good_results : pd.Dataframe
"""
# Define our reference position on the sky and cone radius in arcseconds
# to use in all following examples
coord = SkyCoord(ra=ra*u.degree, dec=dec*u.degree, frame='icrs')
radius = radius * u.deg
query = f"""
SELECT
coord_ra, coord_dec,
FROM dp02_dc2_catalogs.object
WHERE CONTAINS(POINT('ICRS', ra, dec), CIRCLE('ICRS', {coord.ra.value}, {coord.dec.value}, {radius.value})) = 1
"""
job = service.submit_job(query)
job.run()
job.wait(phases=['COMPLETED', 'ERROR'])
async_results = job.fetch_result()
results = async_results.to_table().to_pandas()
job.delete()
return results
And here is the error it throws when I call it:
I realized initially that I was requesting columns that do not exist but after checking the portal and verifying that the columns I now query do exist, I am still having this issue.