Google Summer of Code: Kalzium 3D Molecular Editor - Accepted!

I just found out that my Google Summer of Code (TM) application to work on the Kalzium 3D molecular editor has been accepted! The status just changed to accepted. So over the summer I am going to be working on perfecting the 3D molecular editor in Kalzium. I am so amazingly pleased that my project was accepted and it certainly promises to be an amazing summer where I get to work on a project combining my passions for KDE, Qt, C++ and molecular visualisation!

Time to get some sleep as it has gone 4am in the UK! Thanks to Google and everyone at KDE and I am sure there will be lots more to come over the summer.

ePiX Updates - Easier File Reading

In the past few weeks I have been doing lots of data analysis and graph plotting. I use some graphical tools such as Grace, Veusz and QtiPlot but when doing lots of plots for a big document I wanted something a little more scriptable.

ePiX seemed to fit this bill and when I contacted the author about a few problems I had getting it to work he was very responsive. He is a mathematician whereas I am a physicist and have to handle lots of data in general. So I found the data file reading quite fragile. It does however have some great advantages such as being able to write LaTeX equations right into the graphs and figures.

Absorption profile plotted by ePiX

The image shown above shows a plot of the absorption profile of a gold nanoparticle suspension. In the recent ePiX 1.0.24 release I added a tokeniser to the file reading functions of the data_file class in order to make data file reading more robust and I was able to read all my data files in using a simple loop and plot them as shown.

I have also just finished a data pruning function for the same class, but I am not sure if there is a better way to implement it. It uses brute force right now to iterate through the data and erase unwanted points. It does work well but I am not sure if there is a better way to accomplish its goal using some of the STL algorithms. It does need to delete the whole row though.

  void data_file::prune(double min, double max, unsigned int col)
  {
    // Erase rows where the data is outside of the specified range
    std::vector::iterator> iter(m_data.size());
    for (unsigned int i = 0; i < m_data.size(); i++)
      iter.at(i) = m_data.at(i).begin();

    while (iter.at(0) != m_data.at(0).end())
    {
      if ( *iter.at(col-1) < min || *iter.at(col-1) > max )
      {
        for (unsigned int j = 0; j < m_data.size(); j++)
          m_data.at(j).erase(iter.at(j));
      }
      else
      {
        for (unsigned int j = 0; j < m_data.size(); j++)
          iter.at(j)++;
      }
    }
  }

This pretty much covers the extra bits I needed for data analysis. A nice legend function would be good as drawing legends isn't as automated as I might like. I would welcome any feedback on the prune function as I think this would make a good addition to ePiX.

Beautiful Day For a Walk

Today was a beautiful day (as have been the last few) so I took a break from writing my thesis to get out for a while. We went out by Ladybower reservoir for a walk with Dax. It was great to get out of the office for a few hours after having quite an intense week of work. Lots more to do but it has been a productive week.

Marcus, Louise and Dax at Ladybower reservoir

As you can see in the photo the weather really was great although it was really crowded out there too. Dax enjoyed himself and I got some nice pictures too. We came back and had a barbecue. It is really nice now the weather has improved and it isn't getting dark so early.

In other everyday news I got my new office chair too. It was a bit rubbish so I transplanted the arms to my old chair and all is well ;-) Even got a foot stool out of it as it seemed a shame to waste the rest of the bits. I am hoping to spend a little less time in the office once I get my thesis finished though...

My Office Chair Is No More

It would seem I have been working so hard on my thesis that my chair has given up the ghost and broke. I was pondering over some graphs in I was plotting for my thesis, lent back slightly and the plastic arm broke :-( I am going to have to go out tomorrow and find a replacement as I am getting back ache and don't need any excuses not to work on my thesis ;-)

They just don't make things to last any more... In related news Nick convinced me to join Facebook. Despite writing my random ramblings for the world on my blog, and putting up random pictures in my gallery I have never really bothered taking part in any social networking sites. I will see how it goes but don't intend to let it distract me from my primary goal right now - finishing my thesis!