| ... | ... | @@ -74,71 +74,182 @@ scanXAS(hv_list_of_lists) # scan mono with variable step size; ID_tracking = T |
|
|
|
- m8 = kth
|
|
|
|
- m9 = tth
|
|
|
|
|
|
|
|
```python
|
|
|
|
physical motors: x,y,z,tth,kth,kap,kphi
|
|
|
|
psuedo motors: th,chi,phi
|
|
|
|
|
|
|
|
mvx(x) / mvy(y) / mvz(z)
|
|
|
|
mvth(th) / mvchi(chi) / mvphi(phi) ##moves single Euler motor
|
|
|
|
|
|
|
|
scanx(-500,500,50) # absolute scan (start,stop,step)
|
|
|
|
dscanx(-500,500,50) # relative scan (start,stop,step)
|
|
|
|
|
|
|
|
mprint() #returns a list of the physical motor positions ['x','y','z','tth','kth','kap','kphi']
|
|
|
|
|
|
|
|
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)
|
|
|
|
# **Kappa python - cheat sheet**
|
|
|
|
#### list of commonly used python functions for the Kappa Endstation
|
|
|
|
---
|
|
|
|
### **Required Imports**
|
|
|
|
from iexcode.macros.Kappa import *
|
|
|
|
from iexcode.macros.xrays import *
|
|
|
|
|
|
|
|
### **Kappa Endstation initalization (run in the first cell)**
|
|
|
|
tey,d3,d4,mesh,tth_pv,tthdet,ls331 = kappa_init('UserName', xrays=True)
|
|
|
|
|
|
|
|
mvsample(['desc','x','y','z',...])# moves sample x,y,z only!, does not move tth; mysample
|
|
|
|
---
|
|
|
|
|
|
|
|
scanth2th() # absolute th2th scan
|
|
|
|
dscanth2th() # relative th2th scan
|
|
|
|
```
|
|
|
|
### **KappaEndstation**
|
|
|
|
Kappa_get_all()
|
|
|
|
Kappa_safe_state()
|
|
|
|
-------------------------------------------------------------
|
|
|
|
Kappa_light(ON_OFF)
|
|
|
|
|
|
|
|
## diffractometer
|
|
|
|
---
|
|
|
|
|
|
|
|
```python
|
|
|
|
uan(tth,th) # moves th & tth simulatenously
|
|
|
|
mvx(500) # absolute move
|
|
|
|
dmvz(500) # 'delta' move; relative to current position
|
|
|
|
### **Beamline and energy**
|
|
|
|
safe_state() #put the beamline in a safe state
|
|
|
|
-------------------------------------------------------------
|
|
|
|
xrays_get_all() #get current beamline settings
|
|
|
|
energy_get_all() #get current ID and mono settings
|
|
|
|
energy_get() #return the photon energy
|
|
|
|
energy(hv) #set the photon energy (ID, mono, apertures)
|
|
|
|
polarization(ID_mode) #set the polarization but not the energy
|
|
|
|
mvID() #set the ID setpoint
|
|
|
|
qp(QP_ratio) #set the QP ration (off = 100 )
|
|
|
|
mvmono() #set the mono energy
|
|
|
|
grating(grating_name) #changes grating ('HEG','MEG')
|
|
|
|
-------------------------------------------------------------
|
|
|
|
apertures_set(c_2B=1) #(c_2B <1 kills flux)
|
|
|
|
slit_get() #get the exit slit size
|
|
|
|
slit(size) #set the vertical size of exit slit
|
|
|
|
m3r_align() #align pre-Kappa beam position
|
|
|
|
-------------------------------------------------------------
|
|
|
|
resolution() #prints resolution for current setting
|
|
|
|
|
|
|
|
wh() # prints current motor positions
|
|
|
|
wa() # prints motor limits
|
|
|
|
---
|
|
|
|
|
|
|
|
```
|
|
|
|
### **Motor Moves and Scans**
|
|
|
|
There are seven motors in Kappa:
|
|
|
|
`mot` = `tth`, `th`, `chi`, `phi`, `x`, `y`, `z`
|
|
|
|
|
|
|
|
-------------------------------------------------------------
|
|
|
|
mprint() #prints current position
|
|
|
|
mvsample(['', x, y, z, th, chi, phi]) #move to position
|
|
|
|
mvxyz(x, y, z) #move to sample xyz
|
|
|
|
-------------------------------------------------------------
|
|
|
|
mv[mot](val) #move to an absolute position
|
|
|
|
dmv[mot](val) #move to a relative position
|
|
|
|
scan[mot](start,stop,step) #scan absolute positions
|
|
|
|
dscan[mot](delta_start,delta_stop,step) #scan relative positions
|
|
|
|
-------------------------------------------------------------
|
|
|
|
scanXAS([[hv_start, hv_end, hv_step],...],ID_tracking=True) #scan X-ray energy
|
|
|
|
scanXAS_array(hv_list,ID_tracking=True) #scan X-ray energy using a given energy list
|
|
|
|
scanth2th(tth_start, tth_stop, tth_step, th_offset) #th-tth scan
|
|
|
|
scanth2th_table(tth_table, th_offset) #th-tth scan using a given tth list
|
|
|
|
scan_time(npts, step_second=1) #scan n points
|
|
|
|
scan_temp(temp_start, temp_end, temp_step) #scan temperatures
|
|
|
|
scan_mesh(motor1, start1, end1, step1, motor2, start2, end2, step2) #scan two motors
|
|
|
|
map_orientation(th_start, th_stop, th_step, chi_start, chi_stop, chi_step) #map out intensities in a solid angle, used for peak searching
|
|
|
|
map_sample(y_start, y_stop, y_step, x_start, x_stop, x_step) #map out intensities in real space, used for sample spot searching
|
|
|
|
|
|
|
|
---
|
|
|
|
|
|
|
|
## hkl:
|
|
|
|
### **Diffraction and Scans**
|
|
|
|
-------------------------------------------------------------
|
|
|
|
wh() #print current position
|
|
|
|
pa() #print current sample orientation
|
|
|
|
wm() #print motor positions and constraints
|
|
|
|
-------------------------------------------------------------
|
|
|
|
sample_new('name', a, b, c, alpha, beta, gamma) #enter sample lattice
|
|
|
|
sample_update(a, b, c, alpha, beta, gamma) #update sample lattice
|
|
|
|
sample_list() #list all registered samples
|
|
|
|
sample_change(name=name) #change to another sample from the list
|
|
|
|
setor0(H, K, L, tth, th, chi, phi) #enter first reflection
|
|
|
|
setor1(H, K, L, tth, th, chi, phi) #enter second reflection
|
|
|
|
or_swap() #swap two reflections and recompute UB
|
|
|
|
show_ors() #print current reflections
|
|
|
|
clear_ors() #clear all reflections
|
|
|
|
-------------------------------------------------------------
|
|
|
|
cahkl(H, K, L, freeze=deg, hv=eV) #calculate motor position for HKL
|
|
|
|
cahkl_path(hkl_start, hkl_stop, npts) #calculate motor positions for a HKL trajectory
|
|
|
|
cahkl_table(reflectiosn) #calculate motor positions for a given trajectory table
|
|
|
|
mvhkl(H, K, L, freeze=deg, hv=eV) #move to HKL
|
|
|
|
-------------------------------------------------------------
|
|
|
|
scanhkl(hkl1, hkl2, npts) #scan a trajectory in r-space
|
|
|
|
scanhkl_lst(hkl_lst) #scan a given trajectory in r-space
|
|
|
|
scanE_fixQ(hv_list, ID_tracking=False) #scan X-ray energy at a fixed Q
|
|
|
|
|
|
|
|
```
|
|
|
|
#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
|
|
|
|
### **Detectos**
|
|
|
|
`det` = `mesh`, `tey`, `d3`, or `d4` can be intialized as Keithley or SRS current amplifiers. You can configure them using these commands.
|
|
|
|
|
|
|
|
#### Keithley Current Amplifiers
|
|
|
|
##### Attributes:
|
|
|
|
[det].state
|
|
|
|
[det].current
|
|
|
|
[det].rate
|
|
|
|
[det].range
|
|
|
|
[det].autorange
|
|
|
|
[det].auto_ulimit
|
|
|
|
[det].auto_llimit
|
|
|
|
[det].zero_check
|
|
|
|
[det].zero_correct
|
|
|
|
[det].median_filter
|
|
|
|
[det].median_filter_rank
|
|
|
|
[det].digital_filter
|
|
|
|
[det].digital_filter_count
|
|
|
|
[det].digital_filter_control
|
|
|
|
[det].set_avg_pts
|
|
|
|
[det].set_avg_time
|
|
|
|
|
|
|
|
##### Methods:
|
|
|
|
[det].acquire()
|
|
|
|
[det].refresh()
|
|
|
|
[det].refresh_all()
|
|
|
|
[det].get_all()
|
|
|
|
[det].set(attr, val)
|
|
|
|
[det].reset()
|
|
|
|
[det].count_time()
|
|
|
|
[det].set_avg_time(dwell_time_second)
|
|
|
|
[det].set_avg_pts(n_pts)
|
|
|
|
[det].set_default()
|
|
|
|
|
|
|
|
##### Functions:
|
|
|
|
ca_reset_all() #resets all the connected current amplifiers
|
|
|
|
ca_average(avg_pts) #set up average reading using number of points
|
|
|
|
ca_average_time(dwell_time) #set up average reading using dwell_time
|
|
|
|
ca_average_off() #turn off average reading
|
|
|
|
ca_rate(rate) #set rate for all ca's in the endstation
|
|
|
|
ca_live() #puts all the Keithley in live mode
|
|
|
|
ca_passive() #puts all the Keithley in passive mode
|
|
|
|
|
|
|
|
|
|
|
|
#### SRS Current Amplifiers
|
|
|
|
##### Attributes:
|
|
|
|
[det].scaler
|
|
|
|
[det].sens_num
|
|
|
|
[det].sens_unit
|
|
|
|
[det].offset_num
|
|
|
|
[det].offset_unit
|
|
|
|
[det].offset_on
|
|
|
|
[det].offset_cal
|
|
|
|
[det].offset_val
|
|
|
|
[det].bias_val
|
|
|
|
[det].bias_on
|
|
|
|
[det].filter_type
|
|
|
|
[det].low_freq
|
|
|
|
[det].high_freq
|
|
|
|
[det].gain_mode
|
|
|
|
[det].invert_on
|
|
|
|
[det].blank_on
|
|
|
|
|
|
|
|
##### Methods:
|
|
|
|
[det].reset_filter()
|
|
|
|
[det].set_all()
|
|
|
|
[det].reset_default()
|
|
|
|
[det].update_attrs()
|
|
|
|
[det].get_all()
|
|
|
|
[det].get(attr)
|
|
|
|
[det].set(attr, val)
|
|
|
|
[det].gain_str(channel='offset')
|
|
|
|
[det].get_gains()
|
|
|
|
[det].set_gain(gain, unit)
|
|
|
|
[det].set_offset(value, gain, unit)
|
|
|
|
[det].auto_dark_counts(target=1000)
|
|
|
|
|
|
|
|
##### Functions:
|
|
|
|
scaler_cts(time_seconds=0.1) #sets the scalers counting
|
|
|
|
|
|
|
|
-----------------------------------------------------------
|
|
|
|
|
|
|
|
With shutter close or slit at 0 (faster), 'INPUT OFFSET' set 'ON' and 'UNCAL'
|
|
|
|
|
| ... | ... | |