Skip to content

Commit fcd0312

Browse files
committed
correct brightness temperature equivalency docs to have correct beam
areas for different assumptions
1 parent 62c7e7c commit fcd0312

2 files changed

Lines changed: 31 additions & 9 deletions

File tree

‎astropy/units/equivalencies.py‎

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -428,21 +428,25 @@ def brightness_temperature(beam_area, disp):
428428
429429
>>> import numpy as np
430430
>>> from astropy import units as u
431-
>>> beam_area = np.pi*(50*u.arcsec)**2
431+
>>> beam_sigma = 50*u.arcsec
432+
>>> beam_area = 2*np.pi*(beam_sigma)**2
432433
>>> freq = 5*u.GHz
433434
>>> equiv = u.brightness_temperature(beam_area, freq)
434435
>>> u.Jy.to(u.K, equivalencies=equiv) # doctest: +FLOAT_CMP
435-
7.052588858846446
436+
3.526294429423223
436437
>>> (1*u.Jy).to(u.K, equivalencies=equiv) # doctest: +FLOAT_CMP
437-
<Quantity 7.052588858846446 K>
438+
<Quantity 3.526294429423223 K>
438439
439440
VLA synthetic beam::
440441
441-
>>> beam_area = np.pi*(15*u.arcsec)**2
442+
>>> bmaj = 15*u.arcsec
443+
>>> bmin = 15*u.arcsec
444+
>>> fwhm_to_sigma = 1./(8*np.log(2))**0.5
445+
>>> beam_area = 2.*np.pi*(bmaj*bmin/fwhm_to_sigma**2)
442446
>>> freq = 5*u.GHz
443447
>>> equiv = u.brightness_temperature(beam_area, freq)
444448
>>> u.Jy.to(u.K, equivalencies=equiv) # doctest: +FLOAT_CMP
445-
78.36209843162719
449+
7.065788175060084
446450
"""
447451
beam = beam_area.to(si.sr).value
448452
nu = disp.to(si.GHz, spectral())

‎docs/units/equivalencies.rst‎

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,14 +173,32 @@ only dependent on the aperture size. See `Tools of Radio Astronomy
173173
<http://books.google.com/books?id=9KHw6R8rQEMC&pg=PA179&source=gbs_toc_r&cad=4#v=onepage&q&f=false>`__
174174
for details.
175175

176-
The `~astropy.units.equivalencies.brightness_temperature` equivalency
177-
requires the beam area and frequency as arguments. Example::
176+
The `~astropy.units.equivalencies.brightness_temperature` equivalency requires
177+
the beam area and frequency as arguments. Recalling that the area of a 2D
178+
gaussian is :math:`2 \pi \sigma^2` (see `wikipedia
179+
<http://en.wikipedia.org/wiki/Gaussian_function#Two-dimensional_Gaussian_function>`_),
180+
here is an example::
178181

179182
>>> import numpy as np
180-
>>> omega_B = np.pi * (50 * u.arcsec)**2
183+
>>> beam_sigma = 50*u.arcsec
184+
>>> omega_B = 2 * np.pi * beam_sigma**2
181185
>>> freq = 5 * u.GHz
182186
>>> u.Jy.to(u.K, equivalencies=u.brightness_temperature(omega_B, freq))
183-
7.052588858...
187+
3.526294...
188+
189+
If you have beam full-width half-maxima (FWHM), which are often quoted and are
190+
the values stored in the FITS header keywords BMAJ and BMIN, a more appropriate
191+
example converts the FWHM to sigma::
192+
193+
>>> import numpy as np
194+
>>> beam_fwhm = 50*u.arcsec
195+
>>> fwhm_to_sigma = 1./(8*np.log(2))**0.5
196+
>>> beam_sigma = beam_fwhm*fwhm_to_sigma
197+
>>> omega_B = 2 * np.pi * beam_sigma**2
198+
>>> freq = 5 * u.GHz
199+
>>> u.Jy.to(u.K, equivalencies=u.brightness_temperature(omega_B, freq))
200+
19.55392833...
201+
184202

185203
Temperature Energy Equivalency
186204
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

0 commit comments

Comments
 (0)