Tag Archive

amateur astronomy awk bash b[e] supergiant cartoon conference convert evolved star exoplanet fedora figaro fits fun galaxy iraf large magellanic cloud latex linux lmc machine learning magellanic clouds massive star matplotlib meteor mypaper paper peblo photometry planet pro-am pyraf python red supergiant scisoft skinakas observatory small magellanic cloud smc spectroscopy starlink talk ubuntu university of crete video x-ray yellow hypergiant

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 point of Astrometry+Photometry tab. But there was an error kept coming up about a syntax error in the scampcat.py:

except IOError as (strerror):
  print "I/O error: {0}".format(strerror)
  result = False

While looking around why is this an error I found out that the syntax “except … as …” was a valid syntax from Python 2.6 and higher. So the first attempt was to correct for the syntax. By removing “as”:

except IOError, err:
  print "I/O error: {0}",format(err.errno, err.strerrorerr)
  result = False

the script was able to continue, although now the problem was that it couldn’t import the “multiprocessing” module! Indeed the multiprocessing module becomes standard after Python 2.6 and it was not included in Python 2.5 version of Scisoft.

So, what now? Let’s go on and install the module inside Scisoft’s Python (2.5). Probably by downloading the module and running the setup.py or by easy_install or pypi this could work easily, right? Somehow, none of them worked in an easy and clean way (either something missing or not working). Moreover, as I was looking around filesystem’s Python (2.6) I noticed that the multiprocessing module was not installed under the site-packages but under Python directory itself. This puzzled me a little bit more so I went on to see if there is any other approach.

The one I though was to check for the new version of Scisoft (7.7), which included Python 2.7. This version provided that the syntax will work and the module will be there. So I went on to upgrade to the new release and after the successful installation THELI did not complain about these problems any more!

But there was a something that it just came to my mind after finishing the THELI test run. Why hadn’t I change the $PATH (of bash) to include filesystem’s Python 2.6 (under /usr/bin/)? This would, probably, accept the syntax and included the multiprocessing module already! Then I would have avoided the whole fuzz about removing and installing programs and dependencies.

So, it’s better to think a little bit more and try different approaches (ask someone?)! At least the new installation is not in vain as there are some good upgrades (like Matplotlib 1.1) which will be helpful in the future.

Updating Scisoft from 7.5 to 7.7 in Fedora 14

Updating Scisoft in Fedora is rather easy (see the installation details). First if we have already a previous installation we can easily remove it by running (as root):

yum remove scisoft-\*

and check that the directory /scisoft has been totally removed (if something extra has been added the we should still see the scisoft directory with all the extras inside).
Then, we follow the same steps as the first time (for example see this installation notes). Since we are updating then the repository file should already exist. We don’t have anything more to do than just to edit the file /etc/yum.repos.d/scisoft.repo and edit the line containing the baseurl:


Actually we just replace …7.5/… with …7.7/… . Then we install the scisoft normally:

yum clean all
yum install scisoft-\*

and everything should be just fine!

NOTE: during this installation only the scisoft-idllib-7.7.0-0.i386 was not installed due to the lack of scisoft-idl. And that’s … because it is not included (along with SuperMongo) as they are paid versions.
The installation can be skipped by using — skip-broken (after all, no need for IDL since we get Python 2.7.2 and Matplotlib 1.1.0!!!).

matplotlib within Scisoft and file system – Fedora case

While I was working on a script to make multiple plots with matplotlib I found out that it was not possible with the version that Scisoft 7.5 uses (0.99) but a later version can do it (1.0.1)! So a logical though was to go on and upgrade the matplotlib inside scisoft but was not really obvious or successful. Also, I was not able to find a way to combine python modules inside scisoft with modules outside it (ie at the file system under /usr/lib/python2.x/ in Fedora). Although i did ask in mailing lists about this I have not get any answer yet, so I went on to install the latest version of matplotlib, numpy, scipy through the usual repositories under the file system. Then if I want my script to take advantage of the matplotlib 1.0.1 I insert


at the first line of the scripts while

#!/usr/bin/env python

if I want to work with the modules inside scisoft (like pyraf).

Perhaps I have a better solution to post in the future…

Common commands of Scisoft and Starlink

Scisoft includes a number of Starlink programs but not all. So perhaps someone (in this case me!) needs to run something that it is not included in the Scisoft (like DIPSO). So, nothing wrong to go on and install both. But in this case that someone has to be careful not to mix the commands.

As the Starlink programs are not available from the beginning within the setup script of Scisoft, some initial work has to be done [how to do it?]. If an alias is selected then its names for the environment and the program has to be different than what Starlink uses. In the example of setting up FIGARO through Scisoft we used “FIG_DIR” and “figaro” as the alias in the .bashrc, which conflicts with “figaro” of Starlink. The best way is to name them differently (like “SCIFIG_DIR” and “scifigaro”). By that we have available both programs, either the Starlink version by typing “figaro” or the Scisoft version by typing “scifigaro” (may be different versions depending on the Scisoft/Starlink releases).

Figaro within Scisoft

Scisoft (7.5) includes also a number of shared programs available to use. But they are not immediately available when invoking Scisoft, like FIGARO, one of the programs provided with STARLINK. There are two ways to start FIGARO (both provided by Giannis K. at Computer Center support of Physics/Univ of Crete) :

One is to use an alias in .bashrc (edit the file and add):

export FIG_DIR=/scisoft/share/star/bin/figaro
alias figaro='source $FIG_DIR/figaro.sh'

and another by adding the paths inside the Scisoft’s setup file (edit the file /scisoft/bin/Setup.bash as root). Change the following lines as shown:

#  Add the main Scisoft binaries to the command search path
if [ "X$PATH" != X ]; then
export PATH=/scisoft/bin:/scisoft/share/star/bin/figaro:$PATH
export PATH=/scisoft/bin:/scisoft/share/star/bin/figaro
#  Add the main Scisoft libraries to the library search path
if [ "X$LD_LIBRARY_PATH" != X ]; then
export LD_LIBRARY_PATH=/scisoft/lib:/scisoft/share/star/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=/scisoft/lib:/scisoft/share/star/lib

where the path to the FIGARO programs is added (using the “:”). Even without the libraries path (/scisoft/share/star/lib) FIGARO will start, but it seems better to include them as … you never know when a library is needed. To start FIGARO just type “figaro.sh” (.sh since we are using bash), after starting Scisoft (by using “. /scisoft/bin/Setup.bash” or any alias made already in .bashrc).

The difference in these two ways is that in the first case typing “figaro” will initiate the FIGARO program (and it will print the initialization message) while in the second case the initialization of Scisoft initializes FIGARO commands also (it will not print any messages but the commands are available).

The same can apply (most probably!) to any other program of STARLINK.

Scisoft 7.5 in Fedora 14 using bash

Scisoft is a great collection of astronomical software (IRAF 2.14-1, IDL 7.1, Python 2.5.4, PyRAF 1.9.0, and more) mainly used at the ESO. Installing the whole package is very easy through yum in Fedora, which is officially supported. Following the instructions you can have Scisoft ready in a few minutes and then what is left is to run the software.

For bash users type (“dot space” at the beginning):

. /scisoft/bin/Setup.bash

and csh/tcsh users:

source /scisoft/bin/Setup.csh

Most probably though the Scisoft will not start at all, as a check message about the SELinux is printed. Fedora comes with SELinux enabled by default which may create problems with some applications (like inmidas and PyRAF). The best solution is to disable this feature and to do so you have to edit the /etc/selinux/config (as root). What you will see is this text:

# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
# SELINUXTYPE= can take one of these two values:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.

where you change SELINUX= value from enforcing to disabled. Then if you run again the Scisoft will normally start and you can select you application by typing the appropriate keyword (like cl for IRAF, pyraf for PyRAF, etc).

There is still a warning message appearing about nm:
bash: nm: command not found...
Though it seems not to affect, it is better to go on and install the ‘binutils’ package (binutils collection of binary tools) and be sure that everything will be totally safe (go on and install it with yum install).

In order to avoid typing all the time this long command to start Scisoft an alias can be created easily at the .bashrc file, by adding this line:

alias scisoft='. /scisoft/bin/Setup.bash'

Then, just typing ‘scisoft’ is enough to invoke the programs.