<p>I am using GalSim for creating mock galaxies in a magnitude range of 28-29. GalSim requires the input flux in units of photons/cm^2/s . I have used the halflight radii as per the value for this redshift range .Coming to the magnitude part,  My science images are in units of MJy/sr having pixelscale of 0.03&quot; and zeropoint of 28.08 AB mags. So I can convert the mag into flux in MJy/sr as ,</p>
<pre><code>flux [MJy/sr]=10^((ZPAB−magAB)/2.5.
</code></pre>
<p>also I have , <code>PHOTMJSR= 0.4047000110149384 / Flux density (MJy/steradian) producing 1 cps</code>.From this I can extract the flux in counts/s by flux_mjy_sr / photmjsr. I have to convert now it into flux in counts/s/cm^2 . How can I do this ? ( I also have my nominal pixel area in arcsecond^2 as 0.0009)</p>

CC BY-SA 4.0
2024-09-03T12:05:01.860Z
If you create mock data, you can obviously also create the mock spectral data. Actually you may even want to do that the right way around: create mock galaxies with their mock spectra and distances, and derive the apparent magnitudes and other derived fluxes and photon counts from that
planetmaker
CC BY-SA 4.0
2024-09-03T12:48:40.777Z
@planetmaker I actually want to insert mock galaxies with different magnitudes into an existing image and then retrieve it. So I have to use the flux/magnitude as an input
Alan
CC BY-SA 4.0
2024-09-03T13:52:12.323Z
yep. And you can retrieve those inputs rather easily from an assumed spectrum (Maybe just a planck curve with some appropriate redshift applied might suffice?), luminosity and distance or redshift. And with that you can *also* derive the photon count.
planetmaker
CC BY-SA 4.0
2024-09-03T13:59:22.920Z
Of course you can walk the way backward: assume a flux and magnitude, then use that to calculate a synthetic spectrum which is fitted to your flux data by deconvoling it with the optical filters and derive the flux from that. Thus to me it seems easier to assume the original properties and calculate derivatives from that - especially as it gives you greater flexibility to adjust your test data to a wider ranger of real sources as you only have to apply the filters as they are applied by real instruments, too, instead of backward-engineering it.
planetmaker
CC BY-SA 4.0
2024-09-04T09:48:01.630Z
Thanks. I'll try this way
Alan
<photometry><james-webb-space-telescope><units>
conversion from magnitude to flux
Alan
# conversion from magnitude to flux

(Asked by: username_0 on 2024-09-03)

I am using GalSim for creating mock galaxies in a magnitude range of 28-29. GalSim requires the input flux in units of photons/cm^2/s . I have used the halflight radii as per the value for this redshift range .Coming to the magnitude part, My science images are in units of MJy/sr having pixelscale of 0.03" and zeropoint of 28.08 AB mags. So I can convert the mag into flux in MJy/sr as ,

```
flux [MJy/sr]=10^((ZPAB−magAB)/2.5.

```

also I have , `PHOTMJSR= 0.4047000110149384 / Flux density (MJy/steradian) producing 1 cps`.From this I can extract the flux in counts/s by flux\_mjy\_sr / photmjsr. I have to convert now it into flux in counts/s/cm^2 . How can I do this ? ( I also have my nominal pixel area in arcsecond^2 as 0.0009)

**Tags:** photometry, james-webb-space-telescope, units

> **Comments:**
> **username_1**: If you create mock data, you can obviously also create the mock spectral data. Actually you may even want to do that the right way around: create mock galaxies with their mock spectra and distances, and derive the apparent magnitudes and other derived fluxes and photon counts from that  
> **username_0**: @username_1 I actually want to insert mock galaxies with different magnitudes into an existing image and then retrieve it. So I have to use the flux/magnitude as an input  
> **username_1**: yep. And you can retrieve those inputs rather easily from an assumed spectrum (Maybe just a planck curve with some appropriate redshift applied might suffice?), luminosity and distance or redshift. And with that you can *also* derive the photon count.  
> **username_1**: Of course you can walk the way backward: assume a flux and magnitude, then use that to calculate a synthetic spectrum which is fitted to your flux data by deconvoling it with the optical filters and derive the flux from that. Thus to me it seems easier to assume the original properties and calculate derivatives from that - especially as it gives you greater flexibility to adjust your test data to a wider ranger of real sources as you only have to apply the filters as they are applied by real instruments, too, instead of backward-engineering it.  
> **username_0**: Thanks. I'll try this way  

---

## 0 answers

