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

Eric Jensen ejensen1 at swarthmore.edu
Sat Apr 3 14:24:42 EDT 2021

```Hi Jim,

Astronomical naming is a messy topic - not every star has a “common name” in the way you’re thinking of, but at the same time, every bright star has *many* identifiers (usually associated with various catalogs) that can be used to refer to it.

If you want to look up names, querying Simbad will give you the most systematic, comprehensive answer, but then you’ll have to work out some kind of rubric for how to choose which name you want to use from the many provided.

For example, the Bright Star Catalogue objects all have “HR” numbers (confusingly, for "Harvard Revised” photometry in the Yale Bright Star Catalogue...).  If we add ‘HR’ to the list of columns returned in your example, you get this:

_RAJ2000   _DEJ2000   Vmag  HR     Name
hourangle     deg      mag
---------- ---------- ----- ---- ---------
5.139  -8.665000  5.78 1671
5.152  -8.754167  4.27 1679 69Lam Eri
5.226  -8.147778  6.37 1704
5.242  -8.201667  0.12 1713 19Bet Ori
5.293  -6.844444  3.60 1735 20Tau Ori

So the stars with missing names could be referred to as “HR 1671” and “HR 1704”.   Those are perfectly good star names.

If you want to go further, here’s a query to fetch all the names from Simbad for those stars with blanks in the ’Name’ column from your previous query:

for obj in result[0]:
if obj['Name'] == '':
hr_name = 'HR ' + str(obj['HR'])
print("No name for {}, fetching from Simbad.".format(hr_name))
print("Found {} identifiers:".format(len(s)))
print(s, "\n")

which yields this:

No name for HR 1671, fetching from Simbad.
Found 29 identifiers:
ID
----------------------------
TIC 425213211
2MASS J05082019-0839552
BD-08  1037
CCDM J05083-0839A
CEL    543
CSI-08  1037  1
GC  6281
GCRV 55873
GEN# +1.00033224A
...
SKY#  8076
TD1  4085
UBV    4941
UBV M  10659
YZ  98  1353
uvby98 100033224 A
WDS J05083-0840A
TYC 5330-1722-1
** STF  649A
WEB  4664
Gaia DR2 3182907530429025280
Length = 29 rows

No name for HR 1704, fetching from Simbad.
Found 23 identifiers:
ID
----------------------------
TIC 231305489
2MASS J05133327-0808520
BD-08  1059
CEL    574
GC  6392
GEN# +1.00033948
GSC 05330-01720
HD  33948
HERZ 11718
HR  1704
N30 1119
PPM 187818
SAO 131887
SKY#  8229
SRS   6242
TD1  4233
TYC 5330-1720-1
UBV    5002
UBV M  10732
YZ  98  1387
[HFE83]  362
uvby98 100033948
Gaia DR2 3206914301671368960
From there you could decide which name you want to use…   If you’re looking specifically for the common names, those are formatted as ’NAME X’ in Simbad (e.g. ‘NAME Polaris’), and Bayer or Flamsteed designations have a single ‘*’ at the start, e.g. ‘* alf UMi’ and ‘* 1 UMi’ for Polaris (where the ‘UMi’ is the constellation abbreviation, Ursa Minor in this case).  Again, not every star will have a name like that, but you could check the list if you’re trying to prioritize names of that type.

Best,

Eric

P.S. Regarding Peter Dzwig’s point regarding matching across catalogues, using coordinates for matching is always the safest way to go, rather than names.

> On Apr 3, 2021, at 7:20 AM, Jim Singh <jimmyboysingh at gmail.com> wrote:
>
> Thanks so much for your response Eric, yes this helps tremendously!
>
> I did some additional filtering and formatting (to enable direct comparison of returned results with a star map on the phone), and they match up nicely.
> However, as can be seen below, some rows are without names - this is expected?
>
> from astroquery.vizier import Vizier
> import astropy.units as u
> v = Vizier(columns=['Name','_RAJ2000', '_DEJ2000', 'Vmag'],column_filters={"Vmag":"<8"})
> result = v.query_region("rigel", radius="02d00m00s", catalog="V/50")
> for table_name in result.keys():
>     table = result[table_name]
>     table['_RAJ2000'] = table['_RAJ2000'].to(u.hourangle)
>     table['_RAJ2000'].info.format = '10.3f'
>     print(table)
>
> Name    _RAJ2000   _DEJ2000   Vmag
>                 hourangle     deg      mag
> --------- ---------- ---------- -----
>                5.139  -8.665000  5.78
> 69Lam Eri      5.152  -8.754167  4.27
>                5.226  -8.147778  6.37
> 19Bet Ori      5.242  -8.201667  0.12
> 20Tau Ori      5.293  -6.844444  3.60
>
> Also, presumably another Vizier DB contains a mapping of 'common name' (where one exists) to the Bayer name? I tried for example the online form for IV/22 "Common Name Cross Index" and although for our first example it found 'BET CEN' when given the RA and Dec of Hadar, it did not return anything in the 'name' field (where I'd expected 'Hadar' to appear):
>
> RAJ2000 <>
> "h:m:s" <>	DEJ2000 <>
> "d:m:s" <>	Vmag <>
> mag <>	BFno <>	name <>
> 14 03 49.408	-60 22 22.79	0.61	        BET CEN
>
>
> Regards,
> Jim
>
> On Sat, Apr 3, 2021 at 5:26 AM Eric Jensen <ejensen1 at swarthmore.edu <mailto:ejensen1 at swarthmore.edu>> wrote:
> 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 <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
>                              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 <mailto: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
>> 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'?
>>
>>
>> Regards,
>> Jim
>> _______________________________________________
>> AstroPy mailing list
>> AstroPy at python.org <mailto:AstroPy at python.org>
>> https://mail.python.org/mailman/listinfo/astropy <https://mail.python.org/mailman/listinfo/astropy>
>
> _______________________________________________
> AstroPy mailing list
> AstroPy at python.org <mailto:AstroPy at python.org>
> https://mail.python.org/mailman/listinfo/astropy <https://mail.python.org/mailman/listinfo/astropy>
> _______________________________________________
> 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/20210403/3427576c/attachment-0001.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/20210403/3427576c/attachment-0001.bin>
```