Getting Through GSoC (I guess so)

There are two types of people in this world. The ones who are well with their words and the ones who simply aren’t. Yes, I am referring to the sociable “Irene Adler”s and the mysterious “Sherlock Holmes”s out there. Wait a second, that doesn’t sound quite right. Have you heard that there is always an exception to the rule? Well in this case, there is me, falling in neither category. A testified grandiloquent who can blabber on so much, that by the time you finish reading this, you would probably lose faith in humanity.


DISCLAIMER: Those with low patience levels / ADHD / who are prone to being choleric, do not say that I didn’t warn you about the length of this text. Although I must say that you will definitely enjoy reading it (that is what I will be telling myself).  I have been told that I get distracted way too easily. So let me get back on track. I am rather late in posting all of this, but I can assure you that I have been extremely punctual with my work (it is not an option when you take on such herculean tasks). Moving on, I will be rewinding a little bit, to sort of like have a flashback of the past month, solely for the sake of my satisfaction.

The GSoC acceptance day went by with the following exclamatory statements, “OH MY GOD!” *RING* *RING* “I GOT IN!” *RING* *RING* “DID I?” *RING* *RING* “I GUESS SO!” *RING* *RING* “Me to me: STOP IT AARYA, WILL YOU?” and a little bit of dancing around (probably a lot of it). The following days were quite ecstatic, characterised by a lot of galloping around here and there.

Then, the much awaited semester exams (awaited to end) came head on and I should say I got through it (let us all hope that I did). My mentors were amazingly understanding during these days of my woe and I am so happy to have them (not trying to flatter them, really). After a day or two of relief, I eventually had to get back to reality. However, I am the kind of person who hates “not” being busy, so for me it was a win win situation.

Then came the real obstacle, the “Representations of Time Coordinates in FITS” Journal with 22 pages of flexibility for the astronomical community and months of headache for me 🙂 I had to learn about Time, the way it is contemplated by astronomers round the world and the plethora of options available in order to do so.

Calculations in any scientific discipline may involve precise time, but what sets astronomy apart is the number and variety of time scales that have to be used. Although the era of new and precise “Atomic Time” scales is emerging, astronomy continues to deal with the very phenomena that lie behind the conventionally used but quite obsolete time scales, in particular the rotation of the Earth and the motion of the planets. Thus, we have our own fossil record of time scales, carbon-dating to the evolution of humans (okay that went a little too far, but I guess you get the point).

Now, you might be wondering what a time scale is. It is simply a specification for measuring time: either the rate at which it passes or points in time; or both. But WHY DO WE NEED IT? Well, the very misconception lies in the faith that a day consists of exactly 86,400 seconds. If we consider the atomic clocks round the world, which are also the official time-keeping standards, they do run at this rate. But the UTC time that we all follow so blindly, does not exactly do so. To my surprise, there is a concept of “leap seconds” where a second is added to a day once in a while to sort of like stop the clock for a while so that it catches up with the earth’s rotation. Why don’t they add multiple such seconds before the day of my exam? (eternal woes of life)

If we could all recollect a little bit of physics that we have learnt so far, we would realise that it all depends on the context or the reference frame. Whether time is based on the Earth’s rotation, which is irregular due to various reasons, making it unsuitable for several cases, or it is the “proper” time at our exact location, it all really does matter. After all, precision might be the better half of an astronomer’s life (probably because the universe makes it so difficult to have this idealistic thought). The concept of absolute time, as we all know, has been scraped off by General Relativity and it does make a difference whether your calculations are associated with the Geocentre (The Earth) or the Barycentre (The Sun) or just an ordinary observatory location. Frankly, I feel a sense of enlightenment when I talk about the universe and things like general relativity (partly because I find it extremely cool). But we don’t want me to die while writing this. I will thus conclude this part by saying that time is, in itself, an extremely intriguing concept. A big shout out to GSoC for making me understand it all so vividly.

The weekly conference calls with my mentors are when I actually unfold the extent of this problem and they have been rather amazing I must tell you. I have fairly restrained myself from being this chatty there, as I do not want them to miss their meetings (I am very much capable of doing so) but I think that will soon change.

Summing up, the community bonding period and the first week of official coding passed by rather too quickly.  To be honest, the golden embellishment to all this “Time Jargon” has been this one statement, that I made sure I tell each and every soul I possibly know or could know, and knowing it has made me so very proud of myself. Don’t worry, I will let you know of this knowledge as well. Here it goes,

“The duration of 9,192,631,770 periods of the radiation corresponding to the transition between the two hyperfine levels of the ground state of the caesium 133 atom”, the latter being at 0 K and in zero magnetic field stands for, yes the SI SECOND. *SIGH* This is where I will leave you thinking and wondering about how your entire life has been a lie (please don’t take that too seriously).

Eventually, I did end up condensing the 22 Pages FITS journal into a 4 page vital summary (which took so much time and I believe I did a fantastic job, do not dare say otherwise, *takes a bow*). I also understood the various obstacles that are involved in this project and how each of them contributes to the difficulty of the problem. Quoting my mentors, “This has been an issue for years and people say it is easy. Well, we know it is not”. (they truly understand me, *sobs a little*).

Coming to the technical part, the project is mainly focused on the long-standing issue #3000. This is one part of the aimed seamless interoperability between the three powerful components of AstroPy : coordinates, time and units and the underlying AstroPy Table writers, particularly FITS. So, my task is to allow Time columns in Astropy Tables to be written to FITS as Binary Tables and reading them back with an idealistic goal of 100% round-tripping (that, my friend, is very difficult but I will get there, one day). This would also include reading existing FITS files supporting time coordinate columns which is a pretty tricky job.

I have currently opened a Pull Request which took an arduous effort to make it what it is today. Well, that was bound to happen, since the io.fits sub-package code has made me want to pull my hair out (not kidding). It is a beautifully written code, no doubt, and the flow of control is impeccably organised into multiple cleanly designed classes. But, that just makes my job harder, doesn’t it?

The PR introduces a time module within io.fits, as a preliminary version to write and read AstroPy Tables containing Time columns to and from FITS files. Currently, I have taken care of writing Time by writing it as a (N,2) column with each element as a vector (jd1, jd2) and an explicit AstroPy format keyword. Considerable round-tripping of AstroPy written “FITS Binary Tables containing time coordinate columns” has been achieved. This includes metadata : scale, format and singular location. I have also started work on reading generic FITS Binary Table files, by generic I mean not written by AstroPy.

I reckon it is always the small things in life that make a difference. I cannot express how happy I feel looking at the code that I have produced within the past week or so. It might be simple (I would definitely falsify this if you try to say so), but it is something that I have really loved doing and it does make me utterly butterly happy (in spite of all the cribbing that you just had to go through).

Just because I am too attached to this link for now, I am posting it here for no reason whatsoever :

Now I have a few failures that I need to solve, because travis never lets you be calm. 🙂 It is also 4 am here and I guess I need to get some sleep. You should be happy, you can finally go now. Or did my idiosyncrasies appeal to you to the point that you would want to listen to more of this? (I will hope that is true). Thus, this is how fast time passes by (maybe the scales aren’t so accurate after all) and that is how people get through. I got through two amazing weeks of coding and I am looking forward to the rest. Till then, Adios mate and wait for my next blog post!




Google Summer of Code

I am the kind of person who loves writing. So I would first like to acknowledge the fact that GSOC gave me another medium to do so.

Now the purpose of this blog is Google Summer of Code. To talk about my project, my experience with GSOC and fingers crossed, if I do get selected, talking about my work throughout the summer. I believe words have a lot of power in them, be it in conversations or in codes. Just as I look forward to working in the world of open source, I would like my thoughts to be so too.

So for me, the procedure for GSOC started from checking ideas posted under the OpenAstronomy umbrella, specially those under Astropy. It was rather an obvious choice for someone who loves astronomy and is somewhat a computer geek. I stumbled upon the project “Seamless Combination of SkyCoord, WCS, Table and FITS”. I read a little about its description and I could actually relate to the issue that the project wanted to tackle. And somehow it made this amateur astronomer a little happy. Not just because it made me feel like I have stepped into the field of astronomy (a little bit yes), but also because it intrigued me to the point that I happened to read about it for hours together. FITS and I go a long way, and I am happy to say it hasn’t disappointed me (yet).

An excerpt from my story

It is rare that you find such joy in something, that you cannot explain the very existence of it. I love gazing at the stars, pondering upon the basic questions of nature, I love understanding the universe, believing in the energy of it and I yet hate to not have the answers to all of it. It has been rather paradoxical, the stream of my thoughts, but it is why I want to spend my life trying to comprehend it.

I was introduced to night sky observations at a very young age, thanks to my father’s love for the stars, which I can now proudly say runs in our genes. Being brought up in a city, I used to eagerly wait for the summers to travel to my native place, a small village nearby, to be away from the urban lights. My father and I were once sitting on the roof of our quaint little country cottage, gazing at the heavens above, in awe of a canvas of black and white. I simply asked him, “Could there be a unified theory to explain it all?”. He said he didn’t know. So I penned it down, my first ever literary work, probably thinking someday someone might answer it. I found a way to my lingual glories and later discovered that I wanted to be that someone, finding answers to the fundamentals of nature.

It has been rather stereotypical to either be a hopeless romantic of the arts or to develop a scientific skepticism, but I’ve never been a stickler for stereotypes. I like to believe great science requires greater imagination. In school, I developed an affinity towards physics, because it fed my curiosity of the clockwork of the universe and mathematics; the language of physics. Starting with the fundamentals by Halliday & Resnick, I slowly levitated towards Hawking, Feynman and Griffith. These weren’t just ordinary textbooks, for me they were intellectually enticing works of art on how the world works in the physics domain. I was always more of a self learner and somewhat of a teacher. I loved discovering new things and sharing my enthusiasm with like minded people. Nothing gave me greater thrill than solving an intriguing problem. It paid its due when I was awarded a scholarship by the Government of India for securing a rank in their examination. This began my journey in the pursuit of science as a career. During this time, I also involved myself in sketching and writing as a hobby. In addition to representing my state in the national level drawing competition, I started writing poems for my school plays. Recently, I have developed a new passion in blogging. This has been a perfect coalescence of my individuality.

When in junior college, one of my friends asked me to be his partner in a programming competition. I did not know how to code, but the problems were enticing and those three hours transformed my life. I was absolutely amazed at how a difficult problem could be solved by tackling one logical component at a time, at least if it’s not an NP complete problem. This resembled the way the modules of the universe are governed by the fundamental laws of physics, and I knew just what I wanted to do.

I am currently a third-year student at Pune Institute of Computer Technology (India) majoring in computer engineering and I want to work in the field of computational astrophysics/physics. It took me some time to realise the interdisciplinary nature of the fields of science, but I’m glad I did.