astropy / astropy/astroquery

Query with table returns incorrect index?

Open
#1,116 1 comment 0 reactions 1 assignee Claimed by @bmatthieu3 View on GitHub
question Upstream vizier
Dominant language
Python
Stars
791
Forks
451
Avg merge
1d 3h
Merged PRs (30d)
4

Description

I am attempting to find stars that are 6 arcmin away from a set of brighter stars and tried to emulate the "Query with table" example. The '_q' column should give me an index in to my original table, but instead of getting 1,2,3....n, I am getting 1,4,7,...3n-2. Am I missing something?

Example code:
```python
import astroquery
import astropy.units as u
from astropy.coordinates import SkyCoord
from astroquery.vizier import Vizier
from astropy.coordinates import Angle
Vizier.ROW_LIMIT = -1
import numpy as np

aocat='I/305/out'
hour=0.5
dec=-20
coord = SkyCoord(ra=hour, dec=dec, unit=(u.hour, u.deg))

bright = Vizier(catalog=aocat, columns = ['_RAJ2000', '_DEJ2000', 'Vmag'], column_filters={'Vmag':'4.0..9.0'})
bright.ROW_LIMIT=-1
aostars = bright.query_region(coord, height='10d', width='10d', catalog=aocat)[0]
phasingstars = Vizier.query_region(aostars, catalog='2MASS', radius='6.5m', inner_radius='5.5m')[0]

print (len(aostars))
# 149

print (np.unique(phasingstars['_q']))
# None
#----
# 1
# 4
# 7
# ...
# 445
# Length = 149 rows
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.