Advertisement
Guest User

Untitled

a guest
May 5th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.55 KB | None | 0 0
  1. def get_luminosity_distance(redshift):
  2.     '''finds luminosity distance'''
  3.     lum_dist = cosmo.luminosity_distance(redshift)
  4.     tmp = str(lum_dist)
  5.     tmp = tmp.replace("Mpc","")
  6.     tmp = float(tmp)
  7.     return tmp*3.09*10**22
  8.     print lum_dist
  9.  
  10. def get_alpha(s1,s2,v1,v2):
  11.     '''gets alpha from two flux densities'''
  12.     top = math.log10(s1/s2)
  13.     bottom = math.log10(v2/v1)
  14.     return top/bottom
  15.  
  16. def get_luminosity(D_l,z,a,nu1,nu2,Sv2):
  17.     '''gets luminosity from alpha'''
  18.     Sv2 = (Sv2/1000)*CF
  19.     lum = (4*math.pi*((D_l**2)))*(1/((1+z)**(1+a)))*((nu1/nu2)**a)*(Sv2)
  20.     return lum
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement