|
|
---
|
|
|
---
|
|
|
|
|
|
# content
|
|
|
|
|
|
- [detectors](#detectors)
|
|
|
- [energy](#energy)
|
|
|
- [diffractometer](#diffractometer)
|
|
|
- [motor scans](#motor-scans)
|
|
|
- [srs setup](#srs-setup)
|
|
|
- [mcp](#mcp)
|
|
|
- [vortex](#vortex)
|
|
|
- [analysis](#analysis)
|
|
|
- [detector number](#detector-number)
|
|
|
|
|
|
---
|
|
|
|
|
|
---
|
|
|
|
|
|
## detectors
|
|
|
|
|
|
| Name | Description | Ang. acceptance<br>HxV (deg) | Offset | Max tth | Det Num | Norm Det Num (d/I<sub>0</sub>) |
|
|
|
|------|-------------|------------------------------|--------|---------|---------|--------------------------------|
|
|
|
| mesh (I<sub>0</sub>) | Au mesh | 1 cm<sup>2</sup> | n/a | n/a | D31 | n/a |
|
|
|
| tey | drain current | n/a | n/a | n/a | D32 | D36 |
|
|
|
| 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 | 1 cm<sup>2</sup> | fixed port @ tth=-155 | n/a | D16 | D49 |
|
|
|
|
|
|
```python
|
|
|
tthdet.set('d3',move=True) # select a given detector (d3,d4, or mcp); move = True/False
|
|
|
tthdet.get() # returns the name of the current detector
|
|
|
|
|
|
mvtth(90) # moves the selected detector
|
|
|
|
|
|
scaler_cts(1) # set counting time to 1s
|
|
|
|
|
|
d3/d4
|
|
|
d3.setgain(2,'pA') # set gain for d3 to 2 pA
|
|
|
d3.get() # returns the current with background subtraction in Amps
|
|
|
d3.get_all() # returns all the current settings
|
|
|
```
|
|
|
|
|
|
See below for a complete list of signals recorded during a scan and their corresponding [detector number](#detector-number) (Det Num).
|
|
|
|
|
|
## 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!**
|
|
|
ID_start('V',75) # turns on quasiperiodic mode for V polarization at 75 percent periodic (QP_ratio: 70 - 100)
|
|
|
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
|
|
|
|
|
|
|
|
|
scanmono # scan mono only and is a linear (constant step size)
|
|
|
scanXAS # scan mono with variable step size; ID_tracking = True/False
|
|
|
|
|
|
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()
|
|
|
```
|
|
|
|
|
|
## diffractometer
|
|
|
|
|
|
- m1 = kphi
|
|
|
- m2 = x
|
|
|
- m3 = y
|
|
|
- m4 = z
|
|
|
- m7 = kap
|
|
|
- m8 = kth
|
|
|
- m9 = tth
|
|
|
|
|
|
```python
|
|
|
uan(tth,th) # moves th & tth simulatenously
|
|
|
mvx(500) # absolute move
|
|
|
dmvz(500) # 'delta' move; relative to current position
|
|
|
|
|
|
mprint() # prints current motor positions [x,y,z,tth,ktrh,kap,kphi]
|
|
|
mprint4C() # prints current position in Euler
|
|
|
|
|
|
mvsample(['name',x,y,z,tth,kth,kap,kphi]) # moves sample x,y,z only!, does not move tth; mysample
|
|
|
mv4C(['th','chi','phi']) #moves diffractometer in Euler; each move is sequential so slower than mvkappa
|
|
|
mvkappa(['desc','x','y','z','tth','kth','kap','kphi']) #move all the diffractometer motors simultaneously (except kphi which goes last)
|
|
|
```
|
|
|
|
|
|
## motor scans
|
|
|
|
|
|
```python
|
|
|
physical motors: x,y,z,tth,kth,kap,kphi
|
|
|
psuedo motors: th,chi,phi
|
|
|
|
|
|
scanx(-500,500,50) # absolute scan (start,stop,step)
|
|
|
dscanx(-500,500,50) # relative scan (start,stop,step)
|
|
|
|
|
|
scanth2th() # absolute th2th scan
|
|
|
dscanth2th() # relative th2th scan
|
|
|
```
|
|
|
|
|
|
## hkl:
|
|
|
|
|
|
```
|
|
|
#sample_... used specify lattice parameters used by fourc
|
|
|
sample_new(name,A,B,C,Alpha,Beta,Gamma) #can only be defined once
|
|
|
sample_change(name=None)
|
|
|
sample_update(a,b,c,alpha,beta,gamma) #updates the current sample
|
|
|
sample_list() #lists all samples defined
|
|
|
sample_load_from_scan(scanNum=None,**kwargs) #updates the sample and UB to be the same as in previous scanNum
|
|
|
|
|
|
setor(h,k,l,*args) #set the orientation matrix
|
|
|
UBcalc(r1,r2) # calculates the UB matrix
|
|
|
UB_get_all() # gets all the pvs associated with the UB matrix
|
|
|
UBenergy(eV) # updated UB with specified energy; default is to get current energy
|
|
|
|
|
|
cahkl(h,k,l) # calculate Euler angles for given hkl with current UB
|
|
|
get_hkl() # return hkl for current position
|
|
|
wh() # calculates and print all hkl UB for current setting including energy
|
|
|
|
|
|
### scanning
|
|
|
scanhkl(hkl1,hkl2,npts) # first hkl, last hkl, npts
|
|
|
scanhkl_test(hkl1,hkl2,npts) # prints the tragectory
|
|
|
|
|
|
scanhkl_E(hv_list, hkl) # scans energy with a fixed q
|
|
|
|
|
|
scanhkl_reset() # remove extra positioners and detectors is scanhkl or scanhkl_E are aborted
|
|
|
scan_positioners_clear() # remove extra positioners (eg after th2th if aborted)
|
|
|
```
|
|
|
|
|
|
## srs setup - dark counts
|
|
|
|
|
|
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
|
|
|
|
|
|
## 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
|
|
|
```
|
|
|
|
|
|
## vortex
|
|
|
|
|
|
For detailed instructions see [manual here](https://git.aps.anl.gov/rodolakis/Macros_29id/-/wikis/RSXS/vortex).
|
|
|
|
|
|
```python
|
|
|
vortex(855) # Sets vortex window based upon calibration
|
|
|
mcacounttime(2) # Sets count time for mca and other det to 2s
|
|
|
```
|
|
|
|
|
|
2 different acquisition modes:
|
|
|
|
|
|
```python
|
|
|
|
|
|
mcascan() # adds vortex channels as detectors in scan detector list (see detector numbers below)
|
|
|
# adds trigger to run mca in scan
|
|
|
|
|
|
mcascan(save_image=True) # same as above + 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 / scan#
|
|
|
|
|
|
mcascan(add_vortex=False) # chooses to ignore vortex channels and removes them from scan detector list
|
|
|
```
|
|
|
|
|
|
## analysis
|
|
|
|
|
|
#### 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, function) # 'gauss', 'lorz', 'erf', 'box', 'poly'
|
|
|
# xrange=[x1,x2] to fit subrange
|
|
|
|
|
|
```
|
|
|
|
|
|
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
|
|
|
```
|
|
|
|
|
|
#### 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
|
|
|
```
|
|
|
|
|
|
#### 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
|
|
|
```
|
|
|
|
|
|
## detector number
|
|
|
|
|
|
| Detector | Det Number Raw signal | Det Number Normalized (d/I<sub>0</sub>) | Description | PV | Controller |
|
|
|
|----------|-----------------------|-----------------------------------------|-------------|----|------------|
|
|
|
| | | | | | |
|
|
|
| Mesh | 31 | n/a | Incident energy (I0) | 29idMZ0:scaler1.S14 | SRS1 |
|
|
|
| TEY | 32 | 36 | Total Electron Yield | 29idMZ0:scaler1.S2 29idMZ0:scaler1_calc1.B | SRS2 |
|
|
|
| D3 | 33 | 37 | Big diode (2.5 deg) | 29idMZ0:scaler1.S3 29idMZ0:scaler1_calc1.C | SRS3 |
|
|
|
| D4 | 34 | 38 | Small diode (0.15 deg) | 29idMZ0:scaler1.S4 29idMZ0:scaler1_calc1.D | SRS4 |
|
|
|
| | | | | | |
|
|
|
| MCP | 35 | 39 | TFY - analog signal | 29idMZ0:scaler1.S5 29idMZ0:scaler1_calc1.E | 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 | 29idVORTEX:mca1.R0 29idd:userTran1.D | |
|
|
|
| Vortex | 17 | 50 | TFY - centered on Oxygen energy | 29idVORTEX:mca1.R1 29idd:userTran1.E | |
|
|
|
| | | | | | |
|
|
|
| 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 | |
|
|
|
| | | | | | |
|
|
|
|
|
|
---
|
|
|
---
|
|
|
|
|
|
# content
|
|
|
|
|
|
- [detectors](#detectors)
|
|
|
- [energy](#energy)
|
|
|
- [diffractometer](#diffractometer)
|
|
|
- [motor scans](#motor-scans)
|
|
|
- [srs setup](#srs-setup)
|
|
|
- [mcp](#mcp)
|
|
|
- [vortex](#vortex)
|
|
|
- [analysis](#analysis)
|
|
|
- [detector number](#detector-number)
|
|
|
|
|
|
---
|
|
|
|
|
|
---
|
|
|
|
|
|
## detectors
|
|
|
|
|
|
| Name | Description | Ang. acceptance<br>HxV (deg) | Offset | Max tth | Det Num | Norm Det Num (d/I<sub>0</sub>) |
|
|
|
|------|-------------|------------------------------|--------|---------|---------|--------------------------------|
|
|
|
| mesh (I<sub>0</sub>) | Au mesh | 1 cm<sup>2</sup> | n/a | n/a | D31 | n/a |
|
|
|
| tey | drain current | n/a | n/a | n/a | D32 | D36 |
|
|
|
| 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 | 1 cm<sup>2</sup> | fixed port @ tth=-155 | n/a | D16 | D49 |
|
|
|
|
|
|
```python
|
|
|
tthdet.set('d3',move=True) # select a given detector (d3,d4, or mcp); move = True/False
|
|
|
tthdet.get() # returns the name of the current detector
|
|
|
|
|
|
mvtth(90) # moves the selected detector
|
|
|
|
|
|
scaler_cts(1) # set counting time to 1s
|
|
|
|
|
|
d3/d4
|
|
|
d3.setgain(2,'pA') # set gain for d3 to 2 pA
|
|
|
d3.get() # returns the current with background subtraction in Amps
|
|
|
d3.get_all() # returns all the current settings
|
|
|
```
|
|
|
|
|
|
See below for a complete list of signals recorded during a scan and their corresponding [detector number](#detector-number) (Det Num).
|
|
|
|
|
|
## 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!**
|
|
|
ID_start('V',75) # turns on quasiperiodic mode for V polarization at 75 percent periodic (QP_ratio: 70 - 100)
|
|
|
mvmono(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
|
|
|
|
|
|
|
|
|
scanmono # scan mono only and is a linear (constant step size)
|
|
|
scanXAS # scan mono with variable step size; ID_tracking = True/False
|
|
|
|
|
|
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()
|
|
|
```
|
|
|
|
|
|
## diffractometer
|
|
|
|
|
|
- m1 = kphi
|
|
|
- m2 = x
|
|
|
- m3 = y
|
|
|
- m4 = z
|
|
|
- m7 = kap
|
|
|
- m8 = kth
|
|
|
- m9 = tth
|
|
|
|
|
|
```python
|
|
|
uan(tth,th) # moves th & tth simulatenously
|
|
|
mvx(500) # absolute move
|
|
|
dmvz(500) # 'delta' move; relative to current position
|
|
|
|
|
|
mprint() # prints current motor positions [x,y,z,tth,ktrh,kap,kphi]
|
|
|
mprint4C() # prints current position in Euler
|
|
|
|
|
|
mvsample(['name',x,y,z,tth,kth,kap,kphi]) # moves sample x,y,z only!, does not move tth; mysample
|
|
|
mv4C(['th','chi','phi']) #moves diffractometer in Euler; each move is sequential so slower than mvkappa
|
|
|
mvkappa(['desc','x','y','z','tth','kth','kap','kphi']) #move all the diffractometer motors simultaneously (except kphi which goes last)
|
|
|
```
|
|
|
|
|
|
## motor scans
|
|
|
|
|
|
```python
|
|
|
physical motors: x,y,z,tth,kth,kap,kphi
|
|
|
psuedo motors: th,chi,phi
|
|
|
|
|
|
scanx(-500,500,50) # absolute scan (start,stop,step)
|
|
|
dscanx(-500,500,50) # relative scan (start,stop,step)
|
|
|
|
|
|
scanth2th() # absolute th2th scan
|
|
|
dscanth2th() # relative th2th scan
|
|
|
```
|
|
|
|
|
|
## hkl:
|
|
|
|
|
|
```
|
|
|
#sample_... used specify lattice parameters used by fourc
|
|
|
sample_new(name,A,B,C,Alpha,Beta,Gamma) #can only be defined once
|
|
|
sample_change(name=None)
|
|
|
sample_update(a,b,c,alpha,beta,gamma) #updates the current sample
|
|
|
sample_list() #lists all samples defined
|
|
|
sample_load_from_scan(scanNum=None,**kwargs) #updates the sample and UB to be the same as in previous scanNum
|
|
|
|
|
|
setor(h,k,l,*args) #set the orientation matrix
|
|
|
UBcalc(r1,r2) # calculates the UB matrix
|
|
|
UB_get_all() # gets all the pvs associated with the UB matrix
|
|
|
UBenergy(eV) # updated UB with specified energy; default is to get current energy
|
|
|
|
|
|
cahkl(h,k,l) # calculate Euler angles for given hkl with current UB
|
|
|
get_hkl() # return hkl for current position
|
|
|
wh() # calculates and print all hkl UB for current setting including energy
|
|
|
|
|
|
### scanning
|
|
|
scanhkl(hkl1,hkl2,npts) # first hkl, last hkl, npts
|
|
|
scanhkl_test(hkl1,hkl2,npts) # prints the tragectory
|
|
|
|
|
|
scanhkl_E(hv_list, hkl) # scans energy with a fixed q
|
|
|
|
|
|
scanhkl_reset() # remove extra positioners and detectors is scanhkl or scanhkl_E are aborted
|
|
|
scan_positioners_clear() # remove extra positioners (eg after th2th if aborted)
|
|
|
```
|
|
|
|
|
|
## srs setup - dark counts
|
|
|
|
|
|
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
|
|
|
|
|
|
## 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
|
|
|
```
|
|
|
|
|
|
## vortex
|
|
|
|
|
|
For detailed instructions see [manual here](https://git.aps.anl.gov/rodolakis/Macros_29id/-/wikis/RSXS/vortex).
|
|
|
|
|
|
```python
|
|
|
vortex(855) # Sets vortex window based upon calibration
|
|
|
mcacounttime(2) # Sets count time for mca and other det to 2s
|
|
|
```
|
|
|
|
|
|
2 different acquisition modes:
|
|
|
|
|
|
```python
|
|
|
|
|
|
mcascan() # adds vortex channels as detectors in scan detector list (see detector numbers below)
|
|
|
# adds trigger to run mca in scan
|
|
|
|
|
|
mcascan(save_image=True) # same as above + 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 / scan#
|
|
|
|
|
|
mcascan(add_vortex=False) # chooses to ignore vortex channels and removes them from scan detector list
|
|
|
```
|
|
|
|
|
|
## analysis
|
|
|
|
|
|
#### 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, function) # 'gauss', 'lorz', 'erf', 'box', 'poly'
|
|
|
# xrange=[x1,x2] to fit subrange
|
|
|
|
|
|
```
|
|
|
|
|
|
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
|
|
|
```
|
|
|
|
|
|
#### 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
|
|
|
```
|
|
|
|
|
|
#### 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
|
|
|
```
|
|
|
|
|
|
## detector number
|
|
|
|
|
|
| Detector | Det Number Raw signal | Det Number Normalized (d/I<sub>0</sub>) | Description | PV | Controller |
|
|
|
|----------|-----------------------|-----------------------------------------|-------------|----|------------|
|
|
|
| | | | | | |
|
|
|
| Mesh | 31 | n/a | Incident energy (I0) | 29idMZ0:scaler1.S14 | SRS1 |
|
|
|
| TEY | 32 | 36 | Total Electron Yield | 29idMZ0:scaler1.S2 29idMZ0:scaler1_calc1.B | SRS2 |
|
|
|
| D3 | 33 | 37 | Big diode (2.5 deg) | 29idMZ0:scaler1.S3 29idMZ0:scaler1_calc1.C | SRS3 |
|
|
|
| D4 | 34 | 38 | Small diode (0.15 deg) | 29idMZ0:scaler1.S4 29idMZ0:scaler1_calc1.D | SRS4 |
|
|
|
| | | | | | |
|
|
|
| MCP | 35 | 39 | TFY - analog signal | 29idMZ0:scaler1.S5 29idMZ0:scaler1_calc1.E | 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 | 29idVORTEX:mca1.R0 29idd:userTran1.D | |
|
|
|
| Vortex | 17 | 50 | TFY - centered on Oxygen energy | 29idVORTEX:mca1.R1 29idd:userTran1.E | |
|
|
|
| | | | | | |
|
|
|
| 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 | |
|
|
|
| | | | | | |
|
|
|
|