#Monte-Carlo fitting/refinement of the texture parameters

# (1) Experimental parameters:

Number of files = 15
integration mode (eta/band_positive_Y/band_negative_Y) = band_positive_Y
Projects\Fit\Measured-intensities-for-texture-fit\Ti-23-measured-intensities-RDZ-N002.dat	0	180	36	60	-15	-90	0
Projects\Fit\Measured-intensities-for-texture-fit\Ti-23-measured-intensities-RDZ-N003.dat	0	180	12	36	-15	-90	0
Projects\Fit\Measured-intensities-for-texture-fit\Ti-23-measured-intensities-RDZ-N004.dat	0	180	-12	12	-15	-90	0
Projects\Fit\Measured-intensities-for-texture-fit\Ti-23-measured-intensities-RDZ-N005.dat	0	180	-36	-12	-15	-90	0
Projects\Fit\Measured-intensities-for-texture-fit\Ti-23-measured-intensities-RDZ-N006.dat	0	180	-60	-36	-15	-90	0
Projects\Fit\Measured-intensities-for-texture-fit\Ti-23-measured-intensities-TDZ-N002.dat	0	180	36	60	-15	-90	-90
Projects\Fit\Measured-intensities-for-texture-fit\Ti-23-measured-intensities-TDZ-N003.dat	0	180	12	36	-15	-90	-90
Projects\Fit\Measured-intensities-for-texture-fit\Ti-23-measured-intensities-TDZ-N004.dat	0	180	-12	12	-15	-90	-90
Projects\Fit\Measured-intensities-for-texture-fit\Ti-23-measured-intensities-TDZ-N005.dat	0	180	-36	-12	-15	-90	-90
Projects\Fit\Measured-intensities-for-texture-fit\Ti-23-measured-intensities-TDZ-N006.dat	0	180	-60	-36	-15	-90	-90
Projects\Fit\Measured-intensities-for-texture-fit\Ti-23-measured-intensities-45Z-N002.dat	0	180	36	60	-15	-90	-45
Projects\Fit\Measured-intensities-for-texture-fit\Ti-23-measured-intensities-45Z-N003.dat	0	180	12	36	-15	-90	-45
Projects\Fit\Measured-intensities-for-texture-fit\Ti-23-measured-intensities-45Z-N004.dat	0	180	-12	12	-15	-90	-45
Projects\Fit\Measured-intensities-for-texture-fit\Ti-23-measured-intensities-45Z-N005.dat	0	180	-36	-12	-15	-90	-45
Projects\Fit\Measured-intensities-for-texture-fit\Ti-23-measured-intensities-45Z-N006.dat	0	180	-60	-36	-15	-90	-45


# (2) Monte-Carlo Fit/Refine Control parameters:

Number of MC steps = 10000

minimal and maximal values of texture parameters:
fraction	0.0		1.0
Phi_1		-180	180
PHI			0.0		90.0
Phi_2		0.0		60.0
FWHM		0.3		0.7

Number of Texture Components = 8

constraints for texture parameters:
text.comp.	#1	#2	#3	#4	#5	#6	#7	#8
fraction	1	1	1	1	5	5	5	5
Phi_1		1	1	1	1	5	5	5	5
PHI			1	2	3	4	-1	-2	-3	-4
Phi_2		1	1	1	1	5	5	5	5
FWHM		1	1	1	1	5	5	5	5


#### NOTES and HELP:


## (1) Experimental parameters:

#First you need to specify the number of files which contain the measured X-ray intensities (integrated intensities, i.e. integration alongside 2theta) of hkl peaks. 
	(In these files the first column must be the hkl value, the second column must be the integrated intensity of the hkl peak)
#Then you need to specify the azimuthal integration mode (i.e. integration alongside eta) of the DS rings, with which you got the hkl peaks:
	if 'eta' then eta_min and eta_max integration limits need to be given,
	if 'band_positive_Y' or 'band_negative_Y' then an integration band located on +Y or -Y side determines the eta_min and eta_max integration limits for all hkl rings.
	(the vertical width of the band is defined by Z_min and Z_max)
#Then you need to specify for all files: the file names (with full path), the allowed 2theta_min and 2theta_max values,
	the Z_min (or eta_min) values, the Z_max (or eta_max) values, 
	and the alpha, beta and gamma Eulerian angles of specimen orientations, respectively.
	In this way: Path\Filename.extension	2theta_min[deg]	2theta_max[deg]	Z_min[mm]/eta_min[deg]	Z_max[mm]/eta_max	alpha[deg]	beta[deg]	gamma[deg]

	
## (2) Monte-Carlo Fit/Refine Control parameters:

#First you need to specify the number of Monte-Carlo (MC) steps, then min and max limits of texture parameters, then the number of texture components,
	then constraints for the texture component parameters (fraction, Eulerian angles and FWHM for all components, respectively).
#If one constraint parameter is '0', then this parameter is fixed (will not be refined) during the MC procedure.
#If one constraint parameter is 'n' (where 'n' is an integer), then this parameter will be
	either refined, if it is identical with its texture component serial number, or
	linked with all the other former texture component parameters which also have 'n' value. All of them will change identically during the MC procedure.
#If one constraint parameter is '-n', then this will change identically with all n values, but with negative sign (where negative value is allowed).
#'n' cannot be larger than the texture component serial number, i.e.
	the first 'constraint parameters' (belonging to #1 texture comp.) can only be 0 or 1,
	the second 'constraint parameters' (belonging to #2 texture comp.) can only be 0, 1 or 2 (and -1),
	the third 'constraint parameters' (belonging to #3 texture comp.) can only be 0, 1, 2 or 3 (and -1 or -2), and so on.
#example:
	PHI		1	2	-1	-2	3	6	0
	this line that consists of 'constraint parameters' for PHI texture parameter means (we have 7 texture components here): 
	PHI(#1) is refining freely, PHI(#2) is refining freely,  PHI(#3)=-PHI(#1), PHI(#4)=-PHI(#2), PHI(#5)=PHI(#3)=-PHI(#1), PHI(#6) is refining freely, PHI(#7) is fixed
#min and max texture parameter values matter only if one parameter is refining freely, i.e. its 'constraint parameters' equals its texture component serial number.
	When negative constraint parameter (-n) is used, i.e. the parameter is linked with the n-th value with negative sign, then only the absolute value of the parameter has to fulfil the min-max conditions.
	example: if min_PHI=20 and max_PHI=40 and the third constraint parameter is -1, then the PHI(#1) value can only be between 20 and 40, however PHI(#3) can be between -20 and -40. 
