A method of measuring properties of a thin film stack made up of known physical materials and interfaces between the physical materials, the method comprising: defining an ordered list of a plurality of layers of different physical materials in the stack, and defining for each physical material a respective defined index value (i), wherein the defined index values monotonically increase or monotonically decrease along the ordered list; measuring a grazing incidence X-ray reflectivity curve of intensity against angle for a range of angles; and setting up an array of N sub-layers (j) representing the thin film stack, each element of the array of sub-layers having a defined parameter P j representing the composition of that sub-layer; fitting the parameters P j so that a calculated grazing incidence X-ray reflectivity curve against angle as a function of the parameters P j most accurately matches the measured grazing incidence X-ray reflectivity curve against angle over the range of angles to obtain fitted parameters P̃ j; and outputting a measure of the composition of the thin film stack based on the fitted parameters P̃ j; wherein the parameters P j have values that are defined: (a) to represent the respective physical material when the parameter P j has one of the defined index values; and (b) when the value P j lies between a pair of consecutive defined index values, to represent a composition that is a mixture of the physical materials of the pair of consecutive defined index values, the value of P j monotonically changing from the defined index value of a first physical material of the physical materials of the pair of consecutive defined index values to the defined index value of the other physical material of the physical materials of the pair of consecutive defined index values as the composition changes from pure first physical material to pure second physical material. defining an ordered list of a plurality of layers of different physical materials in the stack, and defining for each physical material a respective defined index value (i), wherein the defined index values monotonically increase or monotonically decrease along the ordered list; measuring a grazing incidence X-ray reflectivity curve of intensity against angle for a range of angles; and setting up an array of N sub-layers (j) representing the thin film stack, each element of the array of sub-layers having a defined parameter P j representing the composition of that sub-layer; fitting the parameters P j so that a calculated grazing incidence X-ray reflectivity curve against angle as a function of the parameters P j most accurately matches the measured grazing incidence X-ray reflectivity curve against angle over the range of angles to obtain fitted parameters P̃ j; and outputting a measure of the composition of the thin film stack based on the fitted parameters P̃ j; wherein the parameters P j have values that are defined: (a) to represent the respective physical material when the parameter P j has one of the defined index values; and (b) when the value P j lies between a pair of consecutive defined index values, to represent a composition that is a mixture of the physical materials of the pair of consecutive defined index values, the value of P j monotonically changing from the defined index value of a first physical material of the physical materials of the pair of consecutive defined index values to the defined index value of the other physical material of the physical materials of the pair of consecutive defined index values as the composition changes from pure first physical material to pure second physical material. (a) to represent the respective physical material when the parameter P j has one of the defined index values; and (b) when the value P j lies between a pair of consecutive defined index values, to represent a composition that is a mixture of the physical materials of the pair of consecutive defined index values, the value of P j monotonically changing from the defined index value of a first physical material of the physical materials of the pair of consecutive defined index values to the defined index value of the other physical material of the physical materials of the pair of consecutive defined index values as the composition changes from pure first physical material to pure second physical material.