def powerSpec(): ''' plotmap.plotdbt() ''' for i in range(len(redshifts)): fr=IO.readoned("powerSpectraFrequencies_dbt_100b_"+str('%.3f' % redshifts[i])) data = IO.readoned("powerSpectra_100b_"+str('%.3f' % redshifts[i])) ps=data*fr**3./(4.*np.pi**2.) ps=np.sqrt(ps) plot_powerspectra(fr,ps,"ps_dbt_100b_notsquare"+str(i+10)+'_'+str(redshifts[i]),i)
def allPowerSpec(): fr=IO.readoned("powerSpectraFrequencies_dbt_100b_"+str('%.3f' % redshifts[0])) ps=np.zeros(len(redshifts)*len(fr)).reshape(len(redshifts),len(fr)) for i in range(0,len(redshifts),10): ps[i,:] = IO.readoned("powerSpectra_100b_"+str('%.3f' % redshifts[i])) #print len(data), len(fr) ps=ps*fr**3./(4.*np.pi**2.) ps=np.sqrt(ps) plot_powerspectra(fr,ps,"ps_dbt_100b_notsquare_all",'null')
def compare_rms(): length=min(len(redshifts1),len(redshifts2)) if length%2!=0: length=length-1 #rmsdata=np.zeros(length).reshape(length/2,2) rmsdata=np.zeros((length/2,2))#length**2).reshape(length,2) #redshifts_short=np.zeros((length)/2) redshifts_short=np.zeros(length/2) # for i in range(0,length,2): # redshifts_short[i/2]=redshifts2[i] # print "opening ../generate_data/data_"+flag1+"/map_dbt_"+str('%.3f' % redshifts1[i])+".bin and ../generate_data/data_"+flag2+"/map_dbt_"+str('%.3f' % redshifts2[i])+".bin" data1=IO.readoned("rms",path="../generate_data/data_"+flag1+"/")#"../generate_data/data_"+flag1+"/rms.dat") data2=IO.readoned("rms",path="../generate_data/data_"+flag2+"/")#"../generate_data/data_"+flag2+"/rms.da") for i in range(0,length/2): print i rmsdata[i,0]=data1[i*2] rmsdata[i,1]=data2[i*2] # for i in range(length/2): redshifts_short[i] = redshifts1[i*2] # mean1=np.mean(data1) # mean2=np.mean(data2) # # length=len(data) # sum=0.0 # print "summing..." # for x in range(length): # for y in range(length): # for z in range(length): # rmsdata[i/2,0]=rmsdata[i/2,0]+(data1[x,y,z]-mean1)**2 # rmsdata[i/2,1]=rmsdata[i/2,1]+(data2[x,y,z]-mean2)**2 # rmsdata[i/2,:]=np.sqrt(rmsdata[i/2,:]/(length**3)/2.0) # rmsdata[:,i]=np.sqrt(rmsdata[:,i]/(length**3)/2.0) print rmsdata[:,0] print '-----------------------------------' print rmsdata[:,1] plot_1D.plot_mean(rmsdata,"rms_100b","rms (mK)","compare_"+flag1+"_"+flag2+"/",redshifts_short,redshifts_short,label1,label2)