There are various ways you could do this. We tend to run the nist 1976 standard that Bruker supply weekly. We then do some peak fitting in topas you just extract intensities and fwhm of certain reflections. This mimics the calibration information that Bruker supplies. We then do a Pawley fit to follow cell parameters and axial divergence. We have a short python script that presents all the informationg graphically so we can follow instrument performance with time.
INP file is below in case of use.
'File to peak fit standard calibration runs on d10
'Do both peak fitting and Pawley on a single file
'Save results to results.txt and fits to temp_pkfit.xyd and temp_pawley.xyd for autoplotting in python
r_exp 22.8183467 r_exp_dash 27.823436 r_wp 25.2094995 r_wp_dash 30.7390762 r_p 42.2984599 r_p_dash 47.6628858 weighted_Durbin_Watson 1.65893232 gof 1.1047908
iters 1000
do_errors
continue_after_convergence
num_cycles 3
'read this section if file_from_command_line is not defined
'otherwise take filenameuse from command line
#ifdef !file_from_command_line
'macro filenameuse { 217833_SRM1976c_Cu_Verification.raw }
macro filenameuse { d10_00010.raw }
#endif
#if (Run_Number == 0)
Backup_INP
system_before_save_OUT { del peak_fit.txt del results.txt}
out "results.txt" append
Out_String(" filename rwp_pawley gof_pawley axial esd lpa esd lpc esd vol esd height esd int_total esd\n")
out "peak_fit.txt" append ' results file for gnuplot. outstring is file column headers
Out_String(" 2th_ideal 2th_obs esd delta_2th esd fwhm_ideal fwhm esd intensity_ideal intensity esd intensity_norm esd\n")
#endif
prm !tth_delta 0.1
prm !lor_min 0.0
prm !lor_max 1.0
prm !fwhm_min 0.003
prm !fwhm_max 2
macro peakmacro(p1,v1,p2,v2,p3,v3,p4,v4,p5,v5,p6,v6,p7,v7) {
#m_argu p1
#m_argu p2
#m_argu p3
#m_argu p4
#m_argu p5
#m_argu p6
#m_argu p7
If_Prm_Eqn_Rpt(p1,v1,)
If_Prm_Eqn_Rpt(p2,v2,)
If_Prm_Eqn_Rpt(p3,v3,)
If_Prm_Eqn_Rpt(p4,v4,min=v1-tth_delta; max=v1+tth_delta๐
If_Prm_Eqn_Rpt(p5,v5,min=lor_min; max=lor_max; )
If_Prm_Eqn_Rpt(p6,v6,min=fwhm_min; max=fwhm_max๐
If_Prm_Eqn_Rpt(p7,v7, min 1e-9)
xo_Is xo =CeV(p4,v4);
peak_type pv pv_lor =CeV(p5,v5);
pv_fwhm =CeV(p6,v6);
I =CeV(p7,v7);
}
/*
'ideal peak intensities from 217833_SRM1976c_Cu_Verification.raw fitted in TOPAS 24/8/2023
!pk01_int_ideal, 23.71
!pk02_int_ideal, 100.00
!pk03_int_ideal, 13.29
!pk04_int_ideal, 8.36
!pk05_int_ideal, 15.42
'ideal peak intensities from Bruker sheet in folder
!pk01_int_ideal, 23.88
!pk02_int_ideal, 100.00
!pk03_int_ideal, 12.50
!pk04_int_ideal, 8.10
!pk05_int_ideal, 14.10
*/
'do thepeak fitting here
'RAW(filenameuse)
xdd filenameuse
Exclude { 0 24.575 26.575 34.148 36.148 87.989 89.989 94.243 96.243 126.5 129.5 135.066 }
peakmacro(!pk01_x_ideal, 25.575,!pk01_fwhm_ideal, 0.039,!pk01_int_ideal, 23.71, pk01_x, 25.5686745_0.000306403003, pk01_lor, 0.592214427
0.0332417818, pk01_fwhm, 0.0388133327_0.00078895319,pk01_int, 58.7002501
0.680361105)
peakmacro(!pk02_x_ideal, 35.148,!pk02_fwhm_ideal, 0.040,!pk02_int_ideal, 100.00, pk02_x, 35.141046_0.000128532438, pk02_lor, 0.668303037
0.0150000186, pk02_fwhm, 0.0367082175_0.000402555169,pk02_int, 253.078821
1.31291997)
peakmacro(!pk03_x_ideal, 88.989,!pk03_fwhm_ideal, 0.074,!pk03_int_ideal, 13.29, pk03_x, 88.9845938_0.000669021522, pk03_lor, 0.750720851
0.0436599717, pk03_fwhm, 0.0696097534_0.00225736023,pk03_int, 33.8616739
0.536904685)
peakmacro(!pk04_x_ideal, 95.243,!pk04_fwhm_ideal, 0.080,!pk04_int_ideal, 8.36, pk04_x, 95.2395159_0.000964034602, pk04_lor, 0.700521092
0.057819192, pk04_fwhm, 0.0808609873_0.00314193779,pk04_int, 21.5511333
0.464869952)
peakmacro(!pk05_x_ideal, 127.670,!pk05_fwhm_ideal, 0.145,!pk05_int_ideal, 15.42, pk05_x, 127.670716_0.00127195429, pk05_lor, 0.79634323
0.0487225425, pk05_fwhm, 0.13707676_0.0043801937,pk05_int, 40.7954474
0.78049187)
' peakmacro(!pk06_x_ideal, 136.066,!pk06_fwhm_ideal, 0.179,!pk06_int_ideal, 12.50, pk06_x, 136.062119, pk06_lor, 0.949818716, pk06_fwhm, 0.538598579,pk06_int, 4103.59832,t05,1)
xdd_out temp_pkfit.xyd load out_record out_fmt out_eqn { " %11.5f " = X; " %11.5f " = Yobs; " %11.5f " = Ycalc; " %11.5f\n" = Yobs-Ycalc; }
'do the Pawley fit here
'RAW(filenameuse)
xdd filenameuse
prm rwp_pawley = Get(r_wp);:26.4325429
prm gof_pawley = Get(gof);:1.09087636
hkl_Is
a lpa 4.759400_0.000016 'nist 1976 4.759092
b lpa 4.759400
0.000016 'nist 1976 4.759092
c lpc 12.994099_0.000031 'nist 1976 12.99337
al 90.
be 90.
ga 120.
volume vol 254.907
0.002
space_group "R-3c"
Specimen_Displacement(height,-0.00612029622_0.000291233605)
'Zero_Error(zero, 0.00559574354_0.011670355)
TCHZ_Peak_Type(pku,-0.00354964733
0.000103412428,pkv, 0.00612522507_0.000132686926,pkw, -0.00171053163
3.59470069e-05,!pkz, 0.0000,pky, 0.0426959308_0.000892802427,pkx, 0.00554377034
0.000451463889)
Simple_Axial_Model(axial, 6.61392747`0.054927716 min 5 max 9)
xdd_out temp_pawley.xyd load out_record out_fmt out_eqn { " %11.5f " = X; " %11.5f " = Yobs; " %11.5f " = Ycalc; " %11.5f\n" = Yobs-Ycalc; }
for xdds {
weighting = IF X < 15 THEN 0 ELSE If(Yobs < 1, 1, 1/Yobs) ENDIF ; 'don't try and fit low angle background
CuKa2(0.0001)
x_calculation_step = Yobs_dx_at(Xo);
bkg @ -2.06868083_0.47027018 13.7853392
0.881882023 -13.6191119_0.829050766 12.1460021
0.679517791 -8.85509244_0.560480193 5.43093475
0.385022823 -3.28467657_0.273276901 0.93646262
0.138411074 -0.0784773503`_0.0832236439
}
#define write_out
#ifdef write_out
out "peak_fit.txt" append
Out(pk01_x_ideal, " %11.5f") Out(pk01_x, " %11.6f", " %11.9f") Out(pk01_x - pk01_x_ideal, " %11.6f", " %11.6f") Out(pk01_fwhm_ideal, " %11.6f") Out(pk01_fwhm, " %11.6f", " %11.6f") Out(pk01_int_ideal, " %11.6f") Out(pk01_int, " %11.6f", " %11.6f") Out(100pk01_int/pk02_int, " %11.6f", " %11.6f\n")
Out(pk02_x_ideal, " %11.5f") Out(pk02_x, " %11.6f", " %11.9f") Out(pk02_x - pk02_x_ideal, " %11.6f", " %11.6f") Out(pk02_fwhm_ideal, " %11.6f") Out(pk02_fwhm, " %11.6f", " %11.6f") Out(pk02_int_ideal, " %11.6f") Out(pk02_int, " %11.6f", " %11.6f") Out(100pk02_int/pk02_int, " %11.6f", " %11.6f\n")
Out(pk03_x_ideal, " %11.5f") Out(pk03_x, " %11.6f", " %11.9f") Out(pk03_x - pk03_x_ideal, " %11.6f", " %11.6f") Out(pk03_fwhm_ideal, " %11.6f") Out(pk03_fwhm, " %11.6f", " %11.6f") Out(pk03_int_ideal, " %11.6f") Out(pk03_int, " %11.6f", " %11.6f") Out(100pk03_int/pk02_int, " %11.6f", " %11.6f\n")
Out(pk04_x_ideal, " %11.5f") Out(pk04_x, " %11.6f", " %11.9f") Out(pk04_x - pk04_x_ideal, " %11.6f", " %11.6f") Out(pk04_fwhm_ideal, " %11.6f") Out(pk04_fwhm, " %11.6f", " %11.6f") Out(pk04_int_ideal, " %11.6f") Out(pk04_int, " %11.6f", " %11.6f") Out(100pk04_int/pk02_int, " %11.6f", " %11.6f\n")
Out(pk05_x_ideal, " %11.5f") Out(pk05_x, " %11.6f", " %11.9f") Out(pk05_x - pk05_x_ideal, " %11.6f", " %11.6f") Out(pk05_fwhm_ideal, " %11.6f") Out(pk05_fwhm, " %11.6f", " %11.6f") Out(pk05_int_ideal, " %11.6f") Out(pk05_int, " %11.6f", " %11.6f") Out(100*pk05_int/pk02_int, " %11.6f", " %11.6f\n")
out "results.txt" append
Out_String(filenameuse)
Out( rwp_pawley, " %11.5f")
Out( gof_pawley, " %11.5f")
Out( axial," %11.5f", " %11.5f")
Out( lpa, " %11.5f", " %11.5f")
Out( lpc, " %11.5f", " %11.5f")
Out( vol, " %11.5f", " %11.5f")
Out( height, " %11.5f", " %11.5f")
Out( pk01_int+pk02_int+pk03_int+pk04_int+pk05_int, " %11.5f", " %11.5f")
Out_String("\n")
#endif