Skip to content

Commit

Permalink
Incorporate corrected Tycho-2 spectral types for HIP stars
Browse files Browse the repository at this point in the history
  • Loading branch information
ajtribick committed Sep 26, 2020
1 parent 39e80ac commit 1bcb2fe
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,13 @@ steps below **before** you begin.
Wright et al. (2003), AJ 125(1), pp.359–363 "The Tycho-2 Spectral Type
Catalog"

- New spectral types for Tycho2 stars
(https://cdsarc.unistra.fr/viz-bin/cat/J/PAZh/34/21)

Tsvetkov et al. (2008), Astronomy Letters 34(1), pp.17–27 "Inaccuracies in
the spectral classification of stars from the Tycho-2 Spectral Type
Catalogue"

- SAO Star Catalog J2000 (http://cdsarc.u-strasbg.fr/viz-bin/cat/I/131A)

SAO Staff, "Smithsonian Astrophysical Observatory Star Catalog (1990)"
Expand Down
1 change: 1 addition & 0 deletions download_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ def download_vizier() -> None:
files_urls = [
('ascc.tar.gz', 'http://cdsarc.u-strasbg.fr/viz-bin/nph-Cat/tar.gz?I/280B'),
('tyc2spec.tar.gz', 'http://cdsarc.u-strasbg.fr/viz-bin/nph-Cat/tar.gz?III/231'),
('tyc2specnew.tar.gz', 'https://cdsarc.unistra.fr/viz-bin/nph-Cat/tar.gz?J/PAZh/34/21'),
('tyc2teff.tar.gz', 'http://cdsarc.u-strasbg.fr/viz-bin/nph-Cat/tar.gz?V/136'),
('ubvriteff.tar.gz', 'http://cdsarc.u-strasbg.fr/viz-bin/nph-Cat/tar.gz?J/ApJS/193/1'),
('xhip.tar.gz', 'http://cdsarc.u-strasbg.fr/viz-bin/nph-Cat/tar.gz?V/137D'),
Expand Down
22 changes: 22 additions & 0 deletions parse_hip.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,23 @@ def load_xhip() -> Table:

return join(hip_data, biblio_data, join_type='left', keys='HIP')

def load_tyc2specnew() -> Table:
"""Load revised spectral types."""
print("Loading revised TYC2 spectral types")
with tarfile.open(os.path.join('vizier', 'tyc2specnew.tar.gz')) as tf:
with tf.extractfile('./ReadMe') as readme:
reader = io_ascii.get_reader(io_ascii.Cds,
readme=readme,
include_names=['HIP', 'SpType1'])
reader.data.table_name = 'table2.dat'
with tf.extractfile('./table2.dat') as f:
# Suppress a warning because reader does not handle logarithmic units
with warnings.catch_warnings():
warnings.simplefilter("ignore", UnitsWarning)
data = reader.read(f)
return data[data['SpType1'] != '']


def load_sao() -> Table:
"""Load the SAO-HIP cross match."""
print('Loading SAO-HIP cross match')
Expand Down Expand Up @@ -182,6 +199,11 @@ def update_coordinates(hip_data: Table) -> None:
def process_xhip() -> Table:
"""Processes the XHIP data."""
xhip = load_xhip()
sptypes = load_tyc2specnew()
xhip = join(xhip, sptypes, keys=['HIP'], join_type='left', metadata_conflicts='silent')
xhip['SpType'] = xhip['SpType1'].filled(xhip['SpType'])
xhip.remove_column('SpType1')

compute_distances(xhip)
update_coordinates(xhip)
xhip.remove_columns(['RAdeg', 'DEdeg', 'Plx', 'e_Plx', 'pmRA', 'pmDE', 'RV', 'Dist', 'e_Dist'])
Expand Down

0 comments on commit 1bcb2fe

Please sign in to comment.