[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[gnuastro-commits] master b52cf301: Library (units.h): derivation of jan
From: |
Mohammad Akhlaghi |
Subject: |
[gnuastro-commits] master b52cf301: Library (units.h): derivation of jansky to wavelen. flux den. added |
Date: |
Tue, 6 Aug 2024 15:15:24 -0400 (EDT) |
branch: master
commit b52cf3014fde4b51e728bada980538709a1c941d
Author: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Commit: Mohammad Akhlaghi <mohammad@akhlaghi.org>
Library (units.h): derivation of jansky to wavelen. flux den. added
Until now we had just used the raw equation to convert Janskys to
wavelength flux density. This was vague and not easy to understand.
With this commit, a comment has been added on top to derive the equation
that is used. We should later bring this into the book.
---
lib/units.c | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
diff --git a/lib/units.c b/lib/units.c
index 3776f24f..bd73d2b0 100644
--- a/lib/units.c
+++ b/lib/units.c
@@ -514,6 +514,33 @@ gal_units_jy_to_mag(double jy)
+/* Converting Janskys ($f(\nu)$ or flux in units of frequency) to
+ $f(\lambda)$ (or wavelength flux density). In the equations below, we'll
+ write $\nu$ as 'n' and '\lambda' as 'l'. The speed of light is written
+ as 'c'.
+
+ Basics:
+
+ 1. c = 2.99792458e+08 m/s = 2.99792458e+18 A*Hz
+
+ 2. One Jansky is defined as 10^{-23} erg/s/cm^2/Hz; see
+ https://en.wikipedia.org/wiki/Jansky
+
+ 3. The speed of light connects the wavelength and frequency of photons:
+ c=l*n. So n=c/l and taking the derivative: dn=(c/(l*l))*dl or
+ dn/dl=c/(l*l). Inserting physical values and units:
+
+ dn/dl = (2.99792458e+18 A*Hz)/(l*l A^2) = 2.99792458e+18/(l^2) Hz/A.
+
+ 4. To convert a function of A into a function of B, where A and B are
+ also related to each other, we have the following equation: f(A) =
+ dB/dA * f(B).
+
+ 5. Using 2 (definition of Jansky as f(n)) and 3 in 4, we get:
+
+ f(l) = 2.99792458e+18/(l^2) Hz/A * 10^{-23} erg/s/cm^2/Hz
+ = 2.99792458e-5/(l^2) erg/s/cm^2/A
+*/
double
gal_units_jy_to_wavelength_flux_density(double jy, double angstrom)
{
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [gnuastro-commits] master b52cf301: Library (units.h): derivation of jansky to wavelen. flux den. added,
Mohammad Akhlaghi <=