2 weeks into GSoC

I had a feeling in the community bonding period that something will mess up at the start of the coding period as I had the toughest part lined at the start. The same did happen… At the start, I had two weeks for porting reproject from Astropy. In short what it does is, it align two different astronomical images into a single frame of reference. While capturing an astronomical image, different conditions(like the position of the sky) affects the image captured. Thus, two images of the same region of interest will not be exactly similar when taken under different conditions. It may require to rotate, translate or interpolate them to get the result.

So where the difficulty arises for me?

Astropy is a very mature library but support for Astronomy in Julia is still growing. This means that I can’t port line by line, I need to be creative. Plus the utility functions which the python version of reproject calls was not present in Julia. So at a basic level, it meant I had to port every other function in Julia or get a workaround using the existing things. So a project part which seemed within bounds at the beginning started growing exponentially and I haven’t planned this.

So how I went ahead to complete it?

In 2-3 days I realized how tuff this is going to be. Several iterations happened with the python version, tracing its output at each step and understanding the high-level working of the steps. I choose to focus on reproducing the high-level steps because going to low-level outputs might have forced me to port many things to reproduce the same result. Thus a wise choice at my end :)

So, understanding the codebase and a possible workaround a week passed by. I was able to proceed in the right direction but after that I felt I hit a dead-end. I had reached the essence of the port, the crucial part which was calling the tricks here. I took some time understanding what it does in a whole. It converts coordinates between frames(like FK5, ICRS, Galactic etc.). I was lucky enough to find a subset of this functionality in SkyCoords.jl in Julia. I tweaked it a bit to get what I wanted.

4 days until the 2nd week ends, I was sure I was going in the right direction and the intermediate results which I was comparing also starting to match. But I asked the mentors for an extension into 3rd weeks for this as I wasn’t still sure I will get the exact results. I still wasn’t able to reproject my very first image. Extension granted, thanks to my mentors.

On Saturday, 2 days to before 2 weeks, something really clever clicked my mind and I was unable to restrain myself from coding it. And finally my first reprojected image, the idea has worked as it was supposed to: I was so happy at the results!!

So what’s next for 2 weeks?

With reproject complete, next is

  • ccd2rgb function: It takes 3 images (B/W), reprojects them and finally converts them into a single coloured image.

  • Writing extensive test and documentation for reproject.

Also, I’m going as per my schedule and I think I will be able to start some part of 5th week in the 4th week itself.