<commit_before>from __future__ import division
import pylab as pyl
import h5py as hdf

def mkError(x, x_err):
    return 0.434 * x_err/x

with hdf.File('./../results_cluster.hdf5', 'r') as f:
    dset = f[f.keys()[0]]
    data = dset.value
    data.sort(order='ID')

richnessData = pyl.genfromtxt('./boada_rich.txt', names=True, dtype=None)
richnessData.sort(order='name')


mass = pyl.log10(data['MASS'])
yerr = mkError(data['MASS'], data['MASS_err'])

ax = pyl.subplot()

ax.errorbar(pyl.log10(richnessData['lambda']), mass,
        xerr=mkError(richnessData['lambda'], richnessData['lambda_err']),
        yerr=yerr, fmt='o', label='This Work')

ax.set_xlabel('Log Richness')
ax.set_ylabel(r'Log Cluster Mass $[M_{\odot}]$')

# add the Rozo2010 points
#rozo = pyl.genfromtxt('./rozo2010_points', names=True, dtype=None)<commit_msg>updated with ML masses<commit_after>from __future__ import division
import pylab as pyl
import h5py as hdf

def mkError(x, x_err):
    return 0.434 * x_err/x

with hdf.File('./../MLmethods/ML_predicted_masses.hdf5', 'r') as f:
    dset = f[f.keys()[0]]
    data = dset.value
    data.sort(order='ID')

richnessData = pyl.genfromtxt('./boada_rich.txt', names=True, dtype=None)
richnessData.sort(order='name')


mass = data['ML_pred_3d']
yerr = data['ML_pred_3d_err']
#yerr = mkError(data['MASS'], data['MASS_err'])

ax = pyl.subplot()

ax.errorbar(pyl.log10(richnessData['lambda']), mass,
        xerr=mkError(richnessData['lambda'], richnessData['lambda_err']),
        yerr=yerr, fmt='o', label='This Work')

ax.set_xlabel('Log Richness')
ax.set_ylabel(r'Log Cluster Mass $[M_{\odot}]$')

# add the Rozo2010 points
#rozo = pyl.genfromtxt('./rozo2010_points', names=True, dtype=None)
{'fraction_non_alphanumeric': 0.17588817705299942, 'fraction_numerical': 0.0221316249271986, 'mean_word_length': 5.070671378091872, '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': '3309984', 'n_tokens_mistral': 694, 'n_tokens_neox': 652, 'n_words': 128}