Commit 98788df4 authored by Whitfield, Ross's avatar Whitfield, Ross
Browse files

Update autoreduce/.#create_vanadium_npy.py autoreduce/create_vanadium_npy.py...

Update autoreduce/.#create_vanadium_npy.py autoreduce/create_vanadium_npy.py autoreduce/reduce_HB2C.py
parent 3d0ff1bc
rwp@diffuse.2587:1532959676
\ No newline at end of file
with h5py.File(filename, 'r') as f:
offset=f['/entry/DASlogs/HB2C:Mot:s2.RBV/average_value'].value[0]
title=f['/entry/title'].value[0]
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)
bc = bc.reshape((480*8, 512))
bc = (bc[::4,::4] + bc[1::4,::4] + bc[2::4,::4] + bc[3::4,::4]
+ 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])
......@@ -13,7 +13,7 @@ with h5py.File(filename, 'r') as f:
if '/entry/DASlogs/HB2C:CS:ITEMS:Nature' in f:
nature = f['/entry/DASlogs/HB2C:CS:ITEMS:Nature/value'].value[0][0]
if nature == 'Powder':
powder=True
powder=False
if powder:
......@@ -37,6 +37,7 @@ else: # Single Crystal
import matplotlib as mpl
mpl.use( "agg" )
import matplotlib.pyplot as plt
from matplotlib.colors import LogNorm
import numpy as np
with h5py.File(filename, 'r') as f:
offset=f['/entry/DASlogs/HB2C:Mot:s2.RBV/average_value'].value[0]
......@@ -54,7 +55,7 @@ else: # Single Crystal
ax1.plot(np.linspace(offset,120+offset,960),bc.sum(1)[::-1])
ax1.set_xlim(offset,120+offset)
plt.setp(ax1.get_xticklabels(), visible=False)
ax2.imshow(bc.T[::-1,::-1], cmap='viridis',aspect=1/7.5,extent=(offset,120+offset,0,128),vmin=0,vmax=np.sqrt(bc.max()))
ax2.imshow(bc.T[::-1,::-1], cmap='viridis',aspect=1/7.5,extent=(offset,120+offset,0,128),norm=LogNorm(vmin=1, vmax=bc.max()))
ax2.set_xlabel(u'2theta')
ax2.set_xlim(offset,120+offset)
ax2.set_ylim(0,128)
......
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