Skip to content

GSoC 2014 Pritish Chakraborty

Nabil Freij edited this page May 7, 2022 · 2 revisions

Application for GSOC 2014

Student Information

Name

Pritish Chakraborty

Time Zone

+0530 GMT

IRC handle

VaticanCameos@irc.freenode.net

GitHub account

VaticanCameos

Blog

http://thejoyofpython.wordpress.com/

Blog RSS Feed

http://www.thejoyofpython.wordpress.com/?tag=gsoc,python&feed=rss2

University Information

University

Manav Rachna International University

Major

Computer Science and Engineering

Current Year

2014

Graduation

July, 2014

Degree

Bachelor of Technology

Project Proposal Information

Title: SunPy: Re-implementation of sunpy.wcs as sunpy.coordinates using astropy.coordinates

Abstract

The paper by WT Thompson proposes a set of formal systems for describing the coordinates of solar image data. It is the cornerstone of the sunpy.wcs.wcs package, which contains the relevant classes and methods pertaining to the World Coordinate System and its implementations. There are different types of coordinate systems, such as Heliocentric, Heliographic and Helioprojective systems. Heliocentric coordinates can be represented in Cartesian, Spherical and Cylindrical forms. Heliographic coordinates can be represented in either Stonyhurst or Carrington format - one differs from the other only by a scalar offset. Additionally, there are also the inter-conversions between different coordinate systems.

Currently, sunpy.wcs.wcs utilizes the numpy library to get the job done. However, given the advent of Astropy APE5, which proposes to build a new framework for their package - astropy.coordinates - with the classes CoordinateRepresentation and CoordinateFrame, this provides an opportunity to re-base the coordinate system framework on astropy.coordinates. The design decision to use inheritance will help in re-using existing code. That is to say, the new coordinate system framework will use the same algorithms but will have derived classes whose parents are CoordinateRepresentation and CoordinateFrame, and will incorporate the Astropy API. This kind of design will also hold good stead in the future, when more coordinate systems and/or reference frames will be added. If required, the decorator design pattern may also be used at some point, if it is found that future coordinate systems differ little from their older counterparts.

My main goal would be to generate for the Helioprojective, Heliographic and Heliocentric systems their derived classes, their methods, their representations, and their inter-conversions. This would also involve potentially dabbling with Astropy, so learning about it - astropy.coordinates in particular - would be a priority. After having built the framework, I will look for areas where optimizations could possibly be made, if they haven't already. I will be following the test-driven development pattern, and every major change will be tested via py.test and all documentation so generated will be according to standards.

My secondary goal would be to work on integrating the astropy.units package into SunPy, such that it works in a seamless and smooth manner. The main goal will, of course, be given priority.

Detailed Description

Community bonding period (April 21 — May 18)

Communicate with mentor(s) and take note of any extra requirements and helpful insights (SWOT analysis). Comb through and do an extensive reading of the Astropy and SunPy documentations for coordinate system implementation. Implement the relevant packages of Astropy and SunPy in the interpreter for a working understanding. Establish a thorough mental picture of the APE5 guidelines to help when programming.

May 19 — May 26 (1 week)

Begin with the creation of the HelioProj, HelioCent and HelioGraph classes. These shall be made to derive from CoordinateFrame as already discussed. Create some unit tests to check whether the inheritance mechanism has been implemented properly.

May 27 — June 1 (1 week)

Based on feedback, possibly rework class design. Complete class design and basic methods by this week. Add the Stonyhurst and Carrington implementations of HelioGraph, such that HelioGraph is basically Carrington, but if the offset is zero, it becomes Stonyhurst. Check whether any particular reference frames are required after discussion with mentor(s). Test the changes.

June 2 — June 8 (1 week)

Create the Cylindrical, Spherical and Cartesian representations to the coordinate classes so created. Start setting up the inter-conversion framework. Test the new additions thoroughly. Fix any old or unexpected bugs and errors.

June 9 — June 22 (2 weeks)

Continue and complete the inter-conversion framework. As discussed on the ideas page, this will be done using the bi-directional transformation graph in astropy.coordinates. Systematic phasing out of the older functions of sunpy.wcs and bringing in the new model. Thorough testing at every stage of this phasing out.

June 23 — June 29 (1 week)

Documentation week. Document every new feature added according to the documentation guidelines. Enforce standards with sphinx to verify that everything is neat, indented properly and in order. Put across some pull requests on GitHub if everything is satisfactory and in order. Set sights on the Astropy codebase for the next half. Ace the mid-term evaluations!

June 30th — July 13 (2 weeks)

Before embarking on Astropy, perform some more unit testing on the code churned out so far. Go through the nitty-gritties of Astropy. Learn about the celestial coordinate systems which exist in Astropy and understand how to bring about conversions from celestial to solar coordinates. Code the basis for these conversions for future purposes.

July 14 — July 20 (1 week)

Start work on the holy grail: integration of astropy.units. It is of paramount importance to SunPy. astropy.units supports definition, conversions and arithmetic on physical quantities. The aim is to its ensure seamless integration into the SunPy codebase. Integration testing could be an indispensable tool for this particular piece of work.

July 21 — July 27 (1 week)

Continue the integration work that was started last week. units utilizes the class Quantity to do its work. Try to absorb class Quantity into the SunPy codebase. Set up the framework for future additions - make it reliable and scalable.

July 28 — August 10 (2 weeks)

The GSoC buffer period. Complete all documentation, testing, and sphinx related work in this period. If there is time, try and optimize the work done so far if it isn't optimized already.

August 11 — August 22 (> 1 week)

The GSoC pencils-down period. Finish any remaining work. Squash any remaining bugs. Sprint to (hopefully) glory.

Code Sample(s)

I have uploaded some patches on SunPy's Github which have been merged by means of pull requests. For example, the PR regarding repr for Wave provides a repr method for Wave objects, which are a part of VSO attributes. The PR which was made for distinguishing supported VSO objects provides a frozenset which contains attributes of VSO which are currently supported. Yet another ongoing PR deals with the restructuring of the Map package folder structure. This work has helped me get up to speed with SunPy's workflow.

I am currently working on a final year project for college which aims to convert PDF files to HTML files, which is a part of my industrial training which began last year. The PDF shall be single-columnar and have a simple layout, and may have images and some graphics which are not too complex in nature. The goal is to generate one HTML file per PDF page. These HTML files will then be used as input in a pre-built HTML to XML library, from where XML files which will contain whole exam question papers will be made. As such, this project is a sort of prequel to the industrial training project that I worked on.

To strengthen my grasp on Java, I had decided to find problems on data structures and algorithms and implement them in Java. While these may not exactly count as code samples, they are instrumental to my growth as a programmer. See DSA in Java.

Biography

I am a 21 year old college student, studying computer science and engineering and am in my final year. The first programming language that I ever touched was C, and it aroused a lot of interest in me. I delved into C++ using a college book and the Dev-C++ compiler, and taught myself a few things about classes and objects. I haven't looked back since then. I am thankful to my high-school computer science teacher for helping me develop a strong grasp in programming fundamentals. It was in high-school, again, that I got my mathematics and analytical capability sorted out.

However, I did not get the chance to take part in coding competitions until I was in college, and it was only the beginning. I managed to get to the final round in one competition and completed four out of seven programs in another one which was organized by an Indian company. My programming interests had, by then, shifted to Java and C#. I worked to get myself Oracle certified for Java SE 6 in 2012, and it has helped me to grasp Java a lot better. I plan to get started on TopCoder and CodeChef very soon, as a way to plug my earlier deficiencies in data structures and algorithms.

I completed my industrial training under a well known IT services company last year. In a team of four, I was made the lead and we built the offline version of their flagship assessment exam center product over a period of six months, in C#. I helped build the heavier modules and guided the others on their prowess. This training taught me a lot about how different real-world development is from writing simple programs as a hobby. Most importantly, it taught me how to absorb pressure and work against the odds, while working together as a team.

When I was a kid, I really wanted to be an astronaut on growing up. While that has not materialized, and career interests have greatly changed since then, the childlike fascination with astronomy remains. It is perhaps this fascination that has led me to SunPy, and by extension, AstroPy. My current career goal is to enter the field of information security. It was from here that stemmed my interest in Python: Python is the most frequently used scripting language in the grayhat world. Its natural elegance and easy high-level syntax make it the perfect candidate for a scripting language that every programmer should know. It is a well known fact that study and work experience combined can help one master a language. What better way to learn Python than to contribute to SunPy, I thought, and here I am!

Other Schedule Information

Note: Times in this section are GMT+530.

According to the tentative schedule released by my university, my semester exams will begin around the time of the coding period. I will try my best to complete 40 hours a week despite this minor tiff with exams. The good thing is that I have only five subjects whose exams will be conducted in this semester. In keeping with GSoC rules, I will be enrolled as a student as of April 27th, 2014.

Clone this wiki locally