Skip to content

Instantly share code, notes, and snippets.

View RuthAngus's full-sized avatar

Ruth Angus RuthAngus

  • American Museum of Natural History
  • Brooklyn, NY
View GitHub Profile
@RuthAngus
RuthAngus / gist:73b82c3813ee6c446bd800e079dcd635
Created April 7, 2019 12:31
The rotation period distribution of hot stars.
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
url = "https://arxiv.org/src/1402.5694v2/anc/Table_1_Periodic.txt"
mc = pd.read_csv(url)
plt.hist(np.log10(mc.Prot.values[mc.Teff.values > 6250]), 50)
plt.xlabel("log10(Rotation period [days])")
@RuthAngus
RuthAngus / Teff_bv_conversion.py
Last active September 28, 2016 21:49
Converting Teff into B-V using the Sekiguchi & Fukugita (2000) relation.
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 + \