Labels

Thursday, July 18, 2019

Transfer [MHz, Jy] to [eV, erg]

#transfer [frequency(MHz), Jy] to [eV, erg/cm^2/s]
import numpy as np import sys                                                                                                                                                             src=sys.argv[1]
mu,F_mu,eF = np.loadtxt(src,usecols=(0,1,2),unpack=True)
with open(src[:src.find('_')]+'_radio.txt','w') as rf:
freq_to_ev = 4.135667516*1e-15 # 1HZ to eV
Jy_to = 1e-23 # Jy to erg/cm^2/s/Hz
for x,y,z in zip(mu,F_mu,eF): 
# for MHz *1e6 to Hz
rf.write(str(x*freq_to_ev*1e6)+'\t'+str(y*x*1e6*Jy_to)+'\t'+str(z*x*1e6*Jy_to)+'\n')


No comments:

Post a Comment