Tuesday, June 11, 2013

Reproducing data from digitally scanned graphs

In our second activity in Applied Physics 186, we've been asked to reconstruct graphs that can be found from journals, books, or papers. For me, I find the activity exciting because the desired output graph should be of very high resemblance to the original. I like the challenge. And I always enjoy challenges (or maybe because I think that the activity was so demanding but I believe it can be done simply :P). It's also very interesting because this can just be done using only common applications like Paint and Microsoft Office Excel or other spreadsheet applications.


The figure above is the scanned image of the graph that I would reconstruct. This is from the journal, Effect of Laser-Induced Collisions on Chemical Reactions, Sister Kathleen Duffy, Proceedings of the 4th National Physics Congress, 1985. I would like to express my sincere gratitude to Abby Jayin and Chester Balingit, from whom I acquire the scanned image. 

First, the image was opened in GIMP, though Paint could also be used. I just used GIMP because this application is new to me and I would like to be familiar with it. The application has many tools and options that I think have many practical uses, which I would need to learn in preparation for my thesis :)  With the help of my very patient, understanding and pretty classmate, Phoebe Gallanosa, familiarizing with GIMP had been a lot easier. And for this, I am very thankful to her. 

In these image editing applications, positions of areas or points in any image can be defined numerically through its pixels. Pixel locations are usually found at the bottom of the application window. The scale of the actual unit or division in the graph with respect to the pixel was identified for both x- and y-axis. The scales were found to be 93 pixel/cm(unit of x-axis) and 23.2 pixel/arb.unit(unit of y-axis), respectively. The pixel locations of the data points in the plot were also recorded. I only considered the plot with the dashed line. At first, I found it difficult to relate the pixel to the actual values. The orientation of the pixel values (especially the y-axis) was just confusing. But then, I learned a trick. I found the pixel location of the origin (538, 590) important. I should have understand the correct shifting to consider the position (538, 590) to be (0,0) then use the scales to tranform pixel to actual values. The recorded pixel locations can then be converted to its actual measurement using the equations: 

xactual = (xpx - 538) / 93
yactual = (590 - ypx) / 23.2

where xactual and  yactual were the actual values of x and y; and xpx and ypx were the pixel values of x and y. 

Having the actual numerical values of the points, obviously, the plot can now be reproduced. The numerical data were all recorded in Excel and the points can readily be plotted. However, one big problem that I encountered is to find the perfect curve fit to the data, preferably similar to the fit of the original graph. No built-in trendline in the Excel produced a nice curve fitting. I think if I would want to copy the same trendline, I would need to read some parts of the journal in order to know the suitable curve fitting or maybe there's equation the author/s had used. 


The figure above shows my output. The original graph was overlaid into the reconstructed plot using some format in the Excel. Checking the resulting graph, I am overjoyed because the new data and the actual ones were very closely matched. In the figure, the red dots show the reconstructed plot. I think I would rate myself 11/10 because I believe I have generally accomplished the goal of the activity and the bonus part. I just feel a little unsatisfied not being able to reconstruct the curve fit of the data.

No comments:

Post a Comment