In [2]:
%matplotlib inline
import matplotlib.pyplot as plt
import pandas as pd
import numpy as np

from astropy.table import Table

In [2]:
plt.style.use("fivethirtyeight")
  • data/star_rv.csv

All RV measurements for all stars are compiled from Simbad using TAP Service using the following query:

SELECT t.name, bibcode, nbmes, obsdate, qual, quality,
    velType, velValue, velValue_prec, remark, remarks, ident.oidref
FROM TAP_UPLOAD.mytable as t JOIN ident ON t.name = ident.id
JOIN mesVelocities ON mesVelocities.oidref = ident.oidref

where I upload a table of one column of hipparcos or tycho2 id strings.

  • data/observed.csv

Extracted header info of all observed stars (see generate_log.ipynb)

  • data/star_identifier.csv contains three columns
    • row_id : row index in star catalog
    • tgas_row : row index in stacked tgas catalog
    • name : hip or tyc name (str)

In [7]:
dfstar = pd.read_csv("../data/star_identifier.csv")
dfobs = pd.read_csv("../data/observed.csv")
dfrv = pd.read_csv("../data/star_rv.csv")

In [10]:
objs = dfobs.groupby("objtype").get_group("obj")
print(len(objs))


685

In [14]:
dfobs.loc[dfobs.objtype=='obj', 'row_id'] = \
    [int(s.split("-")[1]) for s in objs.OBJECT.loc[dfobs.objtype=='obj']]

In [20]:
obsrv = pd.merge(
    dfobs,
    pd.merge(dfrv, dfstar, left_on='name', right_on='name', how='left'),
    how='left')

In [26]:
# quality counts for obeserved ta
obsrv.quality.value_counts()


Out[26]:
A    7
B    4
C    2
Name: quality, dtype: int64