[AstroPy] AstroPy Digest, Vol 184, Issue 1

Robert Carr rspencercarr at gmail.com
Fri Feb 4 12:06:53 EST 2022


Thank you, Adam, for your guidance on the astroquery GitHub.  I shall make
use of this.

Thank you, too, for suggesting that I employ* Vizier.query_object *in lieu
of *Vizier.query_region*.  This indeed worked.  Problem solved.

Interestingly, my region query format was built upon the example provided
in the instructions as astroquery.vizier which goes
*result = Vizier.query_region("3C 273", radius=0.1*u.deg, catalog='GSC').  *As
I mentioned, this worked perfectly the prior couple thousand runs.  But it
did not work the other day and it does not work today..

I take the moral to be: when you hit your head against the wall and the
wall is winning, look for a way to walk around the wall.  Thank you again
for pointing my way around the wall.

Bob C.


On Wed, Feb 2, 2022 at 3:51 PM <astropy-request at python.org> wrote:

> Send AstroPy mailing list submissions to
>         astropy at python.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
>         https://mail.python.org/mailman/listinfo/astropy
> or, via email, send a message with subject or body 'help' to
>         astropy-request at python.org
>
> You can reach the person managing the list at
>         astropy-owner at python.org
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of AstroPy digest..."
>
>
> Today's Topics:
>
>    1. Vizier.query stopped working properly (Robert Carr)
>    2. Re: Vizier.query stopped working properly (Adam Ginsburg)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Wed, 2 Feb 2022 15:11:28 -0500
> From: Robert Carr <rspencercarr at gmail.com>
> To: astropy at python.org
> Subject: [AstroPy] Vizier.query stopped working properly
> Message-ID:
>         <CAP6WE=
> 0WuzsRqwwMQjE5NedC56wwwbmRSoMBNtw-erU2_g7oZQ at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> I am going crazy with a problem that should not be a problem at all.  I
> have run a section of code successfully probably two or three thousand
> times.  Today, it does not work.  The only thing that has changed on my end
> is that about a week ago I updated my installed modules in Python.
>
>
>
> The relevant section of my code, including installed modules, is:
>
> >>> from astropy.coordinates import SkyCoord
>
> >>> import astropy.units as u
>
> >>> from astroquery.vizier import Vizier
>
> >>>
>
> >>> STAR_NAME = 'J005736.73+120753.3'
>
> >>> field_of_view =0.001
>
> >>> results = Vizier.query_region(STAR_NAME, radius=field_of_view * u.deg,
> catalog = 'SDSS12')
>
> >>> results
>
>
>
> Until today, this returned coordinates and other information for the target
> STAR_NAME.  It now returns:
>
>                 >>> Empty TableList
>
>
>
> I have upgraded my modules.  I have tried playing with the ?field_of_view?
> variable but have not been able to restore the desired behavior where
> Vizier returns results just for the target STAR_NAME.  (I use similar code
> with different ?field_of_view? elsewhere in my program so I need to fix
> this in the general case.)
>
>
>
> Incidentally, I ran the sample code from astroquery:docs at
> *https://astroquery.readthedocs.io/en/latest/vizier/vizier.html
> <https://astroquery.readthedocs.io/en/latest/vizier/vizier.html>*
>
> >>> import astropy.units as u
>
> >>> result = Vizier.query_region("3C 273", radius=0.1*u.deg, catalog='GSC')
>
> >>> result
>
>
>
> This is supposed to return:
>
> TableList with 3 tables:
>
>    '0:I/254/out' with 10 column(s) and 17 row(s)
>
>    '1:I/271/out' with 11 column(s) and 50 row(s)
>
>    '2:I/305/out' with 11 column(s) and 50 row(s)
>
>
>
> But instead returns:
>
> TableList with 5 tables:
>
>         '0:I/254/out' with 10 column(s) and 17 row(s)
>
>         '1:I/255/out' with 9 column(s) and 17 row(s)
>
>         '2:I/271/out' with 11 column(s) and 53 row(s)
>
>         '3:I/305/out' with 11 column(s) and 206 row(s)
>
>         '4:I/353/gsc242' with 35 column(s) and 5370 row(s)
>
>
>
> Does this make any sense?  I appreciate any help!
>
> Bob Carr
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> https://mail.python.org/pipermail/astropy/attachments/20220202/a24c1ce9/attachment-0001.html
> >
>
> ------------------------------
>
> Message: 2
> Date: Wed, 2 Feb 2022 15:52:19 -0500
> From: Adam Ginsburg <adam.g.ginsburg at gmail.com>
> To: Astronomical Python mailing list <astropy at python.org>
> Subject: Re: [AstroPy] Vizier.query stopped working properly
> Message-ID:
>         <
> CAEBNSwZWDaEaS2mG-WCymCh3SGrfoQ4C7s7UUy3YKCYXYwcZmA at mail.gmail.com>
> Content-Type: text/plain; charset="utf-8"
>
> Hi Bob,
>
> It might be helpful to post this sort of question as an Issue on the
> astroquery github issue tracker (https://github.com/astropy/astroquery).
>
> Anyway, I can't reproduce your exact issue.  When I run your code, I get a
> multi-tiered error because the STAR_NAME is being treated as a coordinate:
> "ValueError: Cannot parse first argument data "00 57 36.73" for attribute
> ra"
>
> This points to the solution: you should be using Vizier.query_object, not
> query_region:
>
> In [2]: >>> results = Vizier.query_object(STAR_NAME, radius=field_of_view *
> u.deg, catalog = 'SDSS12')
>
> In [3]: results
> Out[3]:
> TableList with 1 tables:
>         '0:V/147/sdss12' with 23 column(s) and 2 row(s)
>
> In [4]: results[0]
> Out[4]:
> <Table length=2>
>  RA_ICRS    DE_ICRS    mode q_mode class        SDSS12       m_SDSS12
>  ObsDate    Q     umag   e_umag   gmag   e_gmag   rmag   e_rmag   imag
> e_imag   zmag   e_zmag   zsp     zph    e_zph   __zph_
>    deg        deg
> yr            mag     mag     mag     mag     mag     mag     mag     mag
>   mag     mag
>  float64    float64   uint8  str1  uint8        str19          str1
>  float64  uint8 float32 float32 float32 float32 float32 float32 float32
> float32 float32 float32 float64 float64 float64 float32
> ---------- ---------- ----- ------ ----- ------------------- --------
> --------- ----- ------- ------- ------- ------- ------- ------- -------
> ------- ------- ------- ------- ------- ------- -------
>  14.403077  12.131476     1      +     6 J005736.73+120753.3        *
> 2008.8279     3  18.459   0.018  17.151   0.005  16.611   0.005  16.414
> 0.006  16.327   0.009      --      --      --      --
>  14.403551  12.130666     1            6 J005736.85+120750.3
>  2008.8279     3  24.337   0.967  25.347   0.578  23.120   0.277  21.869
> 0.132  21.272   0.338      --      --      --      --
>
> If you want to use query_region, first use
> coordinates.SkyCoord.from_name(STAR_NAME) for the same result:
>
> In [8]: Vizier.query_region(SkyCoord.from_name(STAR_NAME),
> radius=field_of_view * u.deg, catalog = 'SDSS12')
> Out[8]:
> TableList with 1 tables:
>         '0:V/147/sdss12' with 23 column(s) and 2 row(s)
>
>
>
> The second issue you note is just because new GSC versions have been added
> since the documentation was written.  We expect there to be more catalogs
> for the same query over time.
>
> On Wed, Feb 2, 2022 at 3:11 PM Robert Carr <rspencercarr at gmail.com> wrote:
>
> > I am going crazy with a problem that should not be a problem at all.  I
> > have run a section of code successfully probably two or three thousand
> > times.  Today, it does not work.  The only thing that has changed on my
> end
> > is that about a week ago I updated my installed modules in Python.
> >
> >
> >
> > The relevant section of my code, including installed modules, is:
> >
> > >>> from astropy.coordinates import SkyCoord
> >
> > >>> import astropy.units as u
> >
> > >>> from astroquery.vizier import Vizier
> >
> > >>>
> >
> > >>> STAR_NAME = 'J005736.73+120753.3'
> >
> > >>> field_of_view =0.001
> >
> > >>> results = Vizier.query_region(STAR_NAME, radius=field_of_view *
> u.deg,
> > catalog = 'SDSS12')
> >
> > >>> results
> >
> >
> >
> > Until today, this returned coordinates and other information for the
> > target STAR_NAME.  It now returns:
> >
> >                 >>> Empty TableList
> >
> >
> >
> > I have upgraded my modules.  I have tried playing with the
> ?field_of_view?
> > variable but have not been able to restore the desired behavior where
> > Vizier returns results just for the target STAR_NAME.  (I use similar
> code
> > with different ?field_of_view? elsewhere in my program so I need to fix
> > this in the general case.)
> >
> >
> >
> > Incidentally, I ran the sample code from astroquery:docs at *
> https://astroquery.readthedocs.io/en/latest/vizier/vizier.html
> > <https://astroquery.readthedocs.io/en/latest/vizier/vizier.html>*
> >
> > >>> import astropy.units as u
> >
> > >>> result = Vizier.query_region("3C 273", radius=0.1*u.deg,
> catalog='GSC')
> >
> > >>> result
> >
> >
> >
> > This is supposed to return:
> >
> > TableList with 3 tables:
> >
> >    '0:I/254/out' with 10 column(s) and 17 row(s)
> >
> >    '1:I/271/out' with 11 column(s) and 50 row(s)
> >
> >    '2:I/305/out' with 11 column(s) and 50 row(s)
> >
> >
> >
> > But instead returns:
> >
> > TableList with 5 tables:
> >
> >         '0:I/254/out' with 10 column(s) and 17 row(s)
> >
> >         '1:I/255/out' with 9 column(s) and 17 row(s)
> >
> >         '2:I/271/out' with 11 column(s) and 53 row(s)
> >
> >         '3:I/305/out' with 11 column(s) and 206 row(s)
> >
> >         '4:I/353/gsc242' with 35 column(s) and 5370 row(s)
> >
> >
> >
> > Does this make any sense?  I appreciate any help!
> >
> > Bob Carr
> > _______________________________________________
> > AstroPy mailing list
> > AstroPy at python.org
> > https://mail.python.org/mailman/listinfo/astropy
> >
>
>
> --
> Adam Ginsburg
> Assistant Professor, Department of Astronomy
> University of Florida, Gainesville
> http://www.adamgginsburg.com/
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: <
> https://mail.python.org/pipermail/astropy/attachments/20220202/f0cc2d79/attachment.html
> >
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> AstroPy mailing list
> AstroPy at python.org
> https://mail.python.org/mailman/listinfo/astropy
>
>
> ------------------------------
>
> End of AstroPy Digest, Vol 184, Issue 1
> ***************************************
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/astropy/attachments/20220204/cc3a6609/attachment-0001.html>


More information about the AstroPy mailing list