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.

 

qb003