This is a simple NLTK Python script which uses N-grams to construct phrases from a generative language model trained on the King James Bible.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def mnras_size(fig_width_pt, square=False): | |
| inches_per_pt = 1.0/72.00 # Convert pt to inches | |
| golden_mean = (np.sqrt(5)-1.0)/2.0 # Most aesthetic ratio | |
| fig_width = fig_width_pt*inches_per_pt # Figure width in inches | |
| if square: | |
| fig_height = fig_width | |
| else: | |
| fig_height = fig_width*golden_mean | |
| return [fig_width,fig_height] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| def teff2bv(teff, logg, feh): | |
| """ | |
| Relation from Sekiguchi & Fukugita (2000). | |
| """ | |
| t = [-813.3175, 684.4585, -189.923, 17.40875] | |
| f = [1.2136, 0.0209] | |
| d1, g1, e1 = -0.294, -1.166, 0.3125 | |
| return t[0] + t[1]*np.log10(teff) + t[2]*(np.log10(teff))**2 + \ |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.