Skip to content
Snippets Groups Projects
Commit f25cb79d authored by Maaijke Mevius's avatar Maaijke Mevius
Browse files

average instead of subsampl

parent 00c228f4
No related branches found
No related tags found
No related merge requests found
...@@ -42,12 +42,15 @@ def plot_real_time(fig,axarr,rawfile,nch,nSB,freqs,vmin,vmax,maxSamples=10000,sk ...@@ -42,12 +42,15 @@ def plot_real_time(fig,axarr,rawfile,nch,nSB,freqs,vmin,vmax,maxSamples=10000,sk
while(True): while(True):
mybuffer = rawfile.read(maxSamples*bytes_per_sample*nch*nSB) mybuffer = rawfile.read(maxSamples*bytes_per_sample*nch*nSB)
tmpdata = np.frombuffer(mybuffer,dtype=np.float32) #np.float = np.float64!! tmpdata = np.frombuffer(mybuffer,dtype=np.float32) #np.float = np.float64!!
nSam=tmpdata.shape[0]/(nch*nSB) nSam = tmpdata.shape[0]//(nch*nSB)
tmpdata = np.average(tmpdata.reshape(nSam,(nch*nSB))[:-nSam%skiptime,:-(nch*nSB)%skipch].reshape((-1,skiptime,nch*nSB)),axis=1)
tmpdata = np.average(tmpdata.reshape(data.shape[0],-1,skipch),axis=2)
if not hasdata: if not hasdata:
data=tmpdata.reshape(nSam,(nch*nSB))[::skiptime,::skipch] #data=tmpdata.reshape(nSam,(nch*nSB))[::skiptime,::skipch]
data=tmpdata[:]
hasdata=True hasdata=True
else: else:
data=np.concatenate((data,tmpdata.reshape(nSam,(nch*nSB))[::skiptime,::skipch]),axis=0) data=np.concatenate((data,tmpdata,axis=0)
mymedian=np.median(data,axis=0) mymedian=np.median(data,axis=0)
#fig.clf() #fig.clf()
ax=axarr ax=axarr
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment