Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Whitfield, Ross
wand
Commits
5c537b5e
Commit
5c537b5e
authored
Aug 03, 2018
by
Whitfield, Ross
Browse files
Update autoreduce/reduce_HB2C.py
parent
4b986806
Changes
1
Hide whitespace changes
Inline
Side-by-side
autoreduce/reduce_HB2C.py
View file @
5c537b5e
#!/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
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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