__init__

SRF.__init__(f, W)[source]

Initialise SRF object.

You can either initialise an SRF from scratch, or use the classmethod fromArtsXML to read it from a file.

A toy example on initiating it from scratch:

>>> from typhon.physics.units.common import ureg
>>> from typhon.physics.units.em import SRF
>>> srf = SRF(ureg.Quantity(numpy.array([200, 200.1, 200.2, 200.3, 200.4, 200.5]), 'GHz'), numpy.array([0, 0.5, 1, 1, 0.5, 0]))
>>> R_300 = srf.blackbody_radiance(ureg.Quantity(300, 'K'))
>>> print(R_300)
[  3.63716781e-15] watt / hertz / meter ** 2 / steradian
>>> print(R_300.to("K", "radiance", srf=srf))
[ 300.] kelvin

You can also pass in other spectroscopic units (wavenumber, wavelength) that will be converted internally to frequency:

>>> srf = SRF(ureg.Quantity(numpy.array([10.8, 10.9, 11.0, 11.1, 11.2, 11.3]), 'um'), numpy.array([0, 0.5, 1, 1, 0.5, 0]))
>>> R_300 = srf.blackbody_radiance(ureg.Quantity(numpy.atleast_1d(250), 'K'))
>>> print(R_300)
[  1.61922509e-12] watt / hertz / meter ** 2 / steradian
>>> print(R_300.to("cm * mW / m**2 / sr", "radiance"))
[ 48.54314703] centimeter * milliwatt / meter ** 2 / steradian
>>> print(R_300.to("K", "radiance", srf=srf))
[ 300.] kelvin
Parameters
  • f (ndarray) – Array of frequencies. Can be either a pure ndarray, which will be assumed to be in Hz, or a ureg quantity.

  • W (ndarray) – Array of associated weights.