<p>You should not be dividing by wavelength in your first step. The values in each given wavelength interval have already the dimension of luminosity (<span class="math-container">$erg/s$</span>), so you just have to divide these by <span class="math-container">$4\pi d^2$</span> to get the flux (<span class="math-container">$erg/s/cm^2$</span>). Then just add up all the intervals  and convert the final result to absolute magnitude (I don't know why you would need filter transmission curves for this if you have synthetic spectra rather than measured ones).</p>

CC BY-SA 4.0
2023-08-22T06:22:42.393Z
Transmission functions are required because filter bandpasses are not top hats.
ProfRob
CC BY-SA 4.0
2023-09-04T09:30:01.043Z
Yep, I'm trying to get an idea of what the absolute magnitudes will be for different spectral types when Euclid data reaches me, so I'm using the Euclid transmission functions.
Rumi
CC BY-SA 4.0
2023-08-21T08:54:01.130Z
2023-08-21T09:02:43.237Z
2023-08-21T09:02:43.237Z
Thomas
<p>Pretty sure it is step 3. I can't understand your integrals. If <span class="math-container">$F$</span> is the spectral flux and <span class="math-container">$T$</span> is the transmission function at each wavelength, then the average flux through the filter is just
<span class="math-container">$$ f = \frac{\int FT\ d\lambda}{\int T\ d\lambda}\ . $$</span>
This has units of erg/s/cm<span class="math-container">$^2$</span>/A.</p>
<p>I have no idea why <span class="math-container">$c$</span> features unless there is something about the units you haven't told us. It is possible you are trying to convert to an average flux  <span class="math-container">$f_\nu$</span> in frequency units because that is how the zeropoint is defined? In which case, you can convert <span class="math-container">$F$</span> into <span class="math-container">$F_\nu$</span>
<span class="math-container">$$F_\nu = F \left|\frac{d\lambda}{d\nu}\right| = \frac{F\lambda^2}{c}\ . $$</span></p>
<p>Then:
<span class="math-container">$$f_\nu = \frac{\int F_\nu T\ d\nu}{\int T\ d\nu} $$</span>
as long as you have the transmission defined as a function of frequency.</p>
<p>More information is required in the question.</p>

CC BY-SA 4.0
2023-09-04T09:20:44.390Z
I'm likely overcomplicating things, but I'm working in the AB magnitude system and from what I've read it's all quoted in terms of $f_\nu$ and so the $c$ comes from converting between $f_\nu$ and $f_\lambda$. So I'm starting with a synthetic spectrum, with units [ergs/s], and then dividing by area and wavelength to get to a wavelength flux density, and then I'm plugging it into the equations I've listed in my original question. There are some details in the [Pyphot documentation pages](https://mfouesneau.github.io/pyphot/photometry.html).
Rumi
CC BY-SA 4.0
2023-08-22T06:18:50.530Z
2023-08-22T08:18:27.880Z
2023-08-22T08:18:27.880Z
ProfRob
<p>I have some synthetic spectra of stars (M and K giants) with columns wavelength [Angstroms], continuum normalised flux and specific luminosity <span class="math-container">$\times$</span> frequency [ergs/s]; I also have some Euclid filter transmission curves.</p>
<p>I wish to extract the flux within the filter, and then convert it into AB magnitudes. My process for doing this has been:</p>
<ul>
<li>convert specific luminosity <span class="math-container">$\times$</span>  frequency into flux density by dividing by wavelength and area <span class="math-container">$4 \pi d^2$</span>, assuming the star is at 10pc to end up with the absolute magnitude. After this step it now has units [erg/s/Å/cm<sup>2</sup>].</li>
<li>Resample the data to match the wavelength grid of the system response.</li>
<li>Calculate the flux in the bandpass according to</li>
</ul>
<p><span class="math-container">$$f_\nu = \frac{1}{c}\frac{\int FT\lambda\,d\lambda}{\int T / \lambda\,d\lambda}$$</span></p>
<ul>
<li>Then finally calculate the magnitude as <span class="math-container">$m = -2.5log(f_\nu) + \text{Euclid zp}$</span></li>
</ul>
<p>However, I'm not getting sensible values (absolute mag around 12.5 in Euclid J-band). I've also tried using Pyphot, which gives me roughly the same values, and their source code is very similar to what I originally had. It makes me think there is something wrong with the assumptions I'm making about getting flux density from specific luminosity multiplied by frequency. I'd really appreciate it if anyone could set me on the right path.</p>

CC BY-SA 4.0
2023-08-18T20:02:44.970Z
No particular obvious answer to your problem but yes, your M_J=12.5 is way too faint for giants. From [this table](https://www.pas.rochester.edu/~emamajek/EEM_dwarf_UBVIJHK_colors_Teff.txt) for *dwarfs*, expected M_J is between 6 (M0V) and 11.6 (M9V)
astrosnapper
CC BY-SA 4.0
2023-08-19T08:52:25.810Z
Thank you - I suspected it was far too faint. It's frustrating as I'm pretty sure the maths is correct.
Rumi
CC BY-SA 4.0
2023-08-21T23:03:53.380Z
Interesting question and *Welcome to Stack Exchange!* I changed $Euclid zp$ into $\text{Euclid zp}$ using  `$\text{Euclid zp}$` but I am not sure what it is - could you clarify it for those of us unfamiliar with the term? *Thanks!*
uhoh
CC BY-SA 4.0
2023-08-22T06:02:23.780Z
Please explain what $F$ and $T$ are.
ProfRob
CC BY-SA 4.0
2023-09-04T08:58:47.880Z
Euclid zp is the zero point that's given in the Euclid telescope release papers. T is the total response for the system, also released with those papers. F is the flux density from the first bullet point.
Rumi
<spectra><flux>
How to get the flux from a synthetic spectrum in a bandpass, when only given specific luminosity times frequency?
Rumi
# How to get the flux from a synthetic spectrum in a bandpass, when only given specific luminosity times frequency?

(Asked by: username_0 on 2023-08-18)

I have some synthetic spectra of stars (M and K giants) with columns wavelength [Angstroms], continuum normalised flux and specific luminosity $\times$ frequency [ergs/s]; I also have some Euclid filter transmission curves.

I wish to extract the flux within the filter, and then convert it into AB magnitudes. My process for doing this has been:

* convert specific luminosity $\times$ frequency into flux density by dividing by wavelength and area $4 \pi d^2$, assuming the star is at 10pc to end up with the absolute magnitude. After this step it now has units [erg/s/Å/cm2].
* Resample the data to match the wavelength grid of the system response.
* Calculate the flux in the bandpass according to

$$f\_\nu = \frac{1}{c}\frac{\int FT\lambda\,d\lambda}{\int T / \lambda\,d\lambda}$$

* Then finally calculate the magnitude as $m = -2.5log(f\_\nu) + \text{Euclid zp}$

However, I'm not getting sensible values (absolute mag around 12.5 in Euclid J-band). I've also tried using Pyphot, which gives me roughly the same values, and their source code is very similar to what I originally had. It makes me think there is something wrong with the assumptions I'm making about getting flux density from specific luminosity multiplied by frequency. I'd really appreciate it if anyone could set me on the right path.

**Tags:** spectra, flux

> **Comments:**
> **username_1**: No particular obvious answer to your problem but yes, your M_J=12.5 is way too faint for giants. From [this table](https://www.pas.rochester.edu/~emamajek/EEM_dwarf_UBVIJHK_colors_Teff.txt) for *dwarfs*, expected M_J is between 6 (M0V) and 11.6 (M9V)  
> **username_0**: Thank you - I suspected it was far too faint. It's frustrating as I'm pretty sure the maths is correct.  
> **username_2**: Interesting question and *Welcome to Stack Exchange!* I changed $Euclid zp$ into $\text{Euclid zp}$ using  `$\text{Euclid zp}$` but I am not sure what it is - could you clarify it for those of us unfamiliar with the term? *Thanks!*  
> **username_3**: Please explain what $F$ and $T$ are.  
> **username_0**: Euclid zp is the zero point that's given in the Euclid telescope release papers. T is the total response for the system, also released with those papers. F is the flux density from the first bullet point.  

---

## 2 answers

### Answer by username_4 on 2023-08-21. Score: 1

You should not be dividing by wavelength in your first step. The values in each given wavelength interval have already the dimension of luminosity ($erg/s$), so you just have to divide these by $4\pi d^2$ to get the flux ($erg/s/cm^2$). Then just add up all the intervals and convert the final result to absolute magnitude (I don't know why you would need filter transmission curves for this if you have synthetic spectra rather than measured ones).

> **Comments:**
> **username_3**: Transmission functions are required because filter bandpasses are not top hats.  
> **username_0**: Yep, I'm trying to get an idea of what the absolute magnitudes will be for different spectral types when Euclid data reaches me, so I'm using the Euclid transmission functions.  

---

### Answer by username_3 on 2023-08-22. Score: 0

Pretty sure it is step 3. I can't understand your integrals. If $F$ is the spectral flux and $T$ is the transmission function at each wavelength, then the average flux through the filter is just
$$ f = \frac{\int FT\ d\lambda}{\int T\ d\lambda}\ . $$
This has units of erg/s/cm$^2$/A.

I have no idea why $c$ features unless there is something about the units you haven't told us. It is possible you are trying to convert to an average flux $f\_\nu$ in frequency units because that is how the zeropoint is defined? In which case, you can convert $F$ into $F\_\nu$
$$F\_\nu = F \left|\frac{d\lambda}{d\nu}\right| = \frac{F\lambda^2}{c}\ . $$

Then:
$$f\_\nu = \frac{\int F\_\nu T\ d\nu}{\int T\ d\nu} $$
as long as you have the transmission defined as a function of frequency.

More information is required in the question.

> **Comments:**
> **username_0**: I'm likely overcomplicating things, but I'm working in the AB magnitude system and from what I've read it's all quoted in terms of $f_\nu$ and so the $c$ comes from converting between $f_\nu$ and $f_\lambda$. So I'm starting with a synthetic spectrum, with units [ergs/s], and then dividing by area and wavelength to get to a wavelength flux density, and then I'm plugging it into the equations I've listed in my original question. There are some details in the [Pyphot documentation pages](https://mfouesneau.github.io/pyphot/photometry.html).  

---

