Skip to content

Instantly share code, notes, and snippets.

@cbassa
Created August 11, 2018 09:16
Show Gist options
  • Save cbassa/5b015497d20dd9847d3e4fa03b5d97e8 to your computer and use it in GitHub Desktop.
Save cbassa/5b015497d20dd9847d3e4fa03b5d97e8 to your computer and use it in GitHub Desktop.
# Open file
f=open(fname)
# Read number of channels
nchan=int(np.fromfile(f,dtype='float32',count=1)[0])
# Read channel frequencies
freq=np.fromfile(f,dtype='float32',count=nchan)/1000.0
# Read entire file
data=np.fromfile(f,dtype='float32').reshape(-1,nchan+1)
# Close file
f.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment