Testing Sq upload


It looks like .sq files and .gr files are not permitted by Dashboard for some reason.  Don’t know why.  Just rename the files so that they are clearly sq files but with a .txt extension.


In the same way that you are moving from the mediocre city of Appleton to the suburbs of Chicago, I am in the process of moving from Matlab to PDFgetX2.

I think the only thing I have left to “pack up” in Matlab is the binning part of my code. I haven’t come up with a good way of binning the q values and averaging them since they aren’t evenly spaced. What I have right now is a function that divides the count by the size of the q grid which should give me the number of points in each bin if they were evenly spaced. Then I divide that number by two and average that many points on either side of the q grid point to get my average intensity at that point.

To get comfortable with PDFgetX2’s operation, I have run all the files through without really trying to change the variables to what they should be. The manual suggests reading the book “Underneath the Bragg Peaks: Structural Analysis of Complex Materials” (Billinge and Egami) to truly understand the corrections that the program utilizes. The manual was not very helpful for understanding our unique situation.

I also got the mu t spreadsheet from Cody and Joe and entered all of our information to calculate the mu ts.

Today I’m going to go back in PDFgetX2 and try to enter the information accurately.


Here is my most current Matlab code as well as all the Matlab output files for the 5 ionic liquids. Each liquid also has an associated blank that I am not including. The blank files all come from the same scan, but they are just sized accordingly with the IL data file by q range and resolution.








“Gus Learns How to Code”

This summer I am dividing my time between the chemistry department (with Allison Fleshman) and the physics department at Lawrence. The work that I am doing with Prof. Mauro will be documented here. Unfortunately, the website AllisonMMFleshman.com/glowry does not exist yet, so my work with her will not be as readily available. She currently is looking into purchasing the rights to a website called GoTeam.com since that is her signature phrase.

This post offers a bit of a late introduction to my work, as we’ve reached the midpoint of the summer already. Thus, I will try to clearly explain the goals and progress of my research up to this point with plenty of background information.


My research this summer is working with ionic liquids.

Ionic liquids are room temperature salts that maintain a liquid phase. This is absolutely remarkable. Simple salts such as table salt (sodium chloride) have very high melting points. Because of this, they are solids at room temperature. In order to make sodium chloride a liquid, one would have to heat it to 1,474°F. This is why ionic liquids are so remarkable: their component ions are so big and bulky that they have trouble organizing themselves into solid state structure, even at ambient temperatures, and so they remain in the liquid state. Ionic liquids are very appealing to the battery industry as they could possibly replace lithium batteries as a safer alternative to the lithium electrolytes.

During the academic year, Prof. Mauro and I had been taking X-ray diffraction measurements of ionic liquids. The purpose of these measurements is to understand how the ions arrange themselves in the liquid phase. Is the ion arrangement random? Do the ions organize themselves into charge-protected structures? Answers to these questions will hopefully help us explain the results from my work with Prof. Fleshman on how the ions in ionic liquids move.

Now more background.

X-ray diffraction has been traditionally done on crystals (crystallography). Crystals exhibit long range order which means that in a perfect world and in a perfect crystal, anywhere you look inside the crystal the atoms are going to be organized in precisely the same way. The distances between the atoms never changes and their ordering is repeated throughout the crystal. This is very convenient for x-ray crystallographers because they can easily (think geometry) find the distances between the atoms since these distances are so consistent throughout the crystal. Additionally, x-ray diffraction has been proven to work well as a characterization technique on samples other than crystals, such as powder samples and is even being used to find the structures of complex proteins, but it is relatively new as a technique for analysis of liquid samples.

Back to the research.

Essentially my project for Prof. Mauro this summer is to write a computer program that can open up one of our x-ray diffraction data files that we collected during the academic year, read through the file, pick out important information, organize the actual data we collected, and analyze that data. As you probably learned from the title of this post, before this summer I had never programmed in my life. There’s been a bit of a learning curve. The program that I learned to use (and am currently using) is called Matlab. It is a text-based program that defines all of your variables as matrices. Yes that is the plural of matrix, yes they look like this:

1   2   3

4   5   6

7   8   9

Anyway, here we are in week 5 (of 10) and what do I have to show for it??? Well, I have a program that can open our data files, read through them, pick out the important information, and organize the data. The way I said “analyze that data” above made the next step sound a little oversimplified. Currently, the data files that I am working with are composed of a bunch of x values and a bunch of y values in addition to information about the diffraction conditions. Matlab likes to organize the variables into arrays like this:

[x value 1, x value 2, x value 3,…]

These arrays can be plotted against each other if and only if they are the same size. Well as luck would have it, they are the same size for each individual file. However, if you want to compare two files directly or subtract one from the other (in the case of a background which is data from a blank sample container) then they must be sized accordingly. Today, in fact, I just accomplished this goal of being able to compare the sample files directly (the first step to analysis) by writing in a few commands that give the data a common size, and scale them appropriately. I’ve included a text file containing my code. Currently, it could use a little reorganization as there is a smoothing function that I’ve written into it to “smooth” noisy data. For our analysis, this smoothing will likely happen later on in the process, if at all.

I’d say I’ve come a pretty long way in 5 weeks both in my understanding of computer programming, specifically Matlab, and my familiarity with x-ray diffraction through independent reading of material and experimentation. Fortunately, I still have 5 more weeks to accomplish the end goal.



Example XRD data file

This is an example of what my x-ray diffraction data files look like. This is the physical information that my code is analyzing.