Commit 5698fe24 authored by Maude Le Jeune's avatar Maude Le Jeune
Browse files

+ grey body

parent ffdac635
......@@ -34,6 +34,29 @@ tropicalYear=3.15569259747e7
tcmb = 2.726
prefixes = {'n':1e-9,'u':1e-6,'m':1e-3,'k':1e3,'M':1e6,'G':1e9}
def greybody (freqs_GHz, T_K, emiss):
"""Emission for a greybody at temp K with emissivity index emiss.
The results are for a set of frequencies and are NOT normalised
"""
GB_RJ = plancklaw_RJ(T_K, freqs_GHz * 1e9 ) * (freqs_GHz**(emiss) )
return GB_RJ
def plancklaw_RJ (T, nu):
"""Returns the BB spectral radiance according to Planck's law
input: SI units
Outpout : K_RJ unit
"""
h = hPlanck
c = speedOfLight#299792458
k = kBoltzmann#1.380e-23
fac = k**3*T**3/c**2/h**2
nud = (h/k/T)*nu ## now dimensionless
BB_SI = 2* fac * nud**3 / ( exp(nud) - 1 ) ## In SI units
BB_RJ = BB_SI / (2*k*nu**2/c**2) ## in KRJ
return BB_RJ
def Jy(freq):
""" Return conversion factor from Jansky to SI at a given frequency.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment