<jupyter_start><jupyter_text>Use the *bayesian* method to estimate a white dwarf age ============================================= In this tutorial we are going to estimate the ages of two white dwarfs using the bayesian method. We are going to start by importing all the packages we are going to need<jupyter_code>import wdwarfdate 
import numpy as np
import time<jupyter_output><empty_output><jupyter_text>We are going to set up the white dwarfs's effective temperatures and surface gravity obtained from Cummings,J.D. et al. 2018.<jupyter_code>#Define data for the white dwarf
teffs = np.array([19250,20250])
teffs_err = np.array([500,850])
loggs = np.array([8.16,8.526])
loggs_err = np.array([0.084,0.126])<jupyter_output><empty_output><jupyter_text>Now we run the age estimation using the *bayesian* method and take the time it takes to run. We are going to explicitly indicate the models we wanted to use:1) `model_wd = 'DA'`, for type of white dwarf2) `model_ifmr = 'Cummings_2018_MIST'`, for the initial-to-final mass relation 3) `feh = 'p0.00'` and `vvcrit='0.0'`, for the isochrone of the progenitor starThese are the default models so we do not need to do it in this case, but we will write them down to be clear. We will also specify the high and low percentiles we want to use to calculate the errors for each parameter. With the `data_type = 'Gyr'` parameters we will select the units of the resulting ages to be Gyr. Finally we will select `plot = True` so we obtain the plots from the MCMC run and the distributions for each of the resulting parameters. We strongly recommend running the *bayesian* method with `plot = True` to be able to check that the run converged.<jupyter_code>start = time.time()
results = wdwarfdate.calc_wd_age(teffs,teffs_err,loggs,loggs_err,
                                 method='bayesian',
                                 model_wd='DA',feh='p0.00',vvcrit='0.0',
                                 model_ifmr = 'Cummings_2018_MIST', 
                                 high_perc = 84, low_perc = 16,
                                 datatype='Gyr',
                                 plot=True)
end = time.time()
print('{}m'.format((end - start)/60))<jupyter_output>Running teff:19250 logg:8.16
{'fraction_non_alphanumeric': 0.10161145926589078, 'fraction_numerical': 0.03133393017009848, 'mean_word_length': 3.3823529411764706, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 6, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '395834', 'license': 'MIT', 'n_tokens_mistral': 708, 'n_tokens_neox': 647, 'n_words': 260, 'path': 'docs/source/tutorials/.ipynb_checkpoints/bayesian_method-checkpoint.ipynb', 'repo_name': 'rkiman/wdwarfdate', 'size': '2234'}