Coding for Dummies

Sabrina Marell

When I first came here this summer, I had zero coding experience. I saw computers only as a tool to look at Facebook and binge watch many shows on Netflix. In the past few weeks, this has changed drastically. As Mikayla stated, our research is focused on looking at data that was obtained from running different simulations of galaxy cluster mergers, and from that data calculating different statistics so that we will be able to gain a better understanding of what is occurring before, during, and after the merger. We are doing this by creating a code that allows us to manipulate the data how we see fit. Personally, what I have been focusing on is calculating different statistics that help to define the substructure of a galaxy cluster. I have been focusing on calculating the skewness and kurtosis of the velocity of the galaxy clusters over time. Skewness is defined as:

Screen Shot 2016-07-14 at 3.23.47 PM

Where is the average value of the data, and is their standard deviation, and N is the number of data points. Skewness is a measure of the asymmetry of the distribution. For a normal distribution, skewness will be zero and any data that is symmetric should have a skewness near zero. If the skewness is negative that means that the data is skewed left and positive values mean that the data is skewed to the right. When I say skewed to the left, I mean that the left tail of the distribution is longer than the right tail and the opposite goes for when I say the data is skewed to the right.


Fig 1: What the distribution looks like when skewness is positive, zero, and negative respectively.

Another diagnostic for substructure is kurtosis, which is defined as:

Screen Shot 2016-07-14 at 3.24.07 PM

Where again is the average value of the data, and is their standard deviation, and N is the number of data points. If a distribution is normal, the kurtosis will equal 3. If the distribution has a sharper peak and/or the tails of the distribution are heavier, then it will have a kurtosis greater than three. If the peak is flatter and/or the tails are much lighter, then the kurtosis will be less than three.


Fig 2: What the distribution looks like with negative and positive kurtosis

To calculate the skewness and kurtosis, I wrote a code in Python that sampled data from the simulations over time and then from this I was able to perform the calculations on it. For each time step there are about 100,000 data points to choose from. For my program I make it so that each time the program runs through it resamples about 100 data points randomly from the large pool of data we have in the file. The data that we have is data for velocity and position in the x, y and z direction for halo1 and halo2, which represent the 2 different clusters merging.


Fig 3: Distribution of velocity x, y, and z for halo1 and halo2 at time=0

Fig 4: Distribution of velocity x, y, and z for halo1 and halo2 at time=70

Fig 5: Distribution of velocity x, y, and z for halo1 and halo2 at time=110

After I calculated the skewness and kurtosis, I was then able to plot them over time with error bars that are the standard deviation, which is calculated over how many resamples we did at each time step.


Fig 6: Skewness of velocity x over time


Fig 7: Skewness of velocity y over time


Fig 8: Skewness of velocity z over time


Fig 9: Kurtosis of velocity x over time


Fig 10: Kurtosis of velocity y over time


Fig 11: Kurtosis of velocity z over time

On the plots for skewness, you can see for velocities y and z that the skewness for this particular merger is almost zero for both halos. We would expect both halos in this particular case to act very similar since they are the same mass and colliding head on. However, for velocity x, halo1 and halo2 are seen to be behaving differently, we are going to be looking into why this is occurring and what this is telling us about the merger. In the future I am going to be looking at these plots of skewness and kurtosis over time not just for this particular simulation, but also for simulations of mergers where the clusters are either of different mass or the collisions are not head on. I will then be analyzing the plots, seeing how they differ from each other, and what these plots are telling us about the merger itself. This week, I am also going to be writing a program for the Lee Statistic, which is another statistic that is a diagnostic for substructure.

Looking at a computer screen for 8 hours a day can get very mentally exhausting so in order to give our minds a break Dr. Johnson, Ross, Mikayla, and I all go out and have a hack break. We like to find a nice shady spot and hacky sack with each other for about 30 min to an hour. This hack break not only allows us to give our minds a break for a little bit and recharge, but I feel like it has also made the environment we work in feel like a relaxed and comfortable one. It also is really great physical activity; even if it doesn’t seem like it, you can really work up a sweat! We also sometimes go out to the observatory here on campus to take images of different things in space.

In addition to working with Dr. Johnson I also had the opportunity to travel to Flagstaff, Arizona with Professor Milingo and work with her and two other students, Mikayla and Ross, in gathering data on the star cluster NGC 6811. We were able to do this because Gettysburg College is part of a Consortium called NURO. NURO allows us to operate a 31” telescope at the Lowell Observatory in Flagstaff for four nights so Dr. Milingo is able to gather data.


Fig 12: 31’’ NURO telescope

Now these nights that we went to gather data were a little different than usual because, as Mikayla so accurately described it on Facebook, it was the week our sleep schedules were backwards. A typical night would be us heading out to the observatory at around 6:15pm.

IMG_1539 Fig.13: Us outside the observatory with Dr. Milingo

We would arrive at the observatory armed with a lot of ramen, and at times even a toaster and some avocadoes if we felt like being extra fancy later on in the night. Then after we set up camp we would go into the warm room and turn on all of the computers and start taking some bias shots (taking a picture with 0 second exposure) and flats (taking a picture of a blank, evenly colored part of the sky) with the telescope. Both are used to subtract any noise or other false data from our images. Then after the sun had finally set, we would begin to take images of the star cluster. We would take 6 images at once, which would take 30 minutes, and in between we got to play games like Cards Against Humanity (Milingo loved that one), go look at the night sky (which was breathtaking especially because we were able to see the Milky Way and you know space is cool and all that jazz), or watch a lot of Netflix (I got through an entire season of the show Bones). Then once the images were done we would check the focus and then just start the process again. This went on until around 4am. Though this trip was filled with sleep deprivation, it also was able to teach each of us how to operate the telescope (who we lovingly call Steve now) and gave us the opportunity to experience what observing is like and what a life as an observational astronomer could include. Also, besides all of the educational aspects of the trip we were also able to tour Flagstaff and Sedona, experience eating a burger at In N’ Out, and we got to go the Grand Canyon one day; which is a sight I feel as though everyone needs to see at least once in their lifetime, even those who are terrified of heights like me. This experience was so unbelievable and was truly unforgettable.


Fig 14: Seen while driving to Flagstaff, Arizona


Fig 15: Our beautiful lunch we had at In N’ Out


Fig 16: South Rim of the Grand Canyon


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s