Skip to content

Instantly share code, notes, and snippets.

@davidgardenier
Created April 6, 2017 08:28
Show Gist options
  • Save davidgardenier/fc93c22c222ff5545da0c345d4be1ebd to your computer and use it in GitHub Desktop.
Save davidgardenier/fc93c22c222ff5545da0c345d4be1ebd to your computer and use it in GitHub Desktop.
import math
central_freq = 1400 #1374
bw = 350 #288
si = -1.4
dist = 2.682277221706293
lum_bol = 8e44
z = 0.75
f_high = 10e9
f_low = 10e6
norm = 1/10339369.717529655
# Limits observing bandwidth
f_1 = central_freq - 0.5*bw
f_1 *= 1e6 # MHz -> Hz
f_2 = central_freq + 0.5*bw
f_2 *= 1e6 # MHz -> Hz
# Spectral index
sp = si + 1
sm = si - 1
# Convert distance to metres
dist = dist * 3.08567758149137e25
# Convert luminosity to Watts
lum = lum_bol * 1e-7
freq_frac = (f_2**sp - f_1**sp) / (f_2 - f_1)
nom = lum_bol * (1+z)**sm * freq_frac
den = 4*math.pi*dist**2 * (f_high**sp - f_low**sp)
s_peak = nom/den
# Convert to Janskys
s_peak *= 1e26
print(s_peak)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment