Export IRAF files to FITS files

wfits doesn’t preserve the name of the file to be converted, so a better approach is:

imcopy *.imh *.%imh%fits

Convert LaTeX equations to SVG

sudo apt-get install pdf2svg
Edit line 5 of the python script latex2svg.py (see below)
chmod 744 latex2svg.py
./latex2svg.py

The resulting equation is in the file eqn.svg

Please note that the software mentioned in this page is not (yet) publicly available, so these notes are mainly for reference of the author’s group.

Preview images

The NDF format (or the FITS format for that matter) seems cumbersome to preview to people used to just open a file browser and examine their images (JPEG, GIF, etc.) by double clicking with the mouse and pressing the arrows in the keyboard. I have two scripts that solve this by creating JPEG thumbnails with annotations (e.g. the filename) and also an animation of the lot. One of the scripts has the ability to optionally read a lightcurve (file with 2 or more columns of data, assumed to be time, flux and extra things) and plot it below.

This is useful to discard bad images prior to running other photometry analysis depending on the good behaviour of the set.

Install with starperl the following modules:

  • PDL
  • PGPLOT

Run the scripts using starperl. For the animations to work you’ll need a fairly recent version of ffmpeg (up to ubuntu 12.04 the custom version shipped with the OS is not useful for this).

Starlink takes too much time to give back the prompt after some (fully performed) operations

setenv AUTOPROV 0

Supported way to convert FITS to NDF

CONVERT fits2ndf, as in this example:

fits2ndf IN=*.fit OUT=*

Crop unneeded portions of an NDF

/star/bin/kappa/ndfcopy “image001(10:500,20:100)” image001sub

In this example we are processing the file image001, removing everything before 10 and after 500 in the abscissa, and everything before 20 and after 100 in the ordinate, and storing it in the file image001sub. Keep in mind that the coordinates of the new file may still have some memory of the coordinates of the old file because Starlink stores different WCS in its headers. For some routines I have checked that I need to use the pixel values stores in the alpha and delta coordinates instead of the x and y coordinates.

LR

creframe lbound=1 ubound=1000 mode=gs ngauss=10 max=30000 min=0 background=0 seeing=40 out=tmp
display tmp
cursor outcat=listcenters
psf in=tmp out=psf incat=listcenters.FIT gauss=true device=xwindows
lucy in=imagedefocus out=imagecorrected AIM=5