Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Whitfield, Ross
wand
Commits
3ed2606a
Commit
3ed2606a
authored
Aug 07, 2018
by
Whitfield, Ross
Browse files
Update autoreduce/reduce_HB2C.py
parent
a104c962
Changes
1
Hide whitespace changes
Inline
Side-by-side
autoreduce/reduce_HB2C.py
View file @
3ed2606a
...
...
@@ -37,6 +37,7 @@ else: # Single Crystal
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'
].
value
[
0
]
...
...
@@ -56,17 +57,20 @@ else: # Single Crystal
vanadium
=
np
.
load
(
'/HFIR/HB2C/shared/autoreduce/vanadium_101567.npy'
)
vanadium_mon
=
163519902
bc
=
bc
/
vanadium
*
vanadium_mon
/
mon
f
,
(
ax1
,
ax2
)
=
plt
.
subplots
(
2
,
figsize
=
(
8
,
4
))
"""
f, (ax2) = plt.subplots(1, figsize=(8, 3))
ax1.set_title(u'{}, {}, s2={:.2f}, duration={:.1f}s'.format(title, output_file, offset, duration))
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)
im
=
ax2
.
imshow
(
bc
.
T
[:
:
-
1
,
::
-
1
],
cmap
=
'viridis'
,
aspect
=
1
/
7.5
,
extent
=
(
offset
,
120
+
offset
,
0
,
128
))
im = ax2.imshow(bc.T[:, ::-1], cmap='viridis', aspect=1/7.5, extent=(offset, 120+offset, 0, 128))
ax2.set_xlabel(u'2theta')
ax2
.
set_xlim
(
offset
,
120
+
offset
)
ax2.set_xlim(
120+
offset, offset)
ax2.set_ylim(0, 128)
ax2.get_yaxis().set_visible(False)
cb = f.colorbar(im)
ax2.set_aspect('auto')
f.tight_layout()
plt.savefig(outdir+output_file)
"""
imsave
(
outdir
+
output_file
,
bc
.
T
,
cmap
=
'viridis'
)
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment