How many stars within 5 parsecs?

I've ran some scripts on some star catalogs, which counted the number of stars with a parallax greater than 200 mas, which should mean everything closer than 5 pc. The results are as follows:

How the heck are there that many stars according to the Tycho catalog? (I've checked the code many times, checked the values it was accepting and I used it as the base for the others.) Also, how can there be so much difference between the other three?

EDIT: If I discard negative parallaxes, the Tycho catalog has 5273 stars with parallaxes greater than 200 mas.

EDIT EDIT: Discarding all stars with the "dubious parallax" flag, 4213 remain.

EDIT EDIT EDIT: Discarding all stars with a quality of medium or worse, 161 stars remain.

-
I would suggest that you look again at the Tycho catalog and/or how you are processing it. A two order of magnitude difference is simply unreasonable. –  dmckee Jun 11 '12 at 21:38
This is the script I used: gist.github.com/2912916 –  Electro Jun 11 '12 at 21:41
I've updated the script gist. –  Electro Jun 12 '12 at 7:23

The Tycho and Hipparcos catalogs use different data layouts.

When I add a line print plx to your tycho_count.py script, the first 10 lines of output are:

9.6
35.1
6.4
4.4
-105.5
40.2
18.4
-2.0
-164.2
-4.6


It seems clear that those aren't parallax values.

You'll have to find out just how the tyc_main.dat file is organized and modify your script accordingly. (I wasn't able to figure that out from the documentation, but I didn't try very hard.)

(And since each line of tyc_main.dat consists of a number of fields delimited by '|' characters, it would be more robust to take advantage of that rather than use fixed offsets.)

UPDATE :

(Some of the above information turns out to be incorrect; I was looking at other data files.)

I've done some analysis on the hip_main.dat and tyc_main.dat files (the links are to gzipped versions of the files.

These both appear to have the same format. They're plain text files with the parallax, in mas (milli-arc seconds) in columns 80-86, as described here.

hip_main.dat has 118,218 entries, of which 4196 (3.5%) have negative parallaxes with magnitude up to -54.95

tyc_main.dat is about 9 times the size, with 1,058,332 entries, of which 454,700 (43%) have negative parallaxes with magnitude up to -919.1 (which seems implausible).

A bit of Googling indicates that negative parallaxes can appear due to measurement errors, though I'm a bit surprised there are so many. (One site, to which I won't link, says that negative parallaxes are evidence for the geocentric model of the Universe.)

I also checked for Alpha and Proxima Centauri (Alpha is a double star). According to Wikipedia, Alpha Centauri's parallax is 747.1 ± 1.2 mas; Proxima Centauri's is 768.7 ± 0.3 mas. Looking for similar values in both data files, I see:

hip_main.dat:
772.33
742.12
742.12


(presumably these are Proxima, Alpha A, and Alpha B, respectively), and:

tyc_main.dat:
701.5


The entry from tyc_main.dat is well outside the margin of error according to Wikipedia, and the other entries in that line indicate something in the Northern Hemisphere (Alpha and Proxima Centauri are about 60 degrees south of the equator).

My conclusion is that there's something wrong with the information in tyc_main.dat. I don't know what the problem is, but my advice is to ignore it and just use the information from the Hipparcos and HYG catalogs.

-
See cdsarc.u-strasbg.fr/viz-bin/Cat?I/239#sRM2.13 And why couldn't those be parallax values? Also, I initially did use the delimited field approach, but I got the same results. I switched to fixed offsets because it ran faster. –  Electro Jun 11 '12 at 22:34
Wouldn't parallax values all be positive? –  Keith Thompson Jun 11 '12 at 22:43
I don't know, but to double-triple-super-mega-check, I've taken those records apart by hand. Negative parallaxes. –  Electro Jun 11 '12 at 22:48
It seems to me that a negative parallax doesn't make physical sense. And you're seeing negative parallax values and getting incorrect results; I doubt that this is coincidental. What do the parallax values in the Hipparcos data look like? –  Keith Thompson Jun 11 '12 at 22:59
I'm doing some more research on this; I'll update my answer when/if I figure this out. –  Keith Thompson Jun 11 '12 at 23:34
show 3 more comments