Skip to content

Instantly share code, notes, and snippets.

@sarthak2007
Last active August 9, 2020 11:16
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sarthak2007/e4cc8b1d5aad194030ba4bfa183a87ef to your computer and use it in GitHub Desktop.
Save sarthak2007/e4cc8b1d5aad194030ba4bfa183a87ef to your computer and use it in GitHub Desktop.
Final report of GSoC'19 project

GSoC2019: Bringing Boost.Astronomy to review-ready state

Mentors: Ruchika Joshi, David Bellot

Organization: Boost C++

Hi, my name is Sarthak Singhal and I have been working on astronomy library to integrate coordinate system with Boost.Units and creating the parser for FITS files, in Google Summer of Code 2019. This gist describes all the work that I have done during this period.

https://summerofcode.withgoogle.com/projects/#5400051436748800

About the project

Earlier the coordinate system had no support for units with coordinates which could leave scientific calculations prone to errors. Boost.Units helped out in integrating units with the existing coordinate system. The functionality for FITS file handling was not complete. The parser for ASCII table extension and binary table extension was to be created.

My Tasks and Work Done

My work was mainly divided into 3 tasks:

Integrating the euclidean and astronomical coordinate system with Boost.Units

The coordinate system had no support for units along with coordinates so it was of limited use. My task was to integrate euclidean and astronomical coordinate systems with units. I used Boost.Units for this purpose. I stored the units as the template parameters and stored just the values of the coordinates in the Boost.Geometry.Point. Defining any object became complicated due to several template parameters, so I created separate make functions to create objects to provide easy APIs for user to deal with any coordinate system. All the code for euclidean and astronomical coordinate systems both were merged.

Creating the parser for ASCII table extension and binary table extension

Functionality for FITS file system was not complete as it supported only the parser for primary_hdu and the image extension. So, I created the parser for ASCII table extension which involved storing the meta data about the fields and the data unit in ASCII table extension and also extracting it efficiently.

Creating unit tests and updating the documentation

New tests need to be created as the whole coordinate system was changed. Similarly, documentation needed to be updated. I created tests for cartesian and spherical coordinate systems. I updated the documentation meeting the new requirements.

The code that was merged can be seen here

Acknowledgements

I am thankful to my mentor Ruchika Joshi for her guidance throughout the project. I would also like to thank Pranam Lashkari who helped me whenever I had questions and any doubts. Interacting with them and working on this project together made this a great learning experience for me and I gained a lot of knowledge of Template Meta Programming and other aspects of object oriented programming. It was a great experience and fun working with them.

Conclusion

I’ve had a wonderful time during these 3 months and have learned plenty of things. Google Summer of Code was an awesome learning experience for me and I gained a lot of knowledge by working on this project.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment