Monday, June 15, 2015

(06/15/15) Python bit me where the sun don't shine! Aarrghh!

On second thought, it was more like my Windows laptop bit me in the butt today.

For my research in the Banneker Institute at the CfA, one of my first objectives is to create a "target list" of objects as preparation for my observation run on the MINERVA telescopes, located on Mt. Hopkins in Arizona.  Simply put, I am contributing to an all sky survey in search of exoplanets.  More specifically for my objectives, I will be using unique techniques during the observations in order to substantially increase the photometric precision more than ever before obtained for determining the physical properties of the exoplanets that I will find during observations.  Currently, there are 80 bright stars with exoplanet candidates that I intend to observe with MINERVA.  Moreover, I must choose about 3 stars per each of those 80 primary targets to observe as "comparison stars" for the relative photometry that I intend to analyze.  Researching ~240 stars and verifying that every comparison star is variable in its light emission is certainly a time consuming task!

This is where the gods of computer programming come in to save the day, especially for research interns like myself who have millions other time-consuming tasks to accomplish and must fulfill these obligations before the fall semester of classes begins.  Python, in particular, is now renown in the Astronomy community for superseding all other programs (including the former god-king of Astronomy programming, IDL) in terms of feasibility for getting the job done (with minimal bugs) and intuitive command syntax for making the life easier on a programmer.  But don't quote me on that.  Many astronomers still use IDL and would probably snarl at these assertions.

After doing much research, Python programming seems like the most efficient way to create the target list of ~240 stars I mentioned previously.  More specifically, there is a module called "astroquery" that seems like it can do EXACTLY what I want.  (I refer the reader to the following URL: http://astroquery.readthedocs.org/en/latest/simbad/simbad.html .)  Unfortunately, I did not have this astroquery package already installed into my Anaconda-Python software nor in my Cygwin-Python software.  Over the weekend, I fought for hours attempting to download this package.  Quite frankly, it was an uphill battle, when considering the fact that I know very little about "environment" of computers and "configuration" of software.  The first breakthrough came when I learned that I needed to install the "pip" command in order to conveniently install the astroquery module.  The pip installation was done successfully.  Afterwards, every attempt I made at getting astroquery on my computer was just a chaotic chain of events with an excessive amount of error messages.  For hours, I made baby steps of progress.

The progress was expedited when my advisor tackled the problem with me on today.  In summary, we learned that having 1 Python for Anaconda, 1 Python for 64-bit Cygwin Terminal, and 1 Python for 32-bit Terminal all on my computer was perilous to say the least.  Eventually, I uninstalled all of that and installed Python software files from a different computer that he was familiar with.  Subsequently, we used Windows' command prompt to execute the "pip install astroquery" command.  After each attempt at this, a new error message would appear and we would follow its instruction before running the command again.  Finally, on this cold and wet Cambridge June night,  I managed to get the module to work in Python when running the command prompt.  However, there are still some kinks to be worked out with my advisor tomorrow.  Nonetheless, I am a happy camper.  It's been rough way to start off this summer research but this was a great lesson for me to learn.  This is one of those significant moments that I will reminisce on as a moment that I substantially advanced my knowledge as a computer programmer.

Looking forward to whatever work, struggles, and/or achievements are waiting for me tomorrow. 

No comments:

Post a Comment