Archive for April, 2011

Extracting spectra from AAOmega observations

Posted April 8, 2011 By grigoris

AAOmega (at Anglo-Australian Observatory) observations can be reduced with 2dfdrv4 tool pretty much very easilly. But the reduction ‘s final output is a combined fits image which includes all spectra from the 400 fibers. So, the user has to extra by himself/herself the spectra individually and this has been frustrating (at least for me…).

1. One solution to this (thanks to Rob S. from Anglo-Australian Telescope) is to use IRAF ‘s command imcopy as :

> imcopy  input.fits[0][*,#]  output.fits

This command copies the zeroth table of the fits file ([0] which includes the data array) to a new file. The “*” copies all content and the “#” is the number of fiber to be extracted. But in order to keep the errors we have to extract the [1] table also (which includes the variance) and append this array to the new file. This is done by using again the same command :

> imcopy  input.fits[1][*,#]  output.fits[1,append]

which adds all the content of the [1] array of the input image to the [1] array of the output image. So, if we want to extract the 13th fiber we will write:

> imcopy  combined.fits[0][*,13]  fiber13.fits
> imcopy  combined.fits[1][*,13]  fiber13.fits[1,append]

2. An alternative, is to use the command extract from the FIGARO package of Starlink :

> extract input ystart yend output

where ystart / yend is the starting and ending y pixel of the image. In the final combined image the y dimension is 400 pixels equal to the number of fibers. So, each pixel corresponds actually to a fiber and to get a specific spectrum only the number of fiber is needed to be given as ystart and yend and the extraction of the 13th fiber will be (no extensions needed) :

> extract combined 13 13 fiber13

This command keeps the error propagation.

Finally, there are small (but not really serious) diferences between the two solutions and the user selects which one fits more his/her needs: IRAF’s command is ready to use the fits file from the beginning but errors have to be added manually in contrast to the FIGARO’s command where the errors are kept automatically but the initial image has to be in sdf format.

A new installation of Fedora 14 was performed some days ago allowing to fresh up my heavy duty machine at work. Of course this does not come without any troubles but, thankfully, all have been solved quicker than expected.

The first and more serious problem was to install the necessary drivers for the graphics (an nVidia GeForce 9400 GT). By following thoroughly all the steps given in this howto-configure-kmode-nvidia link the problem was solved successfully without any further delays (thank to Paolo B. to point me that link!). A quick check if everything is working ok is to test (type in terminal) ‘glxgears’. If  the rotating gears are there and the output is more than 2000fps then the graphics run correctly (thanks to Thodoris B. for this tip!).

Next step, to organize a little bit the desktop … Yum-install the gconf-editor and then I (personally dislike these icons) removed the computer, trash and home icons from Desktop. From gconf-editor select apps>nautilus>desktop and untick the boxes named *_icon_visible.

Next step was to activate the compiz 3d graphics and add Cairo-Dock, along with some plug-ins which provide all the (cool) stuff that somebody (or at least me) needs. With that I found the panels useless so I removed them completely through gconf-editor again, by selecting desktop>gnome>session>required_components and removing the value “gnome-panel” from panel (it can be restored by putting this value again back).

Now I am enjoying my new fresh and cool machine !

Figaro within Scisoft

Posted April 7, 2011 By grigoris

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
else
export PATH=/scisoft/bin:/scisoft/share/star/bin/figaro
fi
#
#  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
else
export LD_LIBRARY_PATH=/scisoft/lib:/scisoft/share/star/lib
fi

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

Posted April 7, 2011 By grigoris

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.
SELINUX=enforcing
# SELINUXTYPE= can take one of these two values:
# targeted - Only targeted network daemons are protected.
# strict - Full SELinux protection.
SELINUXTYPE=targeted

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.