[AstroPy] Astroquery Using Vizier: How Do I Retrieve SDSS Photo Object Attribute "flags"?

Robert Carr rspencercarr at gmail.com
Tue Jul 21 10:30:26 EDT 2020


I hope that this question is "in bounds," Astroquery being an Astropy
affiliated
package.

I am querying the SDSS-12 catalog for photometric data using Vizier.  The
SDSS field "flags" would be ideal to help me assess the photometric quality
of the SDSS measurements for each object: this field includes a hexadecimal
code that captures issues with the photometry such as pixel saturation,
etc.

My query line is:
        targetobj = Vizier.query_region(STAR_NAME, radius=field_of_view *
u.deg, catalog = 'SDSS12')

The line in my code to collect 'flags' does not work (where
targetobjresults is my results from querying SDSS):

targetobjresults.append({'flags': targetobj[0]['flags'][0]})


I receive the following error message, which I have discovered is
because Vizier
returns only 23 columns of the SDSS data.
         Traceback (most recent call last):

  File "<stdin>", line 32, in <module>

  File
"C:\Users\mawgui\AppData\Local\Programs\Python\Python36\lib\site-packages\
astropy\table\table.py", line 1222, in __getitem__

    return self.columns[item]

  File
"C:\Users\mawgui\AppData\Local\Programs\Python\Python36\lib\site-packages\
astropy\table\table.py", line 106, in __getitem__

    return OrderedDict.__getitem__(self, item)

KeyError: 'flags'


Is there a way to query SDSS through Vizier to get the hexadecimal 'flags'
for each object?  Or is there another workaround?  I appreciate guidance on
how to make this happen.

Thank you!

Bob C


<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon>
Virus-free.
www.avast.com
<https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link>
<#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/astropy/attachments/20200721/da2422c2/attachment-0001.html>


More information about the AstroPy mailing list