#!/bin/csh -f
#+
# px -- move telescope along the "x" direction in DEIMOS pixel units
#
# Purpose:
#	Move the telescope a given number of pixels in the "x"
#	direction (parallel to detector ROWS) on the DEIMOS detector.
#
# Usage:
#	px x
# 
# Arguments:
#	x = offset in the direction parallel with CCD rows [pixels]
# 
# Exit values:
#	0 = normal completion
#	1 = wrong number of arguments
#	2 = arguments not floating point
#
# Example:
#	1) Move the telescope 100 pixels in "x":
#		pxr 100
#	Note that since this is a *telescope* move, the target will
#	"move" in the OPPOSITE direction!
#-
# Modification history:
#	Date unknown	RWG	Original version
#	2000-Jul-05	GDW	Added documentation
#-----------------------------------------------------------------------

# check args...
if ( $#argv != 1 ) then
  echo "Usage: pxr x"
  exit 1
endif

# verify floating-point values...
is_float $* > /dev/null
if ( $status ) then
  echo "ERROR -- Argument must be valid floating-point number"
  exit 2
endif

# set scale...
source $DEIMOS_PROC_DIR/tel/set_scale

# convert pixels to arcsec...
set dx = `calc "$pscale * $1"`

# make move...
mxy $dx 0
