astropy/astropy — pull request #1327 by keflavich (2013-08-07 22:42:37+00:00)
Title: Added a new "Antenna Gain" equivalency (Jy to K)

Jansky and Kelvin are often treated as equivalent units for a given telescope & observing frequency, and it is convenient to be able to convert between them. No docs yet, just added a docstr with examples.

One problem I've already run into:
```
In [78]: u.K.to(u.Jy,jytok((50*u.arcsec)**2,5*u.GHz))
ERROR: UnitsException: 'K' (temperature) and 'Jy' (spectral flux density) are not convertible [astropy.units.core]
Traceback (most recent call last):
File "", line 1, in
u.K.to(u.Jy,jytok((50*u.arcsec)**2,5*u.GHz))
File "/Users/adam/repos/astropy/astropy/units/core.py", line 523, in to
return self.get_converter(other, equivalencies=equivalencies)(value)
File "/Users/adam/repos/astropy/astropy/units/core.py", line 490, in get_converter
self, other, equivalencies)
File "/Users/adam/repos/astropy/astropy/units/core.py", line 454, in _apply_equivalences
unit_str, other_str))
UnitsException: 'K' (temperature) and 'Jy' (spectral flux density) are not convertible

> /Users/adam/repos/astropy/astropy/units/core.py(454)_apply_equivalences()
453 "{0} and {1} are not convertible".format(
--> 454 unit_str, other_str))
455

In [79]: (1*u.K).to(u.Jy,jytok((50*u.arcsec)**2,5*u.GHz))
Out[79]:
```