Skip to content

Instantly share code, notes, and snippets.

@ZGainsforth
Created August 1, 2014 00:22
Show Gist options
  • Select an option

  • Save ZGainsforth/daa7d0a0a5906070907b to your computer and use it in GitHub Desktop.

Select an option

Save ZGainsforth/daa7d0a0a5906070907b to your computer and use it in GitHub Desktop.
Read Bruker raw datacube into numpy
from numpy import *
from matplotlib.pyplot import *
# Read in the raw
x = fromfile('Stack 1 - 360s.raw', dtype='int8')
# reshape to x, y, E
x.shape=(300,300,2048)
# Make integrated image and show it.
y = sum(x, axis=-1)
imshow(y)
show()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment