Archive for June, 2014

Retrieve header key with gethead

Posted June 19, 2014 By grigoris

A quick note on gethead of WCSTools – as I have needed many times (but obviously not that many to remember it!).

Rather straightforward use: gethead HEADER_KEY image.fits
(as simple as possibly!)
If HEADER_KEY contains empty spaces then use double quotes, e.g. “HIERARCH TEL AIRM END”.

Reminder: you have to have installed already the WCSTools! (See the “Installing WCSTools” for this.)

[Ref: WCSTools – gethead: ]

Spectrophotometry with IRAF’s sbands

Posted June 16, 2014 By grigoris

After a long time I finally managed to understand how to use IRAF’s sbands, along with a standard star and a filter.

1. If you want to use a spectrum from the standard star library of IRAF, you have to convert it from a .dat file to an image file .fits – Spectra files located in …/iraf/iraf/noao/lib/onedstds/ – by using the rspectext.
2. Having created an image file* (of the 1D spectrum), sbands uses this image and a bandpass file to provide the results (fluxes, or magnitudes). The contents of the bandpass file is the bands for which we want to measure flux/mag: name of the band, central wavelength, width, filter transmission file (if available).

*[2014/06/25 update]
Caution: the spectrophotometric files contain 2 columns, the wavelength and the magnitude, which means that they are reversed when plotted – so they have to be transformed into fluxes (in wavelength units) to be used properly.

[originated from: spectrophotometry with sbands or something else at ]

Struggling with BibTeX ???

Posted June 3, 2014 By grigoris

Ok, it is time to try this promising thing called BibTeX [1,2,3], which allows you to use only one file with references* (suppose MyBibTeX.bib). Then, it easy to add references in any document just by simple adding the file and the citations. Although it seems rather straightforward hot to make the file its implementation is not.

So, first step is to add the file (or files separated with commas!) in you .tex document:
[or even multiple files and in various locations, e.g. \bibliography{/path/to/bib,bib2,MyBibTeX} – by the way I did not notice any difference if extension .bib is kept or omitted!]

The second step is to add the style which will be used to represent the references. This is done by adding:
\usepackage{natbib} – at the preamble of the document and
\bibliographystyle{plainnat} – after/before \bibliography{}
to have the normal author-year style representation [3].

Now, to get proper representation of the references we have to compile the .bib file. This may seem a little complex (but you get used to this easily!):

  • pdflatex afile.tex
  • bibtex MyBibTeX.aux
  • pdflatex afile.tex
  • pdflatex afile.tex

[pdflatex or latex – depending on what you are using; see [3] for details]

In case on the error: “Bibliography not compatible with author-year citations
check that all your BibTeX entries include a year [4].
It is also important when making changes to the \bibliographystyle to remove the .aux and .bbl files completely [4].

[1] (retrieved 3/6/2014)
[2] Wikipedia: (retrieved 3/6/2014)
[3] WikiBooks/LaTeX: (retrieved 3/6/2014)
[4] (retrieved 3/6/2014)

*EXAMPLE of references inside a MyBibTeX.bib:

    author    = "M. Up and G. Down",
    title     = "Handbook of Testing TeX",
    publisher = "OpenBooks",
    year      =  2222,
    address   = "Caprica",
    edition   = "567th"