In the work related to this dataset, we propose a fast and quantitative method for the in situ characterization of dispersions of polydisperse nanoplatelets on the example of graphene nanoplatelets (GNPs) and gibbsite. The method relies on synchrotron small-angle X-ray scattering (SAXS). The SAXS data are fitted with a polydisperse form factor for platelets, which yields size distributions in both thickness and radius. This dataset contains the SAXS data and mathematica scripts to process the data, fit a form factor and visualize the results. In addition, the dataset contains data from additional characterization: dynamic light scattering (DLS) and transmission electron microscopy (TEM).

The dataset is organized according to measurement technique. It contains the following folders:
* SAXS data: the raw and averaged SAXS data (*.h5), all azimuthally averaged. For the raw 2D SAXS patterns, see the ESRF data repository: https://data.esrf.fr/doi/10.15151/ESRF-DC-1388457372
* DLS data: the DLS data as obtain with the Litesizer (*.xlsx)
* TEM data: the raw and processed TEM images for gibbsite E27. It also includes the measurement data.
* SAXS analysis: The analysis pipeline developed in Mathematica (*.nb), which is required to exactly reproduce the analysis from the corresponding manuscript. 
* SAXS analysis Python: A conversion of the Mathematica analysis pipeline to Python (*.ipynb). This script is intended as an accessible, open-access implementation of the data analysis pipeline. It might give slightly different results from the Mathematica implementation due to differences in the fit algorithms, but the analysis procedure is the same. The only difference is that the Python script requires an averaged, background subtracted and merged SAXS dataset in *.csv format with two columns (q, I(q)) as input, whereas the Mathematica script also covers the averaging, background subtraction and merging of the *.h5 data obtained from the IDO2 beamline. To make the Python script as widely applicable as possible to SAXS data from different sources, the choice was made to let users pre-process their data with their preferred software and to start the data analysis in Python from the binning step with *.csv data as input.

------------------------------------------------------------------------------

To use the Mathematica scripts, follow these steps:

1. First the notebook "Polydisp fitting functions thickness and radius - number weighing full form factor.nb" should be run. It does the following: 
* It imports all the data from the SAXS data folder (note that you should set the folder location to the relevant storage location on your computer). 
* The notebook contains all prerequisite functions for data processing (background subtraction, merging of SAXS patterns, averaging, binning, slope calculation), form factor fitting and visualization.
* It contains some example form factor as also provided in Figure (S)1. 

2. To analyze a specific SAXS sample, run the notebook in the corresponding folder with the suffix "- number", e.g. "Sample playground LH-ESRF-C22 NEW.nb". These notebooks contain the number-weighted SAXS analysis as detailed in the manuscript. 

3. To compare the SAXS data with DLS data, the SAXS data was analyzed in an intensity-weighted manner rather than number weighted. To reproduce these findings, first run the notebook "Polydisp fitting functions thickness and radius - intensity weighing.nb" and follow with the notebook (suffix: "- intensity") for the sample of interest. Note: these intensity-weighted scripts were ONLY used to compare SAXS with DLS data.

Note: the analysis was performed in Mathematica 13.2.

------------------------------------------------------------------------------

To use the Python Jupyter Notebooks, follow these steps:
* Install Python and Jupyter notebooks. We recommend to install it via the Anaconda environment. See: https://www.anaconda.com/download/ and https://www.askpython.com/python/examples/install-python-with-conda. 
* To run the Jupyter notebook (e.g. the file AnalysisE72.ipynb), do the following:
	* Open an Anaconda prompt
	* Change locations to the folder where you saved the Jupyter notebook via the following command: cd <folder path>
	* Run Jupyter notebook by typing: jupyter notebook
	* A file overview should open in your browser. Double click the notebook you want to run.
* To run the notebook, you need the following:
	* *.csv file with your averaged and merged SAXS data of the q-range of interest
	* (optional) Pre-calculated form factor table ("P11_table.csv"). Alternatively, you may calculate your own table spanning a range of thicknesses and radii of your own interest. Be aware that the calculation of this form factor table takes rather long depending on the number of data points in there. 

Note: the analysis was performed in Jupyter Notebook version 6.5.2.

A working example is also available on Github: https://github.com/mark-vis/saxs_plates

------------------------------------------------------------------------------

Sample names:

C14: GNP synthesized with 6 mg/mL EC, 500*g centrifugation
C15: GNP synthesized with 6 mg/mL EC, 1000*g centrifugation
C16: GNP synthesized with 6 mg/mL EC, 2000*g centrifugation
C20: GNP synthesized with 3 mg/mL EC, 500*g centrifugation
C21: GNP synthesized with 3 mg/mL EC, 1000*g centrifugation
C22: GNP synthesized with 3 mg/mL EC, 2000*g centrifugation

E27: Gibbsite from Janne-Mieke Meijer & Tom Jenniskens (1.0 wt% in water)
E72: Gibbsite from Mark Vis DB940 (0.18 wt% in water)

------------------------------------------------------------------------------

Update version 2 (before publication of the corresponding manuscript):

We made several changes to the code:
* We switched to plotting diameters rather than radii
* We added a bin size correction to the form factor: previously, we had assumed linear bin sizes but this was not correct due to the double logarithmic nature of the SAXS curves.
* We added a PowerTicks3 function to make the form factor plots with tick marks every 3 decades instead of every 2.
* We added a (generalized) translation of the Mathematica script to Python. 

------------------------------------------------------------------------------

How to cite:
Manuscript "Morphological analysis of polydisperse nanoplatelets using SAXS" (2024) by L.S. van Hazendonk, R. Tuinier, E. Foschino, L. Matthews, H. Friedrich and M. Vis. Please cite the manuscript when using this script. Not yet submitted to a journal at the time of submission to the data repository.