[AstroPy] Question re objects within radius of given co-ordinates

Eric Jensen ejensen1 at swarthmore.edu
Fri Apr 2 14:26:04 EDT 2021


Hi Jim, 

If you’re primarily interested in bright stars, and in names of objects, then the VO search probably isn’t the best bet.  As you’ve found, it has lots of objects, and no common names for them. 

I’d suggest querying one of the catalogs from Vizier (https://vizier.u-strasbg.fr/viz-bin/VizieR), for example the Bright Star Catalogue.  

Here’s a query that will do a 2-degree-radius search around Hadar for stars brighter than V=6:

from astroquery.vizier import Vizier
result = Vizier.query_region("Hadar", radius="02d00m00s", 
                             catalog=‘V/50',
                             column_filters={"Vmag":"<6"})
print(result[0])

which prints: 

 HR    Name    HD   ADS  VarID   RAJ2000    DEJ2000   Vmag  B-V  SpType NoteFlag
                                 "h:m:s"    "d:m:s"   mag   mag                 
---- ------- ------ --- ------- ---------- --------- ----- ----- ------ --------
5267 Bet Cen 122451     Bet Cen 14 03 49.4 -60 22 23  0.61 -0.23  B1III        *

The reason you have to use ‘print(result[0])’ rather than just ‘print(result)’ is that the query returns a *list* of tables, though in this case the list only has one element.  The string ‘V/50’ is the Vizier code for the Yale Bright Star Catalogue.  You can find other suitable catalogs to query by searching Vizier and noting down the code, typically a Roman numeral followed by some digits.  Each catalog will have different column names, so you may have to adapt your ‘column_filters’ argument above to the names of columns actually present in the catalog, or it won’t have any effect. 

Hope this helps, 

Eric

> On Apr 2, 2021, at 1:23 AM, Jim Singh <jimmyboysingh at gmail.com> wrote:
> 
> Hi,
> I am a beginner astropy user. What I'd like to be able to do is obtain the names and RA and Dec of all objects above a certain Magnitude, within a given angular FOV centered on a given named object. If I try this for example...
> 
> from astropy.coordinates import SkyCoord
> from astroquery.vo_conesearch import ConeSearch
> c = SkyCoord.from_name('hadar')
> print(c)
> result = ConeSearch.query_region(c, '0.1 deg')
> result.sort('Mag')
> print(result)
> 
> ...I get 2670 rows back. Assuming this is the right basic approach to begin with, is there any way to constrain the search to just those rows with 'Mag'>8 for instance? Only a handful of records would qualify in this case. My typical search radius would be a couple of degrees, so if the query were to return everything like above, it would take forever to execute. Also, how to get the name of each qualifying object? Would it entail a separate lookup on the column 'objID'?
> 
> Thanks for your help!
> 
> Regards,
> Jim
> _______________________________________________
> AstroPy mailing list
> AstroPy at python.org
> https://mail.python.org/mailman/listinfo/astropy

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.python.org/pipermail/astropy/attachments/20210402/c4074091/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4388 bytes
Desc: not available
URL: <https://mail.python.org/pipermail/astropy/attachments/20210402/c4074091/attachment.bin>


More information about the AstroPy mailing list