'--------------------------------------------------------------
'Input File for simple Rietveld Refinement
'Use save/set current button then run with F6 in topas
'Replace $ and # symbols with text/numbers as needed
'--------------------------------------------------------------

r_wp  18.5758927 r_exp  16.0194775 r_p  13.5708736 r_wp_dash  34.0815518 r_p_dash  34.0067815 r_exp_dash  29.3912471 weighted_Durbin_Watson  1.70363062
gof  1.15958168

'--------------------------------------------------------------
'General information about refinement here
'Remove comments as required
'--------------------------------------------------------------

iters 100000
chi2_convergence_criteria 0.001
do_errors

'--------------------------------------------------------------
'Information on datafile etc here
'Check that default weighting is appropriate for your data
'--------------------------------------------------------------
xdd LaB6-NIST660C-1p5h_10-150_004soller_0p5degfixeddiv_1degpAS_5degsAS_onSiwafer-spinner_05-10-21.xy
	x_calculation_step = Yobs_dx_at(Xo); convolution_step 4
	bkg @  31.5588936`_0.112268338 -20.673479`_0.20794825  15.3015907`_0.192569092 -7.85713981`_0.186064899  5.11257704`_0.17525378 -2.60032024`_0.171767519
	0.809724543`_0.161208578 -0.334375884`_0.157902955  0.0977244207`_0.143036174  0.259620136`_0.139359654 -0.257335485`_0.113444123  0.19507547`_0.109226329
	'Panalytical X'Pert Diffractometer - ICL
	LP_Factor(!th2_monochromator, 27.26)
   lam
      ymin_on_ymax 0.0001
      la 1 lo @  1.5407609`_4.40949217e-006 lh @  0.15906`_0.01303 lg @  0.61540`_0.01771 ' wavelength la: fraction, lo: wavelength centre, lh: Lorentz broadening, lg: Gauss Broadening. Refined values since monochromator alignment will affect. 
	Radius(240,240) ' primary and secondary radius of the diffractometer circle
	Divergence( , 0.5) ' Horizontal divergence of the beam in degrees in the equitorial plane
	Slit_Width(@, 0.17123`_0.00330)  ' Aperture of the receiving slit in the equitorial plane in mm. (adds a hat function to the peakshape, refined)
	Full_Axial_Model(10, 10, 10, @  7.09582`_0.42994,  2.3)  ' Tube filament length in mm, Sample length in axial direction in [mm], Length of the detector (= receiving) slit in [mm], length of the primary soller slit in degrees (refined, should be close to actual), length of the secondary soller slit in degrees.
	lpsd_th2_angular_range_degrees 2.122 ' detector angular coverage
		lpsd_equitorial_divergence_degrees 0.5 'the equitorial divergence in degrees of the primary beam
	'	lpsd_equitorial_sample_length_mm 10 ' is the lengths of the sample in the equitorial plane. nb this is variable a constant slit width setup.
 
		
		
' Mechanical parameters 
'	Zero_Error(zero,-0.13948_0.00029)  ' a refined zero error for the sample

	Specimen_Displacement(hei, 0.28422`_0.00058) 'a height adjustment for the sample. Either refine zero or height. not both.

'--------------------------------------------------------------
'Information on structure
'Type in phase/space group/cell etc
'Comment in/out sections as needed
'--------------------------------------------------------------
prm_with_error !NIST660C 4.156826_0.00008
	str
		a  =NIST660C;:  4.156826`_0.000080
		b  =NIST660C;:  4.156826`_0.000080
		c  =NIST660C;:  4.156826`_0.000080
		al 90.      
		be 90.      
		ga 90.      
		volume  71.827`_0.004
		space_group Pm-3m
		site La1    x 0             y 0             z 0             occ La 1.         beq @  1.24471`_0.02083
		site B1     x @  0.20176`_0.00157 y 0.5           z 0.5           occ B  1.         beq @  1.06527`_0.14919
		scale @  0.000546222287`_3.075e-006
		r_bragg  3.33093316
		Phase_Density_g_on_cm3( 4.71094`_0.00027)
		CS_L(927.6)  ' the reported average crystalite length in nm of NIST660C particles
	'	CS_G(@, 876.45221_1.80674)
	'	Strain_L(@, 0.00098_0.00003)
	'	Strain_G(@, 0.01084_0.00003)

C_matrix_normalized
{
                             1   2   3   4   5   6   7   8   9  10  11  12  13  14  15  16  17  18  19  20  21  22
bkg26411136            1:  100 -45  80 -37  64 -29  49 -21  36 -14  24  -5   2  -2  -1 -14   8   2  -0  10   1   2
bkg26410624            2:  -45 100 -47  80 -37  63 -28  49 -21  36 -13  24   2  -2  -1  -5   1   2   4   8   1   2
bkg26408576            3:   80 -47 100 -46  78 -36  60 -26  44 -17  29  -8   1  -0  -1   0  -1  -0   2   3   0   3
bkg26408832            4:  -37  80 -46 100 -45  77 -35  59 -25  43 -16  27   1  -1  -1  -6   3   1  -1   3   1   3
bkg26409088            5:   64 -37  78 -45 100 -44  75 -33  54 -22  34 -10   0  -1  -1  -1  -1   2   2   3  -0   4
bkg26409344            6:  -29  63 -36  77 -44 100 -43  74 -32  52 -20  32   1   0  -0  -2   1  -1  -0   2   2   3
bkg26410112            7:   49 -28  60 -35  75 -43 100 -42  70 -29  44 -13  -0  -1  -1  -1   0   1   1   1   0   4
bkg36820368            8:  -21  49 -26  59 -33  74 -42 100 -41  69 -27  41   1   0  -0   0  -1  -1   1   1   3   1
bkg36819088            9:   36 -21  44 -25  54 -32  70 -41 100 -39  60 -18  -0  -0  -0   1  -1  -0   0  -0   0  -0
bkg36820624           10:  -14  36 -17  43 -22  52 -29  69 -39 100 -35  57   0  -1  -1   0  -1   0   1   2   2  -2
bkg36822416           11:   24 -13  29 -16  34 -20  44 -27  60 -35 100 -26   0   0  -0   1  -1  -1   0   1  -2  -2
bkg36820880           12:   -5  24  -8  27 -10  32 -13  41 -18  57 -26 100   1  -1  -1  -4   2   2   1   4  -0  -0
m6165a6ef_18          13:    2   2   1   1   0   1  -0   1  -0   0   0   1 100  42  19  -3 -33 -45   1   5   0  -0
hei                   14:   -2  -2  -0  -1  -1   0  -1   0  -0  -1   0  -1  42 100  69  16 -19 -69  -2  -6   1  -1
lo32132208_           15:   -1  -1  -1  -1  -1  -0  -1  -0  -0  -1  -0  -1  19  69 100   5 -10 -27  -2  -3   0  -0
lh28323456_           16:  -14  -5   0  -6  -1  -2  -1   0   1   0   1  -4  -3  16   5 100 -75 -24   5 -27  -1  -3
lg28322544_           17:    8   1  -1   3  -1   1   0  -1  -1  -1  -1   2 -33 -19 -10 -75 100  22  -5  13   0   3
prim_soll28565232_    18:    2   2  -0   1   2  -1   1  -1  -0   0  -1   2 -45 -69 -27 -24  22 100   2   8  -1   1
scale19573952_        19:   -0   4   2  -1   2  -0   1   1   0   1   0   1   1  -2  -2   5  -5   2 100  65   1   2
beq26238912_          20:   10   8   3   3   3   2   1   1  -0   2   1   4   5  -6  -3 -27  13   8  65 100   2  -9
x26884504_            21:    1   1   0   1  -0   2   0   3   0   2  -2  -0   0   1   0  -1   0  -1   1   2 100   1
beq26236032_          22:    2   2   3   3   4   3   4   1  -0  -2  -2  -0  -0  -1  -0  -3   3   1   2  -9   1 100
}