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
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).
Extracting spectra from AAOmega observations
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.
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
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.
Reading fits headers within Starlink (.sdf files)
Starlink has its own image format (the NDF format, .sdf extension) which is not perhaps so convenient as the fits format. Nevertheless, there are ways to read the contents of the fits headers of your .sdf files, depending on the program you are working with.
With KAPPA you can use the command:
$ fitslist file.sdf
while with FIGARO you can use the:
$ fitskeys file.sdf
.
In any case you should first invoke the appropriate application (either KAPPA of FIGARO).