Michael Bramble

Planetary Scientist & Graduate Student at Brown University

Measuring grain size with two-dimensional X-ray diffraction

Published in the August-September issue of the American Mineralogist is a study I performed with Dr. Roberta Flemming and Dr. Phil McCausland at The University of Western Ontario where we investigated the applicability of a method for measuring the grain size of geological materials using two-dimensional X-ray diffraction. In this post I aim to explain this study in shared language for everyone.

X-ray diffraction

X-ray diffraction was invented at the start of the 20th century, and is a method to measure the spacing of atoms in a solid when they form a regular and repeating pattern. Crystals (rocks, minerals, metals, solid elements, and molecules) all have repeating patterns of atoms that build up to create the larger form. The best example of this is normal table salt, the mineral halite. The sodium and chlorine atoms bound together in a squarish pattern, and if you look closely you can see that salt is made up of tiny cubes, a macroscopic expression of the order on the atomic scale. The sodium and chlorine atoms make thin sheets of atoms that form cubes when stacked together, and when X-rays interact with these sheets they ‘reflect’ off (diffract) at equal incident and reflected angles and using Bragg’s Law  the distances between these sheets can be measured.


The geometry of diffracting X-rays in accordance with the Bragg “reflection” analogy (from Klug & Alexander, 1974).

When these reflected/diffracted X-rays are viewed in three-dimensions, they form Debye-Scherrer cones that originate from the reflection point and expand to infinity. When a two-dimensional detector intersects these cones, rings are observed on the two-dimensional detector image (see below). Using trigonometry, the spacing between these rings can tell you the spacing of planes of atoms in the atomic structure when the instrumental setup is known.


A depiction of the three-dimensional nature of diffracted X-rays. The method of production of Debye rings is portrayed and hypothetical d-spacings and 2-theta angles are shown (from Klug & Alexander, 1974).


Smooth Debye  diffraction rings of a fine grain (0.24 µm) magnetite sample.

Grain Size and X-ray Diffraction

Important for our study is the fact that the characteristics of these rings (smooth lines, spotty, discontinuous) alter as a function of the sample’s grain size (as well as other factors). Very fine grain sizes (~5 µm and less) display uniform smooth rings. As the grain sizes of samples increase there is a progression of the fine lines becoming spotty, the spots then begin to separate, and finally at large grain sizes (~100 µm and larger) the crystals produce large and spaced out spots on the detector image.


Spotty Debye diffraction rings of a coarser grain (10–15 µm) pyroxene sample.

The method we investigated was proposed in 2009 and, to the best of my knowledge, our investigation appears to be the first to apply this method the laboratory. This method uses physical theory to calculate the volume of material that is irradiated by the X-ray beam using constraints such as the diameter of the X-ray beam and the X-ray absorption characteristics of the material, and then this method divides this volume by the number of irradiated crystals within this volume. The number of crystals irradiated is calculated by counting the number of spots in a ring (using a computer algorithm) and then, when factors such as atomic planes that multiply reflect are taken into consideration, the number of irradiated crystals are enumerated. Essentially, a volume irradiated is calculated, and when this volume is divided by the number of crystals in this volume, the size of these crystals is measured (assuming that the crystals are spherical).

We applied this method to pyroxene, magnetite, and basalt sample suites of known grain size (as measured by sieve or scanning electron microscopy). The original proposer of the method suggested that the method should work on samples 0.1 to 100 µm in size. We found that for our samples and our instrument (a Bruker D8 Discover micro-X-ray diffractometer) correlating grain sizes were only measured in the range of ~15–63 μm. That is the main finding of this study. One cannot blindly assume that this method will generate an accurate grain size measurement in the range of 0.1–100 µm. The method needs to be calibrated for each instrument and experimental setup. The difficulty measuring correlating grain sizes in the upper size range was likely the result of fewer diffraction spots reaching the detector for a given Debye ring because of the instrumental setup. The lower limit disagreements in calculated grain sizes are likely due to the ‘spottiness’ of the Debye rings approaching the pixel density of the detector, and therefore the grain sizes calculated reached an asymptotic lower limit. With the current setup of the micro-X-Ray diffraction laboratory, the grain size measurement technique appeared most effective in the grain size range of ~15–63 µm.

This study is available through American Mineralogist, but is it behind a paywall. I have a link to the author’s copy that I am free to distribute to anyone. So please ask if you wish to know more and hit the paywall.

CheMin on MSL

I also applied this method to the two-dimensional X-ray diffraction data returned by the Chemistry and Mineralogy (CheMin) instrument on the Mars Science Laboratory Curiosity. CheMin vibrates its samples in front of the X-ray beam to provide a random distribution of crystal orientations for diffraction, and this method quickly blurs out any grain size contribution to the Debye rings. One experiment was attempted without sample vibration, but the low signal-to-noise ratio resulting form the short integration times similarly blurs any grain size contribution to the image into the background noise. The NASA Planetary Data System label files for the images also question whether the halting of the vibration was successful. Portions of these analyses were presented at the 2014 Lunar and Planetary Science conference, and the abstract and poster are available.

Klug, H. P., & Alexander, L. E. (1974). X-ray diffraction procedures for polycrystalline and amorphous materials (2d ed.). New York: Wiley.

How I processed the CheMin two-dimensional X-ray diffraction images

In this post I aim to briefly outline how I processed the two-dimensional X-ray diffraction (2D XRD) images produced by the instrument Chemistry and Mineralogy (CheMin), on the Mars Science Laboratory (MSL) Curiosity. I will outline the steps I took from acquisition of raw data from the Planetary Data System (PDS) to stacking the final images. All steps use freely available software.

DISCLAIMER: I have no involvement with the CheMin instrument, the MSL science team, nor do I have any formal training in handling these data. For my investigations of measuring grain size via 2D XRD images (seen elsewhere on this website) I wished to apply the method to the 2D images from CheMin. To do so I taught myself (by trial and error since no post like this one could be found) how to go from the raw experimental data products from the instrument to the stacked images I integrated my data from. Note that these data products still had some tribulations attached. This post is for anyone wishing to peek at the 2D data, but it is likely that the official data users of CheMin data process the 2D images very differently. Please contact those people if you wish to do a more rigorous analysis. END DISCLAIMER.

1. Data collection.

I found it easiest to acquire CheMin data via the ftp-like version of the PDS website. For this example, I’ll show you how I produced the quartz-beryl standard 2D image I used in my analyses. First, I recommend looking around the reduced data records (RDR) found under the msl-m-chemin-4-rdr-v1 link. If you proceed through the mslcmn_1xxx, data, and rdr4 links you arrive at a page with a list of csv and label files. These are the XRD and XRF data, processed and tabulated into two columns.

The quartz-beryl standard data are found in the two CMA_408288091RDA01220050926CH11520P1 files. If you download the csv file and plot it in any spreadsheet program, you will see that you are looking at the diffraction pattern. If you read the label file, you will read near the bottom that the 2D image used to produce this product was sourced from 6 minor frames. The individual file names of these frames are listed at the top of this label file under the name SOURCE_PRODUCT_ID. There are six file names here; copy them into a text file.

To collect these data files you could go back up the link tree to the data page and then proceed to the /msl/ page and then back down the line tree through the experimental data record (edr) list to find the data. You would have to find the day that the data was received on, and this is a pain, so I recommend simply googling the file names you copied. For example, googling the first minor image name (CMA_408288091EDA01220050926CH11520M1) will give you a link to the direct page in this PDS website where the data is found (and this post too, I guess : ) ). Click on the link and then use your browser to find the text on the page (Crtl + F and paste in the file name). You’ll now want to save both the label file and the image file (right click, and “save link as…”). Do this for all six minor frames (you can probably just search for the file names (using the list of names you saved) on this current page.

2. Convert .img files to .png files

I was not able to make use of the img files, not even in MATLAB nor proprietary XRD software. To change the images into more useful forms, I used the PDS program NASAView.

Note that I had to dust off my old Windows XP laptop for this step. I saved the img files with the original ~35 character file names, and the Mac version of the program seemed to not be able to work with data of such long names, but the Windows version handled it no problem.

To convert the images I opened them in NASAView using the File > Open Object dialogue and then navigated to the img file (I believe the lbl files needs to be in the same directory for the given image). The image should open. It’ll be completely black, but the data are there. I then saved the images as jpeg files via File > Save JPEG AS. You probably could use gif, it may have less compression problems, I’m not sure. Repeat this process for all of the source images for a particular XRD image, in the case of the quartz-beryl data you’ll have to do this six times.

3. Stacking and Summing.

The final steps in my processing pipeline were performed in the program ImageJ.

I don’t know why, but my first step was to convert the jpeg files into tiff files. So one by one I would open one of the jpeg images and Save As it as a tiff. After saving, keep the image open while you open another. If you choose not to convert the images, just simply open all of the images (six in the case of the quartz-beryl standard) and have them on the screen.

Now with all the images open on the screen, next go Image > Stacks > Images to Stack. This will simply stack all six images on top of each other vertically, as you might do for astrophotography. Next go Image > Stacks > Z Project. For the projection type, choose Sum Slices. You will now notice a diffraction ring starting to show on the image. Save this ‘summed’ image and the ‘stacked’ image as well.

The final step is to enhance the contrast so that you can clearly see all of the Debye rings. For this, I went Process > Enhance Contrast and just clicked Ok on the default settings. You now have arrived at the processed data product which I used for my calculations, and which resembles the CheMin 2D XRD images that can be found in publications. An image of this processed data product appears at the end of this post. These data are at the level where my next step was to integrate these images for the grain size analyses I performed.

I’d just like to end by repeating the disclaimer that the process outlined here is likely not at all similar to the process the CheMin team members use. That process is not easily discernible from the available literature, and it is not clear who to contact who would be willing to share this information with someone not on the team. This processing pipeline is intended for anyone wishing to take a look at the CheMin XRD data, and, like I say above, if you wish to perform rigorous analyses of these data, please contact the team members.



© 2017 Michael Bramble

Theme by Anders NorenUp ↑