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

Bash scripting: convert float to integer

As bash is not able to handle floats the best way is to convert a float number (which is represented as a string, for example an output with awk) into an integer. To do this [1,2]: float=1.23 int=${float%.*} Refs: [1] Stackexchange.com/Unix & Linux [2] Linuxquestions.org

Multiple-line comment for shell scripts

How to comment a block of text without inserting the ‘#’ character to all lines? We just use a ‘<<COMMENT_STRING’ (COMMENT_STRING can be obviously whatever we want) before the line of text we want to comment out and ‘COMMENT_STRING’ after the last line. An example: <<HEADER_COMMENT This is a test comment – lol! HEADER_COMMENT [source1,source2] […]

Zip multiple directories separately

In order to zip simultaneously a number of directories, but keep them separate, the following command will just do the job (in bash): for i in *; do zip -r $i.zip $i; done (caution: all directories inside which this command is executed will be zipped, so make a separate directory only to create the zip […]

Bash commands to combine files

Suppose that you want to combine two (or more) files, containing for example a series of data. There are, actually, two ways to do it in bash: $ paste temp1 temp2 > temp which adds the contents of the two files horizontally, like columns, and $ cat temp1 temp2 > temp which adds the contents […]

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. […]

Installing Starlink

Installing and running Starlink is pretty much straightforward. Firstly, get the latest release (Namaka, when this post was written) and extract the file wherever you want. Then select which shell you want to use and follow the post-installation run-up or the info given below (supposing it was downloaded and extracted in /home/user/soft/star-namaka/). Bash case: Open […]

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 […]

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 […]

Floating point numbers in bash or csh

They just don’t pass through!! Bash or csh are unable to use floating numbers, as they understand numbers containing decimal point as strings. So, only actions with full numbers can be performed in these shells.