Commit 5c537b5e authored by Whitfield, Ross's avatar Whitfield, Ross
Browse files

Update autoreduce/reduce_HB2C.py

parent 4b986806
#!/usr/bin/env python2
import os
import sys
import h5py
filename = sys.argv[1]
output_file=os.path.split(filename)[-1].replace('.nxs.h5','')
outdir = sys.argv[2]
powder=True
......@@ -37,9 +39,13 @@ if powder:
else: # Single Crystal
import matplotlib
import matplotlib as mpl
mpl.use( "agg" )
import matplotlib.pyplot as plt
#from matplotlib.image import imsave
import numpy as np
with h5py.File(filename, 'r') as f:
offset=f['/entry/DASlogs/HB2C:Mot:s2.RBV.average'].value
bc = np.zeros((512*480*8),dtype=np.int64)
for b in range(8):
bc += np.bincount(f['/entry/bank'+str(b+1)+'_events/event_id'].value,minlength=512*480*8)
......@@ -48,4 +54,5 @@ else: # Single Crystal
+ bc[::4,1::4] + bc[1::4,1::4] + bc[2::4,1::4] + bc[3::4,1::4]
+ bc[::4,2::4] + bc[1::4,2::4] + bc[2::4,2::4] + bc[3::4,2::4]
+ bc[::4,3::4] + bc[1::4,3::4] + bc[2::4,3::4] + bc[3::4,3::4])
matplotlib.image.imsave(outdir+'file.png', bc)
imsave(outdir+output_file, bc.T)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment