<commit_before>"""
Add very large RV errors for stars with no known RVs.
Convert to cartesian.
"""

import numpy as np
import sys
sys.path.insert(0, '..')
from chronostar import tabletool
from astropy.table import Table

datafile = Table.read('../data/ScoCen_box_result.fits')
d = tabletool.read(datafile)

# Set missing radial velocities (nan) to 0
d['radial_velocity'] = np.nan_to_num(d['radial_velocity'])

# Set missing radial velocity errors (nan) to 1e+10
d['radial_velocity_error'][np.isnan(d['radial_velocity_error'])] = 1e+4

print('Convert to cartesian')
tabletool.convert_table_astro2cart(table=d, return_table=True)

d.write('../data/ScoCen_box_result_15M_ready_for_bg_ols.fits')
print('Cartesian written.', len(d))<commit_msg>Convert entire table to cartesian<commit_after>"""
Add very large RV errors for stars with no known RVs.
Convert to cartesian.
"""

import numpy as np
import sys
sys.path.insert(0, '..')
from chronostar import tabletool
from astropy.table import Table

datafile = Table.read('../data/ScoCen_box_result.fits')
d = Table.read(datafile)

# Set missing radial velocities (nan) to 0
d['radial_velocity'] = np.nan_to_num(d['radial_velocity'])

# Set missing radial velocity errors (nan) to 1e+10
d['radial_velocity_error'][np.isnan(d['radial_velocity_error'])] = 1e+4

print('Convert to cartesian')
tabletool.convert_table_astro2cart(table=d, return_table=True)

d.write('../data/ScoCen_box_result_15M_ready_for_bg_ols.fits')
print('Cartesian written.', len(d))
{'fraction_non_alphanumeric': 0.13119143239625167, 'fraction_numerical': 0.013386880856760375, 'mean_word_length': 6.364532019704433, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5994665', 'n_tokens_mistral': 547, 'n_tokens_neox': 520, 'n_words': 127}