# Luzatti plots (again)

Jiang Jiansheng jiang at LAPLACE.CSB.YALE.EDU
Fri Oct 6 09:42:37 EST 1995

```> Hello All,
> Like an idiot, I didn't pay attention to the posts about a non-Mathematica
> script for Luzatti plots.
> Can anyone help me out please.
> Cheers,
> Charlie

There is a simple X-PLOR script file, I had ever posted,
which produces the Luzzati curve data (non-Mathematica format)
for a given coordinate error.   "Simple" means
that the algoritm used here is a simple linear interpolation to the
Luzzati table, therefore the curve is not very smooth.

In the furture versions, we will provide the example file
for automatically estimating coordinates error by matching
the R values to a Luzzati curve.

Jiansheng Jiang.

Encl.: "luzzati_curve.inp"

----------------------cut here--------------------------
remarks  file: luzzati_curve.inp
remarks  produce a Luzzati curve for the given coordinate error
remarks  temporary written for version 3.1 by JSJ

{===> specify the coordinate error }
evaluate (\$ESDERR_LUZ=0.25)  {angstrom}

{===> centric space group "TRUE" or acentric space group "FALSE" }
evaluate (\$CENTRIC_SG=FALSE)

{===> the display file for output }
evaluate (\$display="luzzati_curve.list")
set display=\$display end

{===> resolution range }
evaluate (\$low_res=5.0)        {* low resolution limits  *}
evaluate (\$high_res=1.8)       {* high resolution limits *}
{===> number of resolution bins }
evaluate (\$mbins=20)

set echo=off end
set mess=off end

display  Luzzati Plot ( \$ESDERR_LUZ )

display  #bin | resolution range | R_luzzati

evaluate (\$Luz_n=\$mbins)
evaluate (\$Luz_low_s=1.0/\$low_res^3)
evaluate (\$Luz_high_s=1.0/\$high_res^3)
evaluate (\$Luz_delta=(\$Luz_high_s-\$Luz_low_s)/\$Luz_n)

evaluate (\$Luz_i=0)
while (\$Luz_i < \$Luz_n) loop main
evaluate (\$Luz_i=\$Luz_i+1)
evaluate (\$Luz_low=1.0/(\$Luz_low_s+(\$Luz_i-1)*\$Luz_delta)^(1/3))
evaluate (\$Luz_high=1.0/(\$Luz_low_s+\$Luz_i*\$Luz_delta)^(1/3))
evaluate (\$Luz_S=2.0/(\$Luz_low+\$Luz_high))

{* match the S value to the first column of Luzzati Table *}
evaluate (\$Luz_match=FALSE)
evaluate (\$Luz_found=FALSE)
evaluate (\$Luz_counter=0)
evaluate (\$Luz_s1=0.0)
evaluate (\$Luz_v1=0.0)
for \$Luz_1 in (

! Luzzati Table (Luzzati, P.V., Acta Cryst. (1952), 5, 802-810).

! R values as a function of coord. error and resolution (Table 2)
!
! <|del_r|>*|s|    R(cent.)     R(acent.)
0.          0.           0.
0.01        0.039        0.025
0.02        0.078        0.050
0.03        0.115        0.074
0.04        0.152        0.098
0.05        0.188        0.122
0.06        0.223        0.145
0.07        0.256        0.168
0.08        0.288        0.191
0.09        0.320        0.214
0.1         0.350        0.237
0.12        0.410        0.281
0.14        0.462        0.319
0.16        0.510        0.353
0.18        0.554        0.385
0.20        0.595        0.414
0.22        0.631        0.44
0.24        0.662        0.463
0.26        0.689        0.483
0.28        0.713        0.502
0.30        0.735        0.518
0.35        0.776        0.548
0.40        0.802        0.564
0.45        0.817        0.574
0.50        0.823        0.580
) loop luz
evaluate (\$Luz_counter=\$Luz_counter+1)
if (\$Luz_counter = 4) then
evaluate (\$Luz_counter=1)
if (\$Luz_found = TRUE) then
evaluate (\$Luz_match=TRUE)
end if
end if
if (\$Luz_match = FALSE) then
if (\$Luz_counter = 1) then
evaluate (\$Luz_s0=\$Luz_s1)
evaluate (\$Luz_s1=\$Luz_1/\$ESDERR_LUZ)
if (\$Luz_s1 > \$Luz_S) then
evaluate (\$Luz_found=TRUE)
end if

elseif (\$Luz_counter = 2) then
{* for centric space groups *}
if (\$CENTRIC_SG = TRUE) then
evaluate (\$Luz_v0=\$Luz_v1)
evaluate (\$Luz_v1=\$Luz_1)
end if
elseif (\$Luz_counter = 3) then
{* for acentric space groups *}
if (\$CENTRIC_SG = FALSE) then
evaluate (\$Luz_v0=\$Luz_v1)
evaluate (\$Luz_v1=\$Luz_1)
end if
end if
end if
end loop luz
if (\$Luz_match = TRUE) then
{* a simple linear interpolation *}
evaluate (\$Luz_rs=\$Luz_v0+(\$Luz_S-\$Luz_s0)*
(\$Luz_v1-\$Luz_v0)/(\$Luz_s1-\$Luz_s0))
else
evaluate (\$Luz_rs=0.0)
end if

!  display \$Luz_i[i4] \$Luz_high[f6.2]  \$Luz_low[f6.2]  \$Luz_rs[f8.4]
display \$Luz_i \$Luz_high  \$Luz_low  \$Luz_rs

end loop main

stop

```