Module diskchef.physics.yorke_bodenheimer
Classes
class YorkeBodenheimer2008 (lt: Unit("Myr") = <Quantity 1. Myr>)-
Class to calculate stellar temperature and radius from its mass for age 2 Myr
Based on Yorke, Bodenheimer 2008, + priv. comm (via Tamara Molyarova)
Expand source code
class YorkeBodenheimer2008: """Class to calculate stellar temperature and radius from its mass for age 2 Myr Based on Yorke, Bodenheimer 2008, + priv. comm (via Tamara Molyarova)""" dfile: str = "trktime0191.dat" def __init__(self, lt: u.Myr = 1 * u.Myr): if lt == 1*u.Myr: self.dfile = "trktime0191.dat" elif lt == 2*u.Myr: self.dfile = "trktime0210.dat" elif lt == 5*u.Myr: self.dfile = "trktime0240.dat" elif lt == 0.5*u.Myr: self.dfile = "trktime0141.dat" elif lt == 0.1*u.Myr: self.dfile = "trktime0101.dat" else: print('There is no file for requested star age') file = os.path.join(os.path.dirname(os.path.abspath(__file__)), "data", self.dfile) self.table = astropy.io.ascii.read(file) self.table.sort('M') self._radius_callable = scipy.interpolate.interp1d(self.table['M'], self.table['R']) self._temp_callable = scipy.interpolate.interp1d(self.table['M'], self.table['T_eff']) @u.quantity_input def radius(self, mass: u.solMass) -> u.cm: return (self._radius_callable(mass.to(u.solMass)) * u.solRad).to(u.cm) @u.quantity_input def effective_temperature(self, mass: u.solMass) -> u.K: return self._temp_callable(mass.to(u.solMass)) * u.KClass variables
var dfile : str
Methods
def effective_temperature(self, mass: Unit("solMass")) ‑> Unit("K")def radius(self, mass: Unit("solMass")) ‑> Unit("cm")