From 1bcb2fe7f3d501b467cf7353f9f9500879af1d8d Mon Sep 17 00:00:00 2001 From: Andrew Tribick Date: Sat, 26 Sep 2020 20:26:44 +0200 Subject: [PATCH] Incorporate corrected Tycho-2 spectral types for HIP stars --- README.md | 7 +++++++ download_data.py | 1 + parse_hip.py | 22 ++++++++++++++++++++++ 3 files changed, 30 insertions(+) diff --git a/README.md b/README.md index 6a78854..2f82fc1 100644 --- a/README.md +++ b/README.md @@ -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)" diff --git a/download_data.py b/download_data.py index e75109d..2158026 100755 --- a/download_data.py +++ b/download_data.py @@ -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'), diff --git a/parse_hip.py b/parse_hip.py index ddf7edf..e5f4089 100644 --- a/parse_hip.py +++ b/parse_hip.py @@ -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') @@ -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'])