rotstars: module of rotating stars functions
PyHdust rotstars module: Rotating stars tools.
- co-author:
Rodrigo Vieira
- license:
GNU GPL v3.0 https://github.com/danmoser/pyhdust/blob/master/LICENSE
- pyhdust.rotstars.area(wfrac, th_res=5001)[source]
Roche star area. This is an brute force alternative to
rochearea
function (from Cranmer 1996). This function return smaller values. The reason for the differences are TBD.
- pyhdust.rotstars.beta(par, is_ob=False)[source]
Calculate the \(\beta\) value from Espinosa-Lara for a given rotation rate \(w_{\rm frac} = \Omega/\Omega_c\)
If
is_ob == True
, it consider the param as ob (instead of \(w_{\rm frac}\)).
- pyhdust.rotstars.ellips_th(th, rf)[source]
Oblate ellipsoid radius
- Parameters:
th – theta, in radians (0 = pole; pi/2 = equator).
rt – radius fraction (Req/Rp >= 1)
- pyhdust.rotstars.ellipsoidarea(rf, th_res=5001)[source]
Ellipsoid area, brute force.
- Parameters:
rt – radius fraction (Req/Rp >= 1)
- pyhdust.rotstars.ellipsoidarea2(rf)[source]
Ellipsoid area, from Wikipedia.
- Parameters:
rt – radius fraction (Req/Rp >= 1)
- pyhdust.rotstars.geneva_closest(Mstar, oblat, t, Zstr='014', tar=None, silent=True)[source]
Interpolate models between rotation rates, at closest Mstar.
Usage: Rpole, logL = geneva_closest(Mstar, oblat, t, Zstr=’014’, tar=None,
silent=True)
where t is given in tMS, and tar is the open tar file. The chosen metallicity is according to the input tar file. If tar=None, the code will take Zstr=’014’ by default.
- pyhdust.rotstars.geneva_interp(Mstar, oblat, t, Zstr='014', tar=None, silent=True)[source]
Interpolates Geneva stellar models.
Usage: Rpole, logL, age = geneva_interp(Mstar, oblat, t, tar=None, silent=True)
where t is given in tMS, and tar is the open tar file. The chosen metallicity is according to the input tar file. If tar=None, the code will take Zstr=’014’ by default.
- pyhdust.rotstars.geneva_interp_fast(Mstar, oblat, t, Zstr='014', silent=True)[source]
Interpolates Geneva stellar models, from grid of pre-computed interpolations.
Usage: Rpole, logL, age = geneva_interp_fast(Mstar, oblat, t, Zstr=’014’)
where t is given in tMS, and tar is the open tar file. For now, only Zstr=’014’ is available.
- pyhdust.rotstars.geneva_pre_computed(Zstr='014', silent=False)[source]
Create geneva pre-computed grid
- pyhdust.rotstars.geneva_read(fname, Zstr='014', tar=None)[source]
Reads Geneva model file
Usage: age, Mstar, logL, logTeff, Hfrac, Hefrac, oblat, w, Rpole =
geneva_read(fname, tar=None)
where tar is the read tar(.gz) opened file.
- pyhdust.rotstars.lum_rotstar(Rp=6, Teff=18703, W=0.732, roche=True)[source]
It calculates the luminosity of a rotation star (ie., oblate star area) impossing an (artificial) effective temperature.
If
roche=True
, calculate Roche star area. IfFalse
, assumes an ellipsoid with same oblateness (as determined byW
).Units: Solar units.
- pyhdust.rotstars.mag_BB(R=6, T=18703, d=279, lb0=5466.0, f0=3.6e-09)[source]
Calculates the magnitude of a Black Body star.
[R]=solar, [T]=Kelvin, [d]=parsec, [lb0;filter eff lambda]=Ang, [f0]=erg/s/cm2/A
- pyhdust.rotstars.mag_Kurucz(R=6, T=18703, d=279, logg=3.5, lb0=5466.0, f0=3.6e-09)[source]
Calculates the magnitude of a Kurucz star.
[R]=solar, [T]=Kelvin, [d]=parsec, [lb0;filter eff lambda]=Ang, [f0]=erg/s/cm2/A
- pyhdust.rotstars.mag_avgBBrotstar(Rp=6, lum=5224, d=279, W=0.732, lb0=5466.0, f0=3.6e-09, roche=True)[source]
It calculates an “averaged” observed magnitude of a rotating star, assuming a Black Body.
This function assumes an uniform luminosity of the star and an average projected area, increased due to the the stellar rotation.
This is seen as an “average” calculation. To be more precise, it is required multiple projections of effetive quantities as function of the inclination angle (eg., the stellar projected area and its effetive surface temperature).
For example, for the face-on (pole-on) case, area=4*pi*Req**2, but what would be an adequade Teff? The center of the area will be in Tpole, but an additional “limb darkening” would be seen due to the cooler temperature towards the equator (ie., the further away from the surface center).
Note that the observed flux from a rotating star will be greater the smaller the angle of inclination (ie, maximum flux for face-on and minimum for pole-on).
If
roche=True
, calculate Roche star area. IfFalse
, assumes an ellipsoid with same oblateness (as determined byW
).
- pyhdust.rotstars.mag_avgKuruczrotstar(Rp=6, lum=5224, d=279, W=0.732, logg=3.5, lb0=5466.0, f0=3.6e-09, roche=True)[source]
It calculates an “averaged” observed magnitude of a rotating star, using a Kurucz model.
This function assumes an uniform luminosity of the star and an average projected area, increased due to the the stellar rotation. For more details, see
calc_mag_avgBBrotstar
.If
roche=True
, calculate Roche star area. IfFalse
, assumes an ellipsoid with same oblateness (as determined byW
).
- pyhdust.rotstars.oblat2w(oblat)[source]
Converts oblateness into wc=Omega/Omega_crit Ekstrom et al. 2008, Eq. 9
Usage: w = oblat2w(oblat)
- pyhdust.rotstars.readscr(scrfile)[source]
Read source generated with ref_estrela.txt.
OUTPUT: M, Req and TP (2*solar units and K).
- pyhdust.rotstars.rochearea(wfrac, isW=False)[source]
Calculate the Roche area of a rigid rotator.
Equation 4.23 from Cranmer 1996 (thesis).
Area in (squared) radial unit (it must be multiplied to Rpole**2 to a physical size).
- pyhdust.rotstars.rotStar(Tp=20000.0, M=10.3065, rp=5.38462, star='B', beta=0.25, wfrac=0.8, th_res=5001, quiet=False, LnotTp=False)[source]
Return the photospheric parameters of a rotating star.
LnotTp
: the value of “Tp” is the Luminosity (in solar units).Calculation of Von Zeipel’s Beta parameter as function of W: see math…
INPUT: th_res (theta resolution, integer)…
OUTPUT: printed status + (ob, Tp values, Area[cm2])
- pyhdust.rotstars.rt(th, wfrac)[source]
Roche Rpole normalized radius as function of wfrac.
- Parameters:
th – theta, in radians (0 = pole; pi/2 = equator).
Based on Mc.Gill(?) and J. Patrick Harrington (notes) formula:
r = 3/wfrac/np.sin(th)*np.cos(1/3.*(np.pi+np.arccos(wfrac*np.sin(th))))
- pyhdust.rotstars.sigma4b_cranmer(M, wfrac)[source]
Computes sigma4b defined in Cranmer 1996 (Eq. 4.22)
Usage: s4b = sigma4b_cranmer(M, wfrac)
where wfrac=Omega/Omega_c, M=stellar mass in Msun (from 1.7 to 20.)
- pyhdust.rotstars.teff_rotstar(Rp=6, lum=5224, W=0.732, roche=True)[source]
It calculates the “effective/average” temperature of a rotation star (ie., oblate star area).
If
roche=True
, calculate Roche star area. IfFalse
, assumes an ellipsoid with same oblateness (as determined byW
).Units: Solar units.
- pyhdust.rotstars.vrot_scr(scrfile, old=True)[source]
Returns the
vrot
value of a given source star.OUTPUT: vrot in km/s.