Jump to: navigation, search

A well-known feature of IRAF is the tvmark task, intended to mark objects on images displayed by, most frequently, DS9. With the aid of the XPA libraries, we can implement this feature using simple shell scripting. The full working script can be download from here: tvmark.sh.


The option -h or --help prints some information about the usage of this script as a command line driven program:

Usage:  ./tvmark.sh [-h|--help] [-v|--version]
        [-x|--col-xy <column_index_x>,<column_index_y>] 
        [-e|--circle [-r|--radius <r>]]
        [-q|--square [-s|--size <s>]]
        [-c|--color <c>]
        [-l|--col-label <column_index_label>
        [-f|--label '<label_format>']
        [-a|--label-color <c>]
 - in the label string, $<N> is replaced by the content of the <N>th column
   (like in AWK)
 - default format: --col-xy 1,2 --circle --color green --radius 4

This script can read its formatted input either from standard input or any simple text file. By default, the X and Y coordinates of the objects are expected to be in the first and second column, respectively. Lines starting with # are treated as comments.


  • If you intend to use this script conveniently, install it to a directory which is in your path (see echo $PATH). Here, installation means downloading and granting permission for execution (for instance, using chmod +x tvmark.sh).
  • If you intend to install this script system-wide, copy it as root to the directory /usr/local/bin and grant permission for code execution (for instance, using chmod +x tvmark.sh).
  • While this bash script can be retrieved here as tvmark.sh, you can safely rename it to tvmark and use it accordingly.
Personal tools