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
86f78cbb
Commit
86f78cbb
authored
Aug 06, 2018
by
Whitfield, Ross
Browse files
Update autoreduce/reduce_HB2C.py notebooks/Single Crystal Reduction - NaCl.ipynb
parent
f9b875c9
Changes
2
Hide whitespace changes
Inline
Side-by-side
autoreduce/reduce_HB2C.py
View file @
86f78cbb
...
...
@@ -53,8 +53,8 @@ else: # Single Crystal
+
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
])
vanadium
=
np
.
load
(
'/HFIR/HB2C/shared/autoreduce/vanadium.npy'
)
vanadium_mon
=
1
03054259
vanadium
=
np
.
load
(
'/HFIR/HB2C/shared/autoreduce/vanadium
_101567
.npy'
)
vanadium_mon
=
1
63519902
bc
=
bc
/
vanadium
*
vanadium_mon
/
mon
f
,
(
ax1
,
ax2
)
=
plt
.
subplots
(
2
,
figsize
=
(
8
,
4
))
ax1
.
set_title
(
u
'{}, {}, s2={:.2f}, duration={:.1f}s'
.
format
(
title
,
output_file
,
offset
,
duration
))
...
...
notebooks/Single Crystal Reduction - NaCl.ipynb
View file @
86f78cbb
...
...
@@ -35,7 +35,7 @@
},
{
"cell_type": "code",
"execution_count":
18
2,
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -51,7 +51,7 @@
},
{
"cell_type": "code",
"execution_count":
3
,
"execution_count":
null
,
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -68,32 +68,9 @@
},
{
"cell_type": "code",
"execution_count":
4
,
"execution_count":
null
,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"MDHistoWorkspace\n",
"Title: \n",
"Dim 0: (y) 0.5 to 128.5 in 128 bins\n",
"Dim 1: (x) 0.5 to 960.5 in 960 bins\n",
"Dim 2: (scanIndex) 0.5 to 1305.5 in 1305 bins\n",
"\n",
"Inelastic: ki-kf\n",
"Instrument: WAND (2018-Apr-01 to 2100-Jan-31)Instrument from: /home/rwp/mantid/instrument/WAND_Definition_2018_04_01.xml\n",
"\n",
"Parameters from: /home/rwp/mantid/instrument/WAND_Parameters.xml\n",
"Run start: 2018-May-02 13:34:10\n",
"Run end: not available\n",
"Sample: a 5.6, b 5.6, c 5.6; alpha 90, beta 90, gamma 90\n"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"outputs": [],
"source": [
"LoadWANDSCD(IPTS=ipts, RunNumbers=26509, OutputWorkspace='norm',Grouping='4x4') # Vanadium\n",
"LoadWANDSCD(IPTS=ipts, RunNumbers='26640-27944', OutputWorkspace='data',Grouping='4x4')"
...
...
@@ -108,7 +85,7 @@
},
{
"cell_type": "code",
"execution_count":
5
,
"execution_count":
null
,
"metadata": {},
"outputs": [],
"source": [
...
...
@@ -492,6 +469,13 @@
"cbar.set_label('Intensity (arb. units)')"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": 168,
%% Cell type:markdown id: tags:
# NaCl example
%% Cell type:markdown id: tags:
#### Import required packages
%% Cell type:code id: tags:
``` python
%matplotlib inline
from mantid.simpleapi import *
import matplotlib.pyplot as plt
from mantid import plots
```
%% Cell type:markdown id: tags:
Set a larger default figure size
%% Cell type:code id: tags:
``` python
plt.rcParams['figure.figsize'] = [15, 12]
```
%% Cell type:markdown id: tags:
#### Set IPTS number
%% Cell type:code id: tags:
``` python
ipts = 7776
```
%% Cell type:markdown id: tags:
#### Load data and vanadium
###### Data is loaded into a MDHistoWorkspace that have dimensions corresponding to x pixels, y pixels and sample rotation
%% Cell type:code id: tags:
``` python
LoadWANDSCD(IPTS=ipts, RunNumbers=26509, OutputWorkspace='norm',Grouping='4x4') # Vanadium
LoadWANDSCD(IPTS=ipts, RunNumbers='26640-27944', OutputWorkspace='data',Grouping='4x4')
```
%% Output
MDHistoWorkspace
Title:
Dim 0: (y) 0.5 to 128.5 in 128 bins
Dim 1: (x) 0.5 to 960.5 in 960 bins
Dim 2: (scanIndex) 0.5 to 1305.5 in 1305 bins
Inelastic: ki-kf
Instrument: WAND (2018-Apr-01 to 2100-Jan-31)Instrument from: /home/rwp/mantid/instrument/WAND_Definition_2018_04_01.xml
Parameters from: /home/rwp/mantid/instrument/WAND_Parameters.xml
Run start: 2018-May-02 13:34:10
Run end: not available
Sample: a 5.6, b 5.6, c 5.6; alpha 90, beta 90, gamma 90
%% Cell type:markdown id: tags:
##### Integrate out a slice of data in the y (verticle) pixels. Only 2D can be plotted using `mantid` projections.
%% Cell type:code id: tags:
``` python
data_slice = IntegrateMDHistoWorkspace('data',P1Bin=[60,69])
```
%% Cell type:markdown id: tags:
#### plot the data slice
%% Cell type:code id: tags:
``` python
fig, ax = plt.subplots(subplot_kw={'projection':'mantid'})
c = ax.pcolormesh(data_slice, vmax=10, cmap='viridis')
cbar=fig.colorbar(c)
cbar.set_label('Intensity (arb. units)')
```
%% Output