Tag Archive

aaomega anglo-australian telescope awk bash b[e] supergiant c-shell conference convert csh exoplanet fedora figaro fits fun galaxy header history iraf jupiter kepler latex linux magellanic clouds massive star matplotlib meteor moon mypaper numpy ondrejov observatory paper peblo photometry planet pyraf python scisoft skinakas observatory spectroscopy starlink talk theli ubuntu video wavelength

Workshop on Python and IRAF/PyRAF

Between 12 to 19 of September 2016, we organized the Ondřejov Summer School 2016, which was held at the Stellar Stellar Department of the Astronomical Institute (Czech Academy of Sciences), in Ondřejov. The main aim of the school was to provide students hands-on experience with real observational data, i.e. to understand observations, reduce them, and […]

Ureka – one package to install them all!

Among the simplest installation methods to install IRAF are SciSoft (for RedHat/Fedora based distributions) and Fernando Avila Castro iso files (for Ubuntu/Debian based distributions). However, both require root privileges. What can you do when you do not have these permissions? Ureka [1] comes in rescue! It is easy to install (download and run the installer![2]) […]

Complex dictionaries in python

How to make a dictionary of dictionaries with lists inside? For example we have a number of stellar spectral types (spec) and for each one of them we have a series of spectral lines (line) and their equivalent widths (ew). By creating a rather complex dictionary we can then call the list of values for […]

Reading columns from a text file – fast and easy!

Although the are many information on how to use the genfromtxt (from numpy) there is not a clear demonstration (that I found…) to show how to easily read a text file with columns of data (including strings – it is straightforward to read columns of numbers with loadtxt for example). Suppose that we have the […]

Installing matplotlib through pip but no plot displayed

The easiest way to install any Python package is through PyPI. So, matplotlib is not an exception and we installed it on a CentOS (v6.4) machine without any errors (of course after updating numpy). But when we tried to plot something we couldn’t see anything. This is actually a backend issue, and when we installed […]

THELI and Python – when you don’t think enough…

THELI is package for the automated reduction of astronomical imaging data. One of the prerequisite is Python 2.5 or higher (as THELI uses numerous shell and Python scripts). As I had already installed Scisoft 7.5 (with Python 2.5) I though that everything was ok. I started using THELI and indeed no problem up to the […]

matplotlib: missed errorbars in logarithmic plot

While manipulating some data I came across to, what looked, a strange behavior with the errorbar of matplotlib, when plotting the results from linear to logarithmic scale. Suppose these data: import matplotlib.pyplot as plt import numpy as np s=[19.0, 20.0, 21.0, 22.0, 24.0] v=[36.5, 66.814250000000001, 130.17750000000001, 498.57466666666664, 19.41] verr=[0.28999999999999998, 80.075044597909169, 71.322124839818571, 650.11015891565125, 0.02] plt.errorbar(s,v,yerr=verr) plt.show() […]

Adding environmental variable in Python script

Perhaps looking for this (after importing os): os.environ[“VARIABLE”]=”/path/to/program” This is needed for example to set the jref path in order for multidrizzle package to run through a script.

Note on how to make multiple plots with pylab

iPython is a great tool to work with Python interactively, imitating a MatLab environment especially when running with matplotlib and numpy [the pylab module, all can be automatically imported by starting pylab like: ipython –pylab]. So you can use it to load data and start playing around with them. Although I like to script more […]

About licensing

Stumbled upon the various different licenses I though to write down some conclusions (if I really got into any…). A nice comparison table of free software licenses is given in the Wikipedia where it is easily to see which licenses allow: (i) the link with other licenses and (ii) releasing under different license. So, in […]