planck
index
/users/schrei_f/src/py4CAtS/lite/src/planck.py

planck.py
 
usage:
planck  [options]  xGrid  temperature(s)
 
compute Planck's black body function as a function of wavenumber (or frequency, wavelength) for given temperature(s).
 
xGrid:  [xStart,]xStop[,xStep]
        specification of wavenumber/frequency/wavelength grid
        comma separated (no blanks!) list of one, two, or three floats similar to Python's range function:
        If xStart argument is omitted, it defaults to 0.0; If xStep argument is omitted, it defaults to 1.0
 
        Alternatively a file can be specified here, the xGrid is then read from the file's first column
 
temperatures:
        comma separated (no blanks!) list of values (Kelvin)
 
options:
-c char      comment character to be used in output (default: '#')
-h           display help
-m           SI area units  (default:  cgs area units [cm^2])
-o file      output file (default: standard output)
-r           Rayleigh-Jeans approximation
-W           power in SI power units (default:  power in cgs units [erg/s])
-X string    x-axis unit: wavenumber [cm-1] (default), frequency (Hz, kHz, MHz, GHz) or wavelength (cm, mue, nm, A)
 
UNITS:
default is to return Planck function values in cgs units, i.e. [erg/s / (cm^2 sr [x])]
Using the -W and -m switches you can convert the power unit in the nominator
or the area unit in the denominator to Watt and square meters, respectively.

 
Functions
       
Planck_Frequency(f, temp)
For a given frequency [Hz] array and temperature return corresponding Planck function values.
Planck_Wavelength(l, temp)
For a given wavelength [cm] array and temperature return corresponding Planck function values.
Planck_Wavenumber(v, temp)
For a given wavenumber [1/cm] array and temperature return corresponding Planck function values.
RayleighJeans(x, temp, xUnit='cm-1')
Call appropriate Rayleigh-Jeans routine (with x in cgs units, i.e. v[1/cm], f[Hz] or lambda[cm]) .
RayleighJeans_Frequency(f, temp)
For a given frequency [Hz] array and temperature return corresponding Rayleigh-Jeans approximations.
RayleighJeans_Wavelength(l, temp)
For a given wavelength [cm] array and temperature return corresponding Rayleigh-Jeans approximations.
RayleighJeans_Wavenumber(v, temp)
For a given wavenumber [1/cm] array and temperature return corresponding Rayleigh-Jeans approximations.
dPlanck_Wavenumber_dT(v, temp)
For a given wavenumber [1/cm] array and temperature return derivative of Planck function wrt temperature.
planck(x, T, xUnit='cm-1')
Compute Planck blackbody function for wavenumber v[1/cm] (default) or frequency f or wavelength array and temperature T.
Returns B(x,T) in [power]/([area]*sr*[x])
default power erg/s
        area  cm**2

 
Data
        C1 = 1.1910427584934559e-05
C2 = 1.4387751601679206
c = 29979245800.0
frequencyUnits = {'1/cm': 29979245800.0, 'GHz': 1000000000.0, 'Hz': 1.0, 'MHz': 1000000.0, 'THz': 1000000000000.0, 'cm-1': 29979245800.0, 'kHz': 1000.0}
h = 6.62606896e-27
k = 1.3806504e-16
wavelengthUnits = {'A': 1e-08, 'cm': 1.0, 'micrometer': 0.0001, 'mm': 0.1, 'mue': 0.0001, 'mum': 0.0001, 'nm': 1e-07, 'um': 0.0001}