Example showing the new syntax, E4C and E6C

With the installation of 6-circle diffractometers the fc_ prefix is no longer adequate. So it has been changed to diff_. The following .gra file shows the new functions.

!
! Note that the following functions exist
!
! * = diff_set_r0( h, k, l)
! * = diff_set_r1( h, k, l)
! * = diff_compute_u()
!
cls/alpha
say/line=2 " h "diff_h()" k "diff_k()" l "diff_l()
say/line=20 " display hkl "
wait
h = diff_h()
k = diff_k()
l = diff_l()
psi = diff_psi()

mu = diff_mu()
om = diff_omega()
ch = diff_chi()
ph = diff_phi()
ga = diff_gamma()
de = diff_delta()

diff_h() = h + 0.1
diff_k() = k + 0.1
diff_l() = l + 0.1
say/line=3 " h "diff_h()" k "diff_k()" l "diff_l()
say/line=20 " moved hkl by += 0.1 "
wait

move/diff_h=h/diff_k=k/diff_l=l
say/line=4 " h "diff_h()" k "diff_k()" l "diff_l()
say " "
say/line=20 " moved hkl back "
wait

cls/alpha
say/line=2 " psi "diff_psi()
say/line=20 " display psi "
wait

diff_psi() = psi + 1
say/line=3 " psi "diff_psi()
say/line=20 " moved psi += 1"
wait

move/diff_psi=psi
say/line=4 " psi "diff_psi()
say/line=20 " moved psi back"
wait

cls/alpha
say/line=2 "mu "diff_mu()" omega "diff_omega()" chi "diff_chi()
say/line=3 "phi "diff_phi()" gamma "diff_gamma()" delta "diff_delta()
say/line=20 "display angles "
wait

diff_mu() = mu + 1
diff_omega() = om + 1
diff_chi() = ch + 1
diff_phi() = ph + 1
diff_gamma() = ga + 1
diff_delta() = de + 1
say/line=4 "mu "diff_mu()" omega "diff_omega()" chi "diff_chi()
say/line=5 "phi "diff_phi()" gamma "diff_gamma()" delta "diff_delta()
say/line=20 " moved angles +1 "
wait

move/diff_mu=mu/diff_omega=om/diff_chi=ch
move/diff_phi=ph/diff_gamma=ga/diff_delta=de
say " moved angles back "
say/line=6 "mu "diff_mu()" omega "diff_omega()" chi "diff_chi()
say/line=7 "phi "diff_phi()" gamma "diff_gamma()" delta "diff_delta()
say/line=20 " moved angles back "
wait

cls/alpha
say/line=2 diff_angles( 3, 2, 1)
say/line=20 " angles that belong to 3,2,1 "
wait

cls/alpha
say/line=2 diff_hkl( mu, om, ch, ph, ga, de)
say/line=20 " hkl that belongs to "mu" "om" "ch" "ph" "ga" "de
wait

!
! angular scan, assume that the scan macros are prepared
!
scan/diff_mu/_range=0.5/_np=11/_st=0.1/gmn=auto_scan/exec
if( !gra_status()) then end
scan/diff_omega/_range=0.5/_np=11/_st=0.1/gmn=auto_scan/exec
scan/diff_chi/_range=0.5/_np=11/_st=0.1/gmn=auto_scan/exec
scan/diff_phi/_range=0.5/_np=11/_st=0.1/gmn=auto_scan/exec
scan/diff_gamma/_range=0.5/_np=11/_st=0.1/gmn=auto_scan/exec
scan/diff_delta/_range=0.5/_np=11/_st=0.1/gmn=auto_scan/exec
scan/diff_psi/_range=0.5/_np=11/_st=0.1/gmn=auto_scan/exec
!
! hkl scans, invoked as general scans
!
scan/diff_h/_range=0.5/_np=11/_st=0.1/gmn=auto_scan/exec
scan/diff_k/_range=0.5/_np=11/_st=0.1/gmn=auto_scan/exec
scan/diff_l/_range=0.5/_np=11/_st=0.1/gmn=auto_scan/exec
scan/diff_psi/_range=0.5/_np=11/_st=0.1/gmn=auto_scan/exec
!
! hkl scans, invoked as q-scans
!
scan/hkl/_start_h=1/_stop_h=2/gmn=auto_scan/_np=11/_st=0.1/exec
scan/hkl/_start_k=1/_stop_k=2/gmn=auto_scan/_np=11/_st=0.1/exec
scan/hkl/_start_l=1/_stop_l=2/gmn=auto_scan/_np=11/_st=0.1/exec