|
|
|
|
|
<br>
|
|
|
|
|
|
# Outline:
|
|
|
|
|
|
- [detectors](#Detectors)
|
|
|
- [energy](#Energy)
|
|
|
- [diffractometer](#Diffractometer)
|
|
|
- [motor scans](#Motor-Scans)
|
|
|
- [SRS setup](#SRS-setup)
|
|
|
- [MCP](#MCP)
|
|
|
- [Vortex](#Vortex)
|
|
|
- [Plot](#Plot)
|
|
|
|
|
|
<br>
|
|
|
|
|
|
#
|
|
|
|
|
|
|
|
|
<br>
|
|
|
|
|
|
# Detectors:
|
|
|
|
|
|
|
|
|
| Name | Description | Ang. acceptance<br>HxV (deg) | Offset | Max tth | Det Num | Det/ $I_0$ Num |
|
|
|
|:----: |:-------------: |:----------------------------: |:-----------: |:-------: |:-------: |:-------: |
|
|
|
| d4 | small diode | 0.25 x 2.5 | 0 | 151 | D34 | D38 |
|
|
|
| d3 | big diode | 2.5 x 2.5 | 24 | 175 | D33 | D37 |
|
|
|
| mcp | area det | diameter = 6 | 13 | 165 | D35 | D39 |
|
|
|
|vortex |fluorescence detector| 1cm $^2$ | fixed port @ tth=-155 | n/a | D16 | D49 |
|
|
|
| | | | | | | |
|
|
|
|
|
|
<br>
|
|
|
|
|
|
```python
|
|
|
setdet('d3') # select a given detector (d3,d4, or mcp)
|
|
|
# DOES NOT MOVE MOTORS!
|
|
|
mvtth(90) # moves the selected detector
|
|
|
cts(1) # set counting time to 1s
|
|
|
setgain('d3',2,'pA') # set gain for d3
|
|
|
```
|
|
|
|
|
|
See below for a complete list of signals recorded during a scan and their corresponding [detector number](#Detector-Number) (Det Num).
|
|
|
|
|
|
<br>
|
|
|
|
|
|
# Energy:
|
|
|
|
|
|
|
|
|
```python
|
|
|
energy(932) # set undulator (ID), mono, apertures and mirror
|
|
|
polarization('V') # Turns the ID off and then sets the polarization:
|
|
|
# 'RCP', 'LCP', 'H', 'V'
|
|
|
# **need to set energy after a mode change!**
|
|
|
mono(500) # change mono
|
|
|
slit(100) # set energy resolving slits (and vertical beam size)
|
|
|
align_m3r() # realign mirror
|
|
|
centroid() # to see centroid (mirror) position
|
|
|
fit_centroid(n) # to calculate avg centroid position during scan n
|
|
|
|
|
|
|
|
|
scanhv # scan mono only
|
|
|
scanXAS # scan mono with variable step size; ID stays fix, can be offset with offset arg
|
|
|
scanXAS_BL # scan mono & ID with variable step size \
|
|
|
|
|
|
E_Ti=[[445,455,0.5],[455,468,0.1],[468,475,0.5],[475,480,1]]
|
|
|
scanXAS_BL(E_Ti,mcp=True,m3r=True);plot_latest()
|
|
|
```
|
|
|
<br>
|
|
|
|
|
|
# Diffractometer:
|
|
|
|
|
|
- m1 = kphi
|
|
|
- m2 = x
|
|
|
- m3 = y
|
|
|
- m4 = z
|
|
|
- m7 = kap
|
|
|
- m8 = kth
|
|
|
- m9 = tth
|
|
|
<br>
|
|
|
|
|
|
```python
|
|
|
uan(tth,th) # moves th & tth simulatenously
|
|
|
mvx(500) # absolute move
|
|
|
mvrz(500) # relative move
|
|
|
|
|
|
mprint() # prints current motor position
|
|
|
# returns [x,y,z,tth,ktrh,kap,kphi]
|
|
|
mysample=['name',x,y,z,tth,ktrh,kap,kphi]
|
|
|
sample(mysample) # moves to mysample, does not move tth
|
|
|
|
|
|
```
|
|
|
<br>
|
|
|
|
|
|
# Motor Scans:
|
|
|
|
|
|
```python
|
|
|
scanx(-500,500,50) # absolute scan (start,stop,step)
|
|
|
dscanx(-500,500,50) # relative scan (start,stop,step)
|
|
|
|
|
|
scanq() # relative th2th scan
|
|
|
scanth2th() # absolute th2th scan
|
|
|
|
|
|
hkl1=[0,0,1.9]
|
|
|
hkl2=[0,0,2.1]
|
|
|
scanhkl(hkl1,hkl2,50,1)
|
|
|
|
|
|
Clear_Scan_Positioners('Kappa') # remove extra positioner (eg after th2th or hkl scan)
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
<br>
|
|
|
|
|
|
# SRS setup:
|
|
|
|
|
|
With shutter close or slit at 0 (faster), 'INPUT OFFSET' set 'ON' and 'UNCAL'
|
|
|
- make sure the count goes down (not up) when closing the shutter! If the count goes up without beam, change the INVERT ON/OFF - as of 2021_2 all of our SRSs are INVERT ON (D3/D4/TEY/mesh)
|
|
|
- Set gain relatively high for the offset (same as sensitivity or more)
|
|
|
- play with the tweak button one way or the other to get a stable number (ie does not slowly goes down to zero); you might need to play with the +/- for that
|
|
|
- try decreasing the offset gain: if it drops to zero, then go back to previous gain and increase the number; try again.
|
|
|
- the goal is to slowly bring the gain down while keeping a non zero signal; typically a few hundred Hz
|
|
|
- adjust until the final INPUT OFFSET gain should be at least 1 order of magnitude lower than the SENSITIVITY with a few hundreds counts
|
|
|
|
|
|
|
|
|
<br>
|
|
|
|
|
|
# MCP
|
|
|
```python
|
|
|
MPA_HV_ON()
|
|
|
MPA_HV_Set(2975)
|
|
|
MPA_HV_OFF()
|
|
|
MPA_ROI_SetAll() #re-sets all the ROIs as described below:
|
|
|
|
|
|
# MCP center: xcenter=535,ycenter=539
|
|
|
roi=1; MPA_ROI_SetUp(535,539,50,50,roi) #set up ROI1 = 50x 50 at the center of MCP
|
|
|
roi=2; MPA_ROI_SetUp(535,539,100,100,roi) #set up ROI2 = 100x100 at the center of MCP
|
|
|
roi=3; MPA_ROI_SetUp(535,539,200,200,roi) #set up ROI3 = 200x200 at the center of MCP
|
|
|
roi=4; MPA_ROI_SetUp(535,539,400,400,roi) #set up ROI4 = 400x400 at the center of MCP
|
|
|
```
|
|
|
|
|
|
|
|
|
<br>
|
|
|
|
|
|
# Vortex
|
|
|
For detailed instructions see [manual here](https://anl.box.com/s/zr9y3vsyex2ut7axaipifn8f92i2dk8x).
|
|
|
|
|
|
|
|
|
```python
|
|
|
from vortexs29 import *
|
|
|
|
|
|
mcaoff() # Turns off vortex
|
|
|
# Go to workspace 2 left monitor terminal and ctrl-C to kill software
|
|
|
|
|
|
mcaon() # Turns vortex on
|
|
|
# Wait for 5 mins
|
|
|
# Go to terminal in workspace 2: on [sleepy] up arrow to 'startvortex' & hit enter;
|
|
|
# After running change gain to 2.7 and then back to 2.5 (toggle several times if needed, until signal is clean)
|
|
|
|
|
|
vortex(855) # Sets vortex window based upon calibration
|
|
|
t=6;cts(t);mcacounttime(t) # Sets mca count time in secs and other det count time to 6; need to set both
|
|
|
```
|
|
|
3 different acquisition modes:
|
|
|
```python
|
|
|
nomca() # chooses to ignore mca and removes detectors from list
|
|
|
|
|
|
nosavemca() # uses mca ROI1 to record the FY and ROI2 to record PFY
|
|
|
# adds trigger to run mca in scan
|
|
|
|
|
|
savemca() # same + saves mca spectra taken at each point of the scan
|
|
|
# save directory is determined by mda directory in scan record
|
|
|
# MCA spectra are saved into subdirectories of the scan files /Sscan#
|
|
|
```
|
|
|
|
|
|
<br>
|
|
|
|
|
|
# Plot:
|
|
|
|
|
|
## Using basic mda plots:
|
|
|
```python
|
|
|
# n1,n2,n3 is a scan number
|
|
|
# d1,d2,d3 is a detector number - see table below
|
|
|
# use norm=1 to scale multiple scans to [0,1]; log='log'
|
|
|
|
|
|
plot_mda(n,d)
|
|
|
plot_mda(n1,d1,n2,d2....)
|
|
|
plot_mda((n1,d1,n2,d2),(n1,d1,n3,d3)....) # each (n,d,...) is a subplots
|
|
|
plot_mda2D(n,d)
|
|
|
fit_mda(n, d, FWHM_guess,function) # 'gauss', 'lorz', 'erf', 'box'
|
|
|
# xrange=[x1,x2] to fit subrange
|
|
|
fit_mda(n, d, poly_order,'poly')
|
|
|
```
|
|
|
Custom functions for scattering:
|
|
|
```python
|
|
|
plot_latest() # plot last scan with currently selected detector; use norm=31 to normalize with I0
|
|
|
fit_z() # erf fit for last scan on d3
|
|
|
fit_d4() # gaussian fit for last scan on d4
|
|
|
fit_d3() # gaussian fit for last scan on d3
|
|
|
fit_centroid(n) # to calculate avg centroid position during scan n
|
|
|
```
|
|
|
|
|
|
|
|
|
## Using nData:
|
|
|
```python
|
|
|
from Macros_29id.IEX_nData import *
|
|
|
|
|
|
data=IEXdata(1,3) # loads mda scans 1 to 3
|
|
|
data.update(4) # loads another scans
|
|
|
data.update(5,inf) # loads all the file >= 5
|
|
|
|
|
|
x=data.mdaPos(3,0) # 3 = scan number; 0 = 1st positioner
|
|
|
y=data.mdaDet(3,15) # 15 = detector number
|
|
|
|
|
|
%matplotlib # interactive plot
|
|
|
|
|
|
plt.plot(x,y,marker=".")
|
|
|
plt.yscale('log')
|
|
|
plt.ylim(1e-12,1e-5)
|
|
|
plt.xlabel('xname')
|
|
|
plt.ylabel('yname')
|
|
|
plt.legend()
|
|
|
plt.title('sometitle')
|
|
|
plt.grid(color='lightgray', linestyle='-', linewidth=0.5)
|
|
|
plt.show()
|
|
|
|
|
|
%matplotlib inline # inline plot
|
|
|
```
|
|
|
|
|
|
|
|
|
## Using mdaFile:
|
|
|
```python
|
|
|
mydata=mdaFile(1,3) # loads mda scans 1 to 3
|
|
|
mydata.update(4) # loads another scan
|
|
|
mydata.update(5,inf) # loads all the file >= 5
|
|
|
mydata.header[3].all # return dictionary of metadata
|
|
|
mydata.header[3].UB # return dictionary of UB metadata
|
|
|
```
|
|
|
|
|
|
<br>
|
|
|
|
|
|
# Detector Number
|
|
|
|
|
|
| Detector | Det Number Raw signal | Det Number Det/I0 | Description | PV | Controller |
|
|
|
|:--------: |:---------------------: |:-------------------: |:-----------------------------------------------------: |:--------------------------: |:----------: |
|
|
|
| | | | | | |
|
|
|
| Mesh | 31 | n/a | Incident energy (I0) | 29idMZ0:scaler1.S14 | SRS1 |
|
|
|
| TEY | 32 | 36 | Total Electron Yield | 29idMZ0:scaler1.S2 | SRS2 |
|
|
|
| D3 | 33 | 37 | Big diode (2.5 deg) | 29idMZ0:scaler1.S3 | SRS3 |
|
|
|
| D4 | 34 | 38 | Small diode (0.15 deg) | 29idMZ0:scaler1.S4 | SRS4 |
|
|
|
| | | | | | |
|
|
|
| MCP | 35 | 39 | TFY - analog signal | 29idMZ0:scaler1.S5 | MPA |
|
|
|
| MCP ROI1 | 41 | | 50x50 ROI centered on MCP center | 29iddMPA:Stats1:Total_RBV | |
|
|
|
| MCP ROI2 | 42 | | 100x100 ROI centered on MCP center | 29iddMPA:Stats2:Total_RBV | |
|
|
|
| MCP ROI3 | 43 | | 200x200 ROI centered on MCP center | 29iddMPA:Stats3:Total_RBV | |
|
|
|
| MCP ROI4 | 44 | | 400x400 ROI centered on MCP center | 29iddMPA:Stats4:Total_RBV | |
|
|
|
| MCP ROI5 | 45 | | MCP integrated intensity (stats) | 29iddMPA:Stats5:Total_RBV | |
|
|
|
| | | | | | |
|
|
|
| Vortex | 16 | 49 | TFY - centered on desired energy | 29iddMPA:Stats1:Total_RBV | |
|
|
|
| Vortex | 17 | 50 | TFY - centered on Oxygen energy | | |
|
|
|
| | | | | | |
|
|
|
| H | 46 | | Miller index | 29idKappa:userArrayCalc1.L | |
|
|
|
| K | 47 | | Miller index | 29idKappa:userArrayCalc2.L | |
|
|
|
| L | 48 | | Miller index | 29idKappa:userArrayCalc3.L | |
|
|
|
| kth | 51 | | | 29idKappa:m8.RBV | |
|
|
|
| kap | 52 | | | 29idKappa:m7.RBV | |
|
|
|
| kphi | 53 | | | 29idKappa:m1.RBV | |
|
|
|
| tth | 54 | | | 29idKappa:m9.RBV | |
|
|
|
| th | 55 | | | 29idKappa:Euler_ThetaRBV | |
|
|
|
| chi | 56 | | | 29idKappa:Euler_ChiRBV | |
|
|
|
| phi | 57 | | | 29idKappa:Euler_PhiRBV | |
|
|
|
| | | | | | |
|
|
|
|
|
|
|