Package ComboCode :: Package cc :: Package tools :: Package units :: Module Equivalency
[hide private]
[frames] | no frames]

Module Equivalency

source code

Equivalencies for the astropy.units module for converting several quantities in both directions.

Author: R. Lombaert

Functions [hide private]
list(tuple)
Tmb(diameter)
Converting main-beam temperature in K to Fnu in cgs and vice versa.
source code
list(tuple)
angularSize(distance)
Equivalency for the astropy.units module for converting angular size to physical length and vice versa.
source code
Variables [hide private]
  __package__ = 'ComboCode.cc.tools.units'
Function Details [hide private]

Tmb(diameter)

source code 

Converting main-beam temperature in K to Fnu in cgs and vice versa.

Requires the diameter to be given in m.

>>> equiv = Tmb(12.)
>>> Fnu = (1*u.K).to(u.W/u.m/u.m/u.Hz,equivalencies=equiv)
gives the length in astronomical units.

Note that you don't have to give arcsec or au. You can also ask for u.cm, u.arcminute, etc. The astropy unit conversion module takes care of these conversions as long as no equivalency is needed.

Parameters:
  • diameter (float) - The telescope dish size (diameter in m)
Returns: list(tuple)
list of (unit in, unit out, forward conversion, reverse conversion)

angularSize(distance)

source code 

Equivalency for the astropy.units module for converting angular size to physical length and vice versa.

Requires the distance to be given in pc.

Can be used to convert angular sizes and lengths using the units module. >>> equiv = angularSize(1000.) >>> rad = (0.001*u.arcsec).to(u.au,equivalencies=equiv) gives the length in astronomical units.

Note that you don't have to give arcsec or au. You can also ask for u.cm, u.arcminute, etc. The astropy unit conversion module takes care of these conversions as long as no equivalency is needed.

Parameters:
  • distance (float) - The distance to the object in parsec
Returns: list(tuple)
list of (unit in, unit out, forward conversion, reverse conversion)