Subject: Random position dither macros

From: James Rhoads

Submitted: Thu, 4 Apr 1996 16:58:48 -0500

Message number: 11 (previous: 10, next: 12 up: Index)

In response to Christopher Garasi's recent post, I should mention the
script that I have been using for GRIM observations for the past few
months.  It is a TCL script that directs the telescope + GRIM to take
on-off pairs with randomly generated offsets.  The user can specify how
many pairs to take, the exposure time per frame, and a range of 
acceptable offsets.  A copy of the source code resides on tycho, and I
will post the source code as a separate message to this mailing list.

To use the script, you must be running an "mcnode" window on tycho,
and must load it by typing "source ~/peyton/dsrand.tcl" ; the
computer should tell you "Loaded dsrand script."
To run a batch of exposures, you should first slew to your source, and
then need to type
  dsrand  x0 y0  maxoffset1 minoffset2 maxoffset2 npairs exptime
(where "dsrand" is literal, and all the other things are numbers.)
Basically, (x0, y0) say where the object is relative to the last slew
position (allowing for errors in coordinates/pointing/etc); maxoffset1
says how far to dither the telescope for on-source observations;
minoffset2 and maxoffset2 say how far away to put the off-source sky
frames; and npairs and exptime say how long to integrate.

More precisely:
The script will first take an exposure at an "off" position, and then 
will execute  npair  on-off pairs, so that the total number of exposures
per run is 2*npair + 1.
Each exposure is  exptime  seconds long.
The script uses absolute instrument plane offsets to move the telescope
around.
The on-source frames have offsets X, Y in the ranges
 x0-maxoffset1 < X < x0+maxoffset1 ,  y0-maxoffset1 < Y < y0+maxoffset1 .
The off-source frames have offsets satisfying 
 minoffset2 < abs( X - x0 ) < maxoffset2,
 minoffset2 < abs( Y - y0 ) < maxoffset2.

I have found that this yields a pretty good distribution of pointing
locations, and allows the observer to turn some attention to quick-look
data reduction on the fly.  (I use a home-grow IRAF script to do a quick
mosaic, using the recorded offsets in the headers, and have a version
with manually generated offsets for later, more exact reduction; I can
make those available to interested observers.)

Some advice:
The script can be used for both point source and extended source
observations.  For point sources, I usually do something like
  dsrand 0 0 20 0 20  10 30
thus making "on" and "off" source frames indistinguishable, and giving
10.5 minutes of on-source integration; while for a smallish galaxy it
would be more like
  dsrand 0 0 20 240 300  10 30
giving 5 minutes on source and 5.5 minutes on sky.
Probably maxoffset1 and (maxoffset2-minoffset2) should be at least 15
arcseconds, which is about the largest structure I've seen introduced
by bad pixel clusters/readout electronics in GRIM data from December
1995. 
If you want to integrate "indefinitely," you can give a really big number
for "npair" and later interrupt the script (using the MCnode feature/bug
mentioned as Caveat 1, below).

Some caveats:  1. While the script is running, the MCnode window *cannot*
be used for *anything* else without interrupting the script.  I work around
this by keeping at least 2 mcnode windows going at all times. This seems
to be a feature of the MC.  It can be handy, since it means that you can
make the script stop after finishing the command in progress by typing
(e.g.) "time", but can also be inconvenient.
2. The script does not check that consecutive exposures lie at different
places on the sky.  By making the maximum offsets large enough, you can
make this improbable.
2a.  It is not possible to ask for multiple exposures at each dither
position.  It would be a trivial change to the script to allow this, but
I don't actually think it needed since offsets are a small overhead.
3. The offset commands are of the form "offset  $xoff $yoff abs inst nocompute"
which means that they are not a large overhead.  However, I have once or
twice had difficulty observing M31 with degree-scale offsets; the voltages
on the drive motors get too high and the azimuth axis stops tracking. 
For offsets of one or a few arcminutes, this is not a problem. 
4.  I have never used automatic FTP, and am not sure if it can be done
from an MCnode.
5.  It is not easy to do clever things like put an interesting point
source in the "sky" frames for galaxy observations.
6. I don't know how this compares with Dan's dither script, which I have
not used.
7. Use it at your own risk!

Anyone who wants to work on improving the script to correct its
shortcomings is welcome to, but please don't modify the existing copy on
tycho ("/export/apotop/visitor1/peyton/dsrand.tcl").  Also, please let
me know if you make a modification that seems successful; I'd like to
keep track of the best scripts going.
							-James Rhoads.
APO APO APO APO APO  Apache Point Observatory 3.5m  APO APO APO
APO
APO  This is message 11 in the apo35-grim archive. You can find
APO  the archive on http://astro.princeton.edu:82/apo35-grim/INDEX.html
APO  To join/leave the list, send mail to apo35-request@astro.princeton.edu
APO  To post a message, mail it to apo35-grim@astro.princeton.edu
APO
APO APO APO APO APO APO APO APO APO APO APO APO APO APO APO APO