Friday, June 19, 2015

Are we coding now?

¡Hola!

As sad as I am that México did not make it out of the group stages in the 2015 FIFA Women's World Cup, I managed to pull myself out of my depression long enough to get some work done on my Google Summer of Code project. 

...And what do you know, I even got a pull request merged into Astroplan's master code. :) 

Insert boastful Drake lyrics here.

My baby code goes to kindergarten 

I worked on PR #5 to Astroplan (containing my contribution to the core code of the project, as well as documentation outlined in my last big post) for what I'm sure was too much of last week. 

I was getting very cryptic error messages when I tried to build the documentation.  I eventually figured out that this had to do with the fact that the old documentation files were not being deleted.  This meant that whenever I changed the name of a class or removed it all together, the Sphinx environment was still looking for the old one. 

One of my mentors, Erik, gave me two possible solutions:
  1. Force git to delete all untracked files (Sphinx docs are rebuilt from the repo, so by default, Astroplan's .git_ignore file includes any generated documentation files)
    •  git clean -dfx
  2. Tell Sphinx to delete all old files from any previous document builds
    • python setup.py build_sphinx -l

 I think I tried the first one, but I can't remember.  

At any rate, the docs built, and the skeleton code I wrote is currently being adopted by my fellow Astroplan GSoCer, Brett, into the actual code base for our project.  Exciting!

Matplotlib & Me

The next big part of the project that I'm (still) working on is implementing the plotting aspect of Astroplan.  

At minimum, we want the three following types of plots:
  1. Airmass vs. Time
  2. Parallactic angle vs. Time
  3. Sky chart 
I now have rudimentary versions of all three types of plots, which look fine--other than the fact that it's hard to feed Matplotlib a series of times formatted like 1200 & 0300 instead of 12:00pm & 3:00pm and expect it to plot data for 3pm *after* the data from noon, so my time-based plots don't look quite right.  


However, I did manage a damn fine sample sky chart if I do say so myself.

One thing I have found out about matplotlib (the Python plotting library) is that, for some reason, you MUST plot points BEFORE you set the ticks and tick labels.  

Also, you will have an excruciatingly "fun" time creating a plot in any projection other than Cartesian (one horizontal and one vertical axis, for all you non-math nerds religiously reading this blog) when 99% of the matplotlib plotting examples and tutorials assume you have x- and y-axes.


Almost as much as this guy.


No comments:

Post a Comment