nugridpy.astronomy

Constants and methods for astronomy & astrophysics

Functions

Gamma1_gasrad(beta) Gamma1 for a mix of ideal gas and radiation
Nasv(macs, T)
returns:for MACS [mb] at T [K].
Pgas(rho, T, mu) P = R/mu * rho * T
Prad(T, mu) P = a/3 * T**4
Trho_iddeg(rho, mu, mu_e) T(rho) that separates ideal gas and degenerate pressure dominated regions.
Trho_idrad(rho, mu) T(rho) that separates P_rad from P_gas dominated regions.
am_orb(m1, m2, a, e) orbital angular momentum.
core_mass_L(MH) Core-mass luminosity relationship from Bloecker (1993).
energ_orb(m1, m2, r)
param m1, m2:M in Msun.
escape_velocity(M, R) escape velocity.
imf(m)
returns:for given mass according to Kroupa IMF, vectorization
int_imf_dm(m1, m2, m, imf[, bywhat, integral]) Integrate IMF between m1 and m2.
macs(nasv, T)
returns:[mb] at T [K] from Na*<sigma v>.
mass_loss_loon05(L, Teff) mass loss rate van Loon etal (2005).
mimf_ferrario(mi) Curvature MiMf from Ferrario etal.
mu(X, Z, A) mean molecular weight assuming full ionisation.
mu_e(X) mean molecular weight per free electron, assuming full ionisation, and
period(A, M1, M2) calculate binary period from separation.
visc_mol_sol(T, rho, X) Molecular plasma viscosity (Spitzer 1962)
visc_rad_kap_sc(T, rho, X) Radiative viscosity (Thomas, 1930) for e- scattering opacity
nugridpy.astronomy.Gamma1_gasrad(beta)

Gamma1 for a mix of ideal gas and radiation

Hansen & Kawaler, page 177, Eqn. 3.110

Parameters:beta (float) – Gas pressure fraction Pgas/(Pgas+Prad)
nugridpy.astronomy.Nasv(macs, T)
Returns:for MACS [mb] at T [K].
Return type:Na*<sigma v>
nugridpy.astronomy.Pgas(rho, T, mu)

P = R/mu * rho * T

Parameters:
  • mu (float) – Mean molecular weight
  • rho (float) – Density [cgs]
  • T (float) – Temperature [K]
nugridpy.astronomy.Prad(T, mu)

P = a/3 * T**4

Parameters:
  • a (float) – Radiation constant [erg cm^-3 K^-4].
  • T (float) – Temperature [K].
nugridpy.astronomy.Trho_iddeg(rho, mu, mu_e)

T(rho) that separates ideal gas and degenerate pressure dominated regions.

Kippenhahn & Weigert, Eq. 16.6

Parameters:
  • rho (float) – Density array [cgs].
  • mu (float) – Mean molecular weight.
  • mu_e (float) – Mean molecular weight per free electron.
nugridpy.astronomy.Trho_idrad(rho, mu)

T(rho) that separates P_rad from P_gas dominated regions.

Kippenhahn & Weigert, Eq. 16.10

Parameters:
  • rho (float) – Density array [cgs].
  • mu (float) – Mean molecular weight.
nugridpy.astronomy.am_orb(m1, m2, a, e)

orbital angular momentum.

e.g Ge etal2010

Parameters:
  • m2 (m1,) – Masses of both stars in Msun.
  • A (float) – Separation in Rsun.
  • e (float) – Eccentricity
nugridpy.astronomy.core_mass_L(MH)

Core-mass luminosity relationship from Bloecker (1993).

Parameters:MH (float) – Core mass in Msun.
Returns:Luminosity in Lsun
Return type:L
nugridpy.astronomy.energ_orb(m1, m2, r)
Parameters:
  • m2 (m1,) – M in Msun.
  • r (float) – Distance in Rsun.
Returns:

Epot in erg.

Return type:

Epot

nugridpy.astronomy.escape_velocity(M, R)

escape velocity.

Parameters:
  • M (float) – Mass in solar masses.
  • R (float) – Radius in solar radiu.
Returns:

in km/s.

Return type:

v_escape

nugridpy.astronomy.imf(m)
Returns:for given mass according to Kroupa IMF, vectorization available via vimf()
Return type:N(M)dM
nugridpy.astronomy.int_imf_dm(m1, m2, m, imf, bywhat='bymass', integral='normal')

Integrate IMF between m1 and m2.

Parameters:
  • m1 (float) – Min mass
  • m2 (float) – Max mass
  • m (float) – Mass array
  • imf (float) – IMF array
  • bywhat (string, optional) – ‘bymass’ integrates the mass that goes into stars of that mass interval; or ‘bynumber’ which integrates the number of stars in that mass interval. The default is ‘bymass’.
  • integrate (string, optional) – ‘normal’ uses sc.integrate.trapz; ‘cum’ returns cumulative trapezoidal integral. The default is ‘normal’.
nugridpy.astronomy.macs(nasv, T)
Returns:[mb] at T [K] from Na*<sigma v>.
Return type:MACS
nugridpy.astronomy.mass_loss_loon05(L, Teff)

mass loss rate van Loon etal (2005).

Parameters:
  • L (float) – L in L_sun.
  • Teff (float) – Teff in K.
Returns:

Mdot in Msun/yr

Return type:

Mdot

Notes

ref: van Loon etal 2005, A&A 438, 273

nugridpy.astronomy.mimf_ferrario(mi)

Curvature MiMf from Ferrario etal. 2005MNRAS.361.1131.

nugridpy.astronomy.mu(X, Z, A)

mean molecular weight assuming full ionisation.

(Kippenhahn & Weigert, Ch 13.1, Eq. 13.6)

Parameters:
  • X (float) – Mass fraction vector.
  • Z (float) – Charge number vector.
  • A (float) – Mass number vector.
nugridpy.astronomy.mu_e(X)

mean molecular weight per free electron, assuming full ionisation, and approximating mu_i/Z_i ~ 2 for all elements heavier then Helium.

(Kippenhahn & Weigert, Ch 13.1, Eq. 13.8)

Parameters:X (float) – Mass fraction of H.
nugridpy.astronomy.period(A, M1, M2)

calculate binary period from separation.

Parameters:
  • A (float) – separation A Rsun.
  • M2 (M1,) – M in Msun.
Returns:

period in days.

Return type:

p

nugridpy.astronomy.visc_mol_sol(T, rho, X)

Molecular plasma viscosity (Spitzer 1962)

Parameters:
  • X (float) – H mass fraction
  • T (float) – temperature in K
  • rho (float) – density in cgs
Returns:

nu – molecular diffusivity in [cm**2/s]

Return type:

float

Notes

According to Eq 22 in Schatzman (1977). Assume log Lambda = 15. (see Table 5.1), a H/He mix (for different mix use Eq. 5.54 in Spitzer text book)

Examples

see astronomy.visc_rad_kap_sc

nugridpy.astronomy.visc_rad_kap_sc(T, rho, X)

Radiative viscosity (Thomas, 1930) for e- scattering opacity

Parameters:
  • X (float) – H mass fraction
  • T (float) – temperature in K
  • rho (float) – density in cgs
Returns:

nu – radiative diffusivity in [cm**2/s]

Return type:

float

Examples

>>> In [1]: import astronomy as ast
>>> In [2]: l = 100*1.e5 # 100km
>>> In [3]: v = 1.e5     # typical velocity
>>> In [4]: T   = 90.e6  # temperature
>>> In [5]: X   = 0.001  # H mass fraction
>>> In [6]: rho = 100.   # density
>>> In [7]: nu = ast.visc_rad_kap_sc(T,rho,X)
>>> In [8]: Re=v*l/nu
>>> In [9]: print "Re_rad = "+str('%g'%Re)
>>> Re_rad = 4.43512e+08

Notes

Eqn. 14’ in Schatzman, 1977, assume electron scattering opacity kappa_sc = 0.2*(1+X), Kippenhahn (2nd edn, Eqn 17.2)