By T. Do
The plot above shows the number of hours between sunrise and sunset at three different locations for observatories around the world. Mauna Kea, Hawaii is home to a number of telescopes including the Keck Telescopes, Gemini, and Subaru. Kitt Peak is a mountain outside of Tuscon and includes the Mayall Telescope and WIYN telescope. Cerro Paranal is a mountain in Chile with the four VLTs. The variation in night time depends on the latitude of the location on Earth. Because Mauna Kea in Hawaii is closer to the equator, there is less variation in the number of night time hours.
To create this plot, I used the python package Astral and datetime. Below I will discuss in more detail how to use these packages.
Continue reading “Hours between sunrise and sunset at different observatories with python”
One of the features of the legends from matplotlib that can be distracting is the black borders around every legend. To remove them, or to change other properties of the frame, you can use the
get_frame() function and adjust the properties of the legend. For example:
leg = legend()
leg.get_frame().set_alpha(0) # this will make the box totally transparent
leg.get_frame().set_edgecolor('white') # this will make the edges of the border white to match the background instead
More info about changes to legends can be found here: http://matplotlib.sourceforge.net/users/recipes.html
Using ipython in emacs is very useful because of the advantages in debugging and having everything in one environment. To do so, just download http://ipython.scipy.org/dist/ipython.el
To use, add the following lines in your .emacs file:
(add-to-list 'interpreter-mode-alist '("python" . python-mode))
(setq load-path (cons "~/directory with ipython.el/" load-path))
(setq ipython-command "path to/ipython")
To start the ipython shell, use C-c ! from a .py file or from the menu bar. Shortcut to run the .py file C-c C-c or C-c RET.
By default, to scroll up and down the history for ipython is ctrl+up or ctrl+down, but can be changed to just up and down using:
(define-key comint-mode-map [(up)]
(define-key comint-mode-map [(down)]
More instructions can be found here and here.