KDE

KStars – A new look!

With more than a month remaining, my Google Summer of Code project has almost come to an end! KStars is now able to display all 88 western constellations. I want to thank my mentor, Jasem, for helping me by making a dialog box that would display constellation images with parameters in real time. This made my job simpler by a very large margin. Instead of using mathematical equations to figure out the ‘best fit’ for an image, I have simplified the task by simply noting down the RA/DEC coordinate pairs for ‘midpoints’ of constellations from Stellarium. This helped me figure out ‘where’ to translate the image in the sky map. Then I played around with the position angle, width and height for each image so as to ‘best fit’ the constellation lines. I had to do this repetitively for 88 consecutive times, but this was still a much simpler solution. Lastly I replaced all the 88 images with transparent backgrounds, so as to avoid cutting neighbouring images by the black background which was previously present. KStars looks good now, and I feel happy seeing the results! Here’s the new look of KStars!

 

kstars

 

Next up is to do this again for one non-western sky culture, and learn Doxygen to start writing documentation for the code that I have written! I aim to finish everything up within 10 days time now! A lot of help from my mentor, the KStars community, and an amazing project has made Google summer of code a great experience for me!

GSoC Midterm Update

So Google Summer of Code midterms are here. I want to thank my mentor, Jasem, for helping me out. I am now able to successfully display one constellation image, that is the Andromeda constellation. Currently, the image is displayed, but a lot of work needs to be done on positioning the image, and rotating the image on the sky map. Here is a brief summary of the changes I made.

I implemented an abstract function in SkyPainter called virtual bool drawConstellationArtImage(ConstellationsArt *obj, bool drawConstellationImage) and then implemented it as an empty function in SkyGLPainter. The function is implemented in SkyQPainter. Now, in skymapcomposite.cpp, the class ConstellationArtComponent is added via the addComponent() method. And the draw function is called like m_ConstellationArt->draw(skyp). This draw function then calls the drawConstellationArtImage() function I described above. Lastly I have edited data/CMakeLists.txt to include skycultures.sqlite, and all the constellation images. Presently the file skycultures.sqlite includes only one record, that is for the Andromeda constellation. Here is a screen shot of the same.
KStars
Here’s the plan for the next few days. Get the button to toggle constellation art off/on working, and position/rotate/scale the image appropriately for Andromeda. Once that is done, make all constellations appear in the sky. Here there would be 85 of them, instead of 88, because I have the image file for Argonavis, which was later on divided into Carina, Puppis and Vela. More to come soon!

GSoC Progress Report : Week 2 and 3

I haven’t updated my blog in a while. A quick summary of what I have done till now follows. I have created another class called ConstArtComponent. This will be a child of SkyComponent. This class will manage all different sky cultures, by maintaining a QList<ConstellationsArt> for different sky cultures. I will have to write a drawConstArt() function in skypainter.h and then maybe call it from ConstArtComponent. I am working on this function. I am studying how deep sky objects are drawn in KStars, and drawing some parallels between deep sky objects and constellations. Lastly, here is a screenshot of KStars reading my constellationsart.txt file successfully. Please note that this is an old screenshot, and that a lot of code has been changed after it was taken. But nonetheless, the KSFileReader method to read files in KStars remains the same. More to follow in the next post, and I hope to get the skeleton of the project ready by the midterm exams!

KStars file reading

Google Summer of Code 2015 – Week One : The Joy Of The First Paycheck!

This is the first week of Google Summer of Code. The coding period began officially on the 25th of May. And I received my first paycheck of $500 from Google! I am already learning new things everyday, which makes this project very exciting!

What I have done till now is collect constellation artwork used in Stellarium, and complied a list of 3 stars for each constellation which would be used to position the constellation image in the sky map. I started coding and have written the ConstellationArt class declaration. Earlier I had included a Q_PROPERTY to make constellations fade in and out, but I was told that this would be difficult to achieve since KStars doesn’t use OpenGL. In any case, I think getting the constellations to display correctly in the sky is more important than making them fade. That could always be done at a later point of time.

Stellarium uses the Hipparcos catalog numbers, while KStars uses the Henry Draper Index. So I converted Hipparcos numbers to Henry Draper numbers using a cross-index file. I referred to SIMBAD for a few individual cases of double stars. I randomly chose the Henry Draper number of one of the children in the double star. This would technically cause the constellation image to be ‘slightly’ misaligned, but constellations are a figment of imagination, and hence the misalignment would be pardonable.

New stuff I learnt this week: I read about different star catalogs including the Hipparcos catalog, Henry Draper catalog, Smithsonian Astrophysical Observatory Star Catalog (SAO numbers). I also ended up reading on Flamsteed designations, and Bayer designations of a star.

What’s next? I need to understand how the draw() function works in KStars, and how it would be used to draw a constellation image. I have written some code till now that opens up the ‘constellationart.txt’ file and read the values for each of the 3 important stars in a constellation. The values include x1,y1,hd1,x2,y2,hd2,x3,y3,hd3, constellation abbreviation and image file name. These values will now be populated into an array of 88 elements, each of which would be a structure.

I will describe more on how I plan to solve the problem in future posts.

A neat UNIX trick for your bash profile

Hi folks! I have been spending a lot of time with KStars lately. I will write a detailed account on the work done till now, but here’s something I found interesting. This, I think is a handy ‘precautionary’ trick that every newbie should implement to avoid pushing to the wrong git repo/branch.

Here’s what you do. Open up the konsole and type cd ~ (This should take you to your home directory. Now what we need to do is add one line to your .bashrc file.

$nano .bashrc

Opens up your .bashrc file in the nano editor (you could choose vim, or emacs too).

Add this line export PS1=’\W$(__git_ps1 “(%s)”)> to the part of the ‘if block’ that pertains to bash completion. In my case this is how my .bashrc looks.

  if [ -f /usr/share/bash-completion/bash_completion ]; then
    . /usr/share/bash-completion/bash_completion
        export PS1=’\W$(__git_ps1 “(%s)”)> ‘
  elif [ -f /etc/bash_completion ]; then
    . /etc/bash_completion
  fi

What this does is that it changes the text on your konsole. Whenever you enter a git repository, the text on your console reads the repo name with the git branch you are on currently (hence the %s to the __git_ps1 variable). This is how my kstars repository now looks.

~> cd Projects/kstars/
kstars(gsoc2015-constellationart)> git branch
* gsoc2015-constellationart
  master
kstars(gsoc2015-constellationart)> git checkout master
Switched to branch ‘master’
Your branch is up-to-date with ‘origin/master’.
kstars(master)>

Now you can always know what branch you are on, without typing git branch. Pretty neat! 😎

Adding my blog to Planet KDE

Hi folks! So this blog post is kinda a test post. I just git pushed the RSS feed from my blog to Planet KDE, KDE’s blog aggregator. Although I can see it in the git log here, I just want to make sure that my posts appear in real time on Planet KDE. If this doesn’t work, I would have to file a bug on Bugzilla, to get my blog added to Planet KDE.

Google Summer of Code 2015 – Week Zero: My Project Proposal

So I am almost done with my college exams. They were getting in the way, and I am now relieved that I can start devoting all my time to my project with KDE. In this post I intend to briefly describe what my project is all about.

I am going to be adding ‘Constellation Art’ unto the sky map in KStars. This project is precisely what I have been looking for, a perfect blend of astronomy and coding – the best of both worlds!

KStars is free, open source, cross-platform Astronomy Software. It provides an accurate graphical simulation of the night sky, from any location on Earth, at any date and time. The display includes up to 100 million stars, 13,000 deep-sky objects,all 8 planets, the Sun and Moon, and thousands of comets, asteroids, supernovae, and satellites. For students and teachers, it supports adjustable simulation speeds in order to view phenomena that happen over long timescales, the KStars Astrocalculator to predict conjunctions, and many common astronomical calculations.

For the amateur astronomer, it provides an observation planner, a sky calendar tool, an FOV editor to calculate field of view of equipment and display them, the “What’s up Tonight” tool, altitude vs. time graphs for any object, high-quality sky charts for printing, and access to lots of information and resources to help you explore the universe! Included with KStars is Ekos astrophotography suite, a complete astrophotography solution that can control all INDI devices including numerous telescopes, CCDs, DSLRs, focusers, filters, and a lot more.

So what is my project all about?

Presently, this is how the sky map in KStars looks from New Delhi, India. (My current location is Pilani, and Pilani is not one of the ‘preset’ locations available in KStars for obvious reasons! Pilani is in the middle of nowhere!)

kstars new delhiAnd this is how it would look like (some what) after I complete my project in the next 3 months. The image below is what Stellarium looks like currently.

stellariumAbstract of the project:

The basic idea is to implement a class ConstellationArt, which will take care of all the sky cultures. Various instances of this class would represent different sky cultures. This class will take all the data stored in SQLite DB files named as name_constellationart.db (for example western_constellationart.db or indian_constellationart.db), which will contain different fields for each constellation. Every constellation image would have 3 important stars whose coordinates will be marked off and used by ConstellationArt. Hence if for some reason, certain constellation images are not available, and that they need to be drawn from scratch, then it will help if the three significant stars are used as a ‘grid’ to do the drawing on so that the artwork is oriented correctly. The class ConstellationArt would have various properties to control how sky cultures appear on the sky map. For instance the sky cultures will fade in and fade out, which will be controlled by a Q_PROPERTY artFadeTime and artIntensity as defined in the class declaration below. There would also be seasonal rules for visibility of constellations. Later on, new constellation artwork would be made available for download using the KNewStuff framework.

The technical details of the project maybe reserved for a future post.

Next up: I will add my blog to Planet KDE, the KDE blog aggregator!

Google Summer of Code 2015 is on!

Flip bits, not burgers!

So my proposal was selected for Google Summer of Code 2015 under the organisation KDE!

What is Google Summer of Code?

Google Summer of Code is a global program that offers students stipends to write code for open source projects. Basically Google shortlists a number of organisations with open source coding projects , and then invites students to apply for the same. It then matches the best students with the projects they applied for, and pays them to code during the summers.

GSoC

And what is KDE?

kde-logoKDE is an international technology team that creates Free Software for desktop and portable computing. Among KDE’s products are a modern desktop system for Linux and UNIX platforms, comprehensive office productivity and groupware suites and hundreds of software titles in many categories including Internet and Web applications, multimedia, entertainment, educational, graphics and software development.