radiance2radiance
index
/users/schrei_f/src/py4CAtS/var/radiance2radiance.py

radiance2radiance
convert radiance (intensity) vs. wavenumber to radiance vs frequency etc.
 
usage:
radiance2radiance [options] file[s]
 
optional command line options without arguments:
  -h         help
  -c char    comment line character           (default: "#")
  -o file    output file                      (default: standard out)
 
  -a string  area  unit of input  radiance:   'cm2' (square centimeter, default) or 'm2'
  -A string  area  unit of output radiance
  -p string  power unit of input  radiance:   'erg/s' (default) or 'W' or 'mW' or 'nW'
  -P string  power unit of output radiance
  -x string  unit of x-axis on input          'cm-1' (default) or wavelength or frequency (see below)
  -X string  unit of x-axis on output
 
  -r         reverse sequence of x and corresponding y values (convenient for wavenumber <--> wavelength conversion)
  -C int     number of y column to be processed (default: all y columns)
  -T float   temperature [K]:  return radiance normalized to Planck radiance B(T)
 
x-units currently supported: 'cm-1', 'm-1', 'Hz', 'MHz', 'GHz', 'THz', 'mue', 'nm'
y-units currently supported: ""erg/s/([A] sr [x])  or  W/([A] sr [x])"  or  "photons/s/([A] sr [x])"
                               (where [A] is m^2 or cm^2 and [x] is x-unit as listed above)
 
For conversion of radiance to equ. Blackbody temperature use "radiance2Kelvin"

 
Modules
       
numpy

 
Functions
       
normalized_radiance(x, y, temp, xUnit, yUnit)
Convert Radiance (in power / (area*sr*[X])) to normalized radiance by division of Planck function at given temperature.
photons2energy(x, y, xUnit)
Convert radiance given in units of photons/s/(area*sr*[x]) to erg/s/(area*sr*[x].
radiance2radiance(xGrid, yValues, oldX='cm-1', newX='cm-1', oldA='cm2', newA='cm2', oldP='erg/s', newP='erg/s', verbose=False)
Convert radiance, e.g. wavenumber <--> frequency <--> wavelength  or  area unit  or power unit.
 
ARGUMENTS:
----------
xGrid          wavenumber, frequency, or wavelength abscissa
yValues        radiance values defined on the xGrid
oldX, newX     old and new unit of xGrid, default wavenumber [cm-1]
oldA, newA     old and new area unit of radiance, default [cm**2]
oldP, newP     old and new power unit of radiance, default [erg/s]
 
verbose        additionally return two strings with x and y infos
               default:  only new xGrid and yValues arrays
               (NOTE:    when oldX!=newX, the xGrid will change, too)
RETURNS:
--------
xGrid, yValues:  two arrays with the new abscissa and radiances
                 !!! optionally return x and y infos, too !!!
radiance2radiance_X(x, y, oldX, newX, yUnit)
Convert radiance to a new X unit.
radiance2radiance_Y(y, oldA, newA, oldP, newP)
Convert radiance to a new Y unit (i.e. change power or area unit).

 
Data
        C1 = 1.1910427584934559e-05
c = 29979245800.0
frequencyFactor = {'GHz': 1000000000.0, 'Hz': 1.0, 'MHz': 1000000.0, 'THz': 1000000000000.0, 'kHz': 1000.0}
h = 6.62606896e-27
hc = 1.9864455003959037e-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}