Skip to content

Commit

Permalink
Take account of component ID when generating cross-indices
Browse files Browse the repository at this point in the history
Resolves #4
  • Loading branch information
ajtribick committed Feb 15, 2020
1 parent 462edfd commit 3f94e1d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
5 changes: 3 additions & 2 deletions make_stardb.py
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -267,8 +267,9 @@ def write_xindex(data, field, outfile):
"""Write a cross-index file."""
print('Writing '+field+' cross-index')
print(' Extracting cross-index data')
data = data[np.logical_not(data[field].mask)]['HIP', field]
data = unique(data.group_by([field, 'HIP']), keys=[field])
data = data[np.logical_not(data[field].mask)]['HIP', 'Comp', field]
data['Comp'] = data['Comp'].filled('')
data = unique(data.group_by([field, 'Comp', 'HIP']), keys=[field])
print(f' Writing {len(data)} records')
with open(outfile, 'wb') as f:
f.write(struct.pack('<8sH', b'CELINDEX', 0x0100))
Expand Down
2 changes: 1 addition & 1 deletion parse_hip.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def load_xhip():
with tarfile.open(os.path.join('vizier', 'xhip.tar.gz'), 'r:gz') as tf:
print(' Loading main catalog')
with tf.extractfile('./ReadMe') as readme:
col_names = ['HIP', 'RAdeg', 'DEdeg', 'Plx', 'pmRA', 'pmDE',
col_names = ['HIP', 'Comp', 'RAdeg', 'DEdeg', 'Plx', 'pmRA', 'pmDE',
'e_Plx', 'Dist', 'e_Dist', 'SpType', 'RV']
fill_values = [
('', '-1', 'Tc', 'Lc'),
Expand Down
2 changes: 1 addition & 1 deletion parse_tyc.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def is_data(info):
data = vstack([data, load_section(tf, data_file)], join_type='exact')

data = unique(data.group_by(['TYC', 'd3']), keys=['TYC'])
data.remove_column('d3')
data.rename_column('d3', 'Comp')
data.add_index('TYC')
return data

Expand Down

0 comments on commit 3f94e1d

Please sign in to comment.