Archive for 九月, 2011

the easiest person to fool

星期二, 九月 27th, 2011

“The first principle is that you must not fool yourself–and you are the easiest person to fool. So you have to be very careful about that. After you’ve not fooled yourself, it’s easy not to fool other scientists. You just have to be honest in a conventional way after that.” –Richard Feynman


关于那些天文上的努力

星期三, 九月 14th, 2011

我意识到一个有趣的现象,

天文领域,搞观测的人努力发现(拼凑)出一个线性关系,搞理论的人努力应用(拼凑)出一个非线性过程。

成名观测者大都有一个以他们名字命名的线性关系,成名模型制造者大多有一个以他们名字命名的非线性效应。

matplotlib 画图

星期二, 九月 6th, 2011

基本上2维点线图这些就够了

import matplotlib.pyplot as Plt
from  matplotlib.mlab import *
import numpy as Mm

######################## cycle

clour=[‘-‘,’-.’,’–‘,’k-‘,’:’]
age=[0.2,0.3,0.4,0.5,0.6]
length=Mm.size(age)
print length
for i in range(0,length):
sedname=’dust_forgrasil_11_newz_’+str(age[i])+’Gyr.data’
sed=load(sedname)
lam=sed[:,0]
flux=sed[:,1]
Plt.plot(lam,flux,clour[i])

############  log
y1=Mm.log10(data1[:,2]*(10**(-9)))

############# load

sed=load(‘dust_forgrasil_11_newz_0.5Gyr.data’)
lam=sed[:,0]
flux=sed[:,1]
################## figure

Plt.figure(1)
a=Plt.subplot(111)

################## text
Plt.text(0.5, Mm.log10(220),’SFR=200 M$_\odot$’,color=’r’)
################# plot
Plt.plot(lam,flux,’k-‘,linewidth=2)

########### plot line
Plt.axhline(y=sfry,color=’r’)
Plt.axvline(y=sfry,color=’r’)

############## plot error
rroryup=data1[0:14,2]
errorylow=data1[0:14,3]

Plt.errorbar(data1[0:14,0]/(1+z),data1[0:14,1]/(1+z),yerr=[errorylow, erroryup],xerr=0,fmt=’ko’)

######## axies

Plt.xlabel(r’$\lambda_{rest}$ [$\mu$m]’,fontsize=20,fontweight=’bold’)
Plt.ylabel(r’$F_{\nu}$ [$\mu$Jy]’,fontsize=20,fontweight=’bold’)
Plt.legend((‘0.2Gyr’,’0.3Gyr’,’0.4Gyr’,’0.5Gyr’,’0.6Gyr’),2)

Plt.ylim((1e-2 ,1e4))

a.set_xscale(“log”)
a.set_yscale(“log”)
Plt.savefig(“paper_age.eps”)

Plt.show()