<div dir="ltr"><div>Thank you, Prof Ginsburg. Your advice was very helpful. It was good to know that the flags were accessible. The tweak worked fine on a standalone basis but within my code perhaps it hit another constraint.</div><div><br></div><div>When I run <i>calibrators = Vizier.query_region(coord.SkyCoord(ra=TRA, dec=TDEC, unit=(u.deg, u.deg),frame='icrs'), radius=field_of_view * u.deg, catalog = 'SDSS12')</i></div><div>I get 3361 calibrators for my parameters, which I subsequently whittle down</div><div><br></div><div>When I run <i>calibrators = Vizier(columns=['**']).query_region(coord.SkyCoord(ra=TRA, dec=TDEC, unit=(u.deg, u.deg),frame='icrs'), radius=field_of_view * u.deg, catalog = 'SDSS12') </i></div><div>I get only 50 calibrators for my parameters, which leaves me with nothing to whittle!</div><div><br></div><div>Am I running afoul of a constraint? Vizier pulls down 23 default columns and there are 140 or so total, so the cut seems a bit too dramatic. If I am hitting a constraint, I will need to specify each of my columns up front.</div><div><br></div>Thanks again,<div><br>Bob C.<br><br>----------------------------------------------------------------------<br><br>Message: 1<br>Date: Tue, 21 Jul 2020 10:44:16 -0400<br>From: Adam Ginsburg <<a href="mailto:adam.g.ginsburg@gmail.com" target="_blank">adam.g.ginsburg@gmail.com</a>><br>To: Astronomical Python mailing list <<a href="mailto:astropy@python.org" target="_blank"><span class="gmail-il">astropy</span>@python.org</a>><br>Subject: Re: [<span class="gmail-il">AstroPy</span>] Astroquery Using Vizier: How Do I Retrieve SDSS<br> Photo Object Attribute "flags"?<br>Message-ID:<br> <CAEBNSwbh1HEbsz3mRSVBFN0dq=<a href="mailto:BCfUV2%2Bo6VOmwaAm_zCjaCRA@mail.gmail.com" target="_blank">BCfUV2+o6VOmwaAm_zCjaCRA@mail.gmail.com</a>><br>Content-Type: text/plain; charset="utf-8"<br><br>If you want to include additional columns in vizier queries, follow these<br>instructions:<br><a href="https://astroquery.readthedocs.io/en/latest/vizier/vizier.html#specifying-keywords-output-columns-and-constraints-on-columns" rel="noreferrer" target="_blank">https://astroquery.readthedocs.io/en/latest/vizier/vizier.html#specifying-keywords-output-columns-and-constraints-on-columns</a><br><br><br>for example, to get *all* columns, you would do:<br>Vizier(columns=["**"]).query_region(coordinates.SkyCoord(180*u.deg,<br>0*u.deg, frame='fk5'), radius=field_of_view * u.deg, catalog = 'SDSS12')<br>note the double-asterisks<br><br>On Tue, Jul 21, 2020 at 10:30 AM Robert Carr <<a href="mailto:rspencercarr@gmail.com" target="_blank">rspencercarr@gmail.com</a>> wrote:<br><br>> I hope that this question is "in bounds," Astroquery being an <span class="gmail-il">Astropy</span> affiliated<br>> package.<br>><br>> I am querying the SDSS-12 catalog for photometric data using Vizier. The<br>> SDSS field "flags" would be ideal to help me assess the photometric quality<br>> of the SDSS measurements for each object: this field includes a hexadecimal<br>> code that captures issues with the photometry such as pixel saturation,<br>> etc.<br>><br>> My query line is:<br>> targetobj = Vizier.query_region(STAR_NAME, radius=field_of_view *<br>> u.deg, catalog = 'SDSS12')<br>><br>> The line in my code to collect 'flags' does not work (where<br>> targetobjresults is my results from querying SDSS):<br>><br>> targetobjresults.append({'flags': targetobj[0]['flags'][0]})<br>><br>><br>> I receive the following error message, which I have discovered is because Vizier<br>> returns only 23 columns of the SDSS data.<br>> Traceback (most recent call last):<br>><br>> File "<stdin>", line 32, in <module><br>><br>> File<br>> "C:\Users\mawgui\AppData\Local\Programs\Python\Python36\lib\site-packages\<br>> <span class="gmail-il">astropy</span>\table\table.py", line 1222, in __getitem__<br>><br>> return self.columns[item]<br>><br>> File<br>> "C:\Users\mawgui\AppData\Local\Programs\Python\Python36\lib\site-packages\<br>> <span class="gmail-il">astropy</span>\table\table.py", line 106, in __getitem__<br>><br>> return OrderedDict.__getitem__(self, item)<br>><br>> KeyError: 'flags'<br>><br>><br>> Is there a way to query SDSS through Vizier to get the hexadecimal 'flags'<br>> for each object? Or is there another workaround? I appreciate guidance on<br>> how to make this happen.<br>><br>> Thank you!<br>><br>> Bob C <br></div></div><div id="DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2"><br>
<table style="border-top:1px solid #d3d4de">
<tr>
<td style="width:55px;padding-top:13px"><a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=icon" target="_blank"><img src="https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif" alt="" width="46" height="29" style="width: 46px; height: 29px;"></a></td>
<td style="width:470px;padding-top:12px;color:#41424e;font-size:13px;font-family:Arial,Helvetica,sans-serif;line-height:18px">Virus-free. <a href="https://www.avast.com/sig-email?utm_medium=email&utm_source=link&utm_campaign=sig-email&utm_content=webmail&utm_term=link" target="_blank" style="color:#4453ea">www.avast.com</a>
</td>
</tr>
</table><a href="#DAB4FAD8-2DD7-40BB-A1B8-4E2AA1F9FDF2" width="1" height="1"></a></div>