#!/bin/csh -f
#+
#
# S x
#
# moves the telescope south x arcsecs relative to base,
# its current position.
#
#-
#
# 20051122 - MB: added -noask flag to wfao
#

# Boiler plate for "-h" support for command autohelp.

if ("$1" == "-h") then
    help $0 | more
    exit $status
endif

# Boilerplate for syncheck.
# Note that the boiler plate should be transparent for all usages,
# but to make correct use of syncheck you will need to specify the
# correct pattern.

 set noglob
 set CheckStatus = `syncheck -command $0 $* -pattern float` 
 unset noglob

if ("$CheckStatus" != "OK") then
    help $0 | more
    exit 2
endif

# End of help/syncheck boiler plate.

if (${#argv} == 1) then
  set x = `math 0 x $1`
  if ("$x" == "0") then
    set x = `math 0 - $1`
    wfao -noask
    modify -s dcs silent raoff=0 decoff=$x rel2curr=t
    sleep 3
    waitfor -s dcs axestat=tracking
  endif
else
  echo "Usage: S x"
endif
