<jupyter_start><jupyter_text>This notebook demonstrates how to use `thistothat` to get a handy little Python function encapsulating some relationship from the astrophysics literature (to convert from "this" to "that"). We'll start off in this one by making a function that converts from $V-J$ color to absolute $J$ magnitude for a star, assuming it is on the main sequence, using tabulated relations from [<NAME>](http://www.pas.rochester.edu/~emamajek/).<jupyter_code>import matplotlib.pyplot as plt, numpy as np
%matplotlib inline
# create an interpolator object that uses relations from <NAME>'s stellar table
from thistothat import Mamajek
m = Mamajek()
# create a function that goes to absolute J magnitude for a given V-J color
absoluteJ = m.tofrom('M_J')('V-J')
# create a grid of V-J values
vminusj = np.linspace(-1,5)

# plot the color magnitude diagram
plt.plot(vminusj, absoluteJ(vminusj))
plt.xlabel('$V-J$ (color)'); plt.ylabel("$M_J$ (absolute $J$ magnitude)");
# what other columns are available?
m.summarize()<jupyter_output>[mamajek] 
      [mamajek] The columns in TheMamajekCuratedStars are:
      [mamajek]                  SpT = (string) Spectral type of the star.
      [mamajek]                 Teff = Stellar Effective Temperature, in K.
      [mamajek]                 logT = log10(Teff), where Teff is in K.
      [mamajek]                  BCv = Bolometric Correction from V band, in magnitudes.
      [mamajek]                   Mv = Absolute V magnitude for a dwarf star.
      [mamajek]                 logL = log10(Luminosity), in solar luminosities.
      [mamajek]                  B-V = B-V color
      [mamajek]                Bt-Vt = Bt-Vt color
      [mamajek]                  V-G = V-G color
      [mamajek]                  U-B = U-B color
      [mamajek]                 V-Rc = V-Rc color
      [mamajek]                 V-Ic = V-Ic color
      [mamajek]                 V-Ks = V-Ks color
      [mamajek]                  J-H = J-H color
      [mamajek]                  H-K = H-K color
      [[...]
{'fraction_non_alphanumeric': 0.0965686274509804, 'fraction_numerical': 0.0029411764705882353, 'mean_word_length': 2.1741835147744943, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 6, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, '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}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '664268', 'license': 'MIT', 'n_tokens_mistral': 680, 'n_tokens_neox': 647, 'n_words': 218, 'path': 'notebooks/example_mamajek.ipynb', 'repo_name': 'zkbt/thistothat', 'size': '2052'}