Skip to content

Instantly share code, notes, and snippets.

@ZGainsforth
Created May 6, 2015 18:37
Show Gist options
  • Select an option

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

Select an option

Save ZGainsforth/65c3ce5ab7f77b42b05f to your computer and use it in GitHub Desktop.
How to read an NCEM EMD file
# coding: utf-8
import h5py
h5py.File('stack.emd', 'r')
f = h5py.File('stack.emd', 'r')
f[0]
f['data']
f['data'][0]
f['data'][1]
f['data']
data in f
'data' in f
f['data']
f.attrs.keys()
f['data']['filename']
import hd5
import h5py
f= h5py.File('stack.emd', 'r')
f['data']['ALCHEMI EDS']['data'][1,1,:]
plot(f['data']['ALCHEMI EDS']['data'][1,1,:])
f['microscope']['att']
f['microscope']['attr']
f['microscope'].attrs['Camera length']
get_ipython().magic(u'save HowToReademdFile.py 0-22')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment