Imager on MSSSO 40" Notes
                              =========================
                                        June 2002
                             (Last fully revised Oct 2003)

These are some notes to compliment my WFI (Wide-Field Imager) notes. Read
those where they relate to non-WFI specific things. These notes are 
Imager-specific, but not as comprehensive as the WFI notes.
Andrew, June 2002

Jan 2004 - Minor updates, and added IRAF section
Jul 2004 - Note from DS re Imager header times in CICADA section

CONTENTS
========
 THINGS TO READ
 BASIC DATA
 CICADA, GIT & Ximtool
 AUTOGUIDER
 TELESCOPE TRACKING
 IRAF

******************************************************************************


THINGS TO READ
==============
Read my WFI notes. Much of that is relevant to observing with the Imager too.


BASIC DATA
==========
Imager chip:
MSO Name:CCD12 (there is also CCD6, and CCD10 which I haven't used)
SITe 2K Tek 2048x2048, thinned
RON 12, 24µ pixels
At f/8: Pixel scale: 0.61"/pix, FoV: 20.82'x20.82'
Full well capacity: 140k e-/pix
Gain: 2.4 or 3.38 electron/ADU
Readout time: Full chip >1minute
Full array FITS file size: ?
Dark current: < 1count/minute (that's counts not electrons at 2.4e/adu(?)) 
Pre-flush time: varies unpredictably ~13-110sec!

The /data/monsoon1 disc on Monsoon holds almost 100Gb
A DDS3 125m tape holds fractionally over 18Gb compressed
 (ie. using allocate mt1)
Writing to tape takes ~11.5min/Gb (~3.5hrs per full tape).


CICADA, GIT & Ximtool
=====================
Cicada seems to be far more stable with the Imager.

Starting Cicada:
 Log on to monsoon
 ssh to murky
 Start cicada & from murky (doesn't run from monsoon)

Abort
 This seems to work nicely without crashing cicada

Flushing
 Takes 13 sec.

Header time
Cicada, on Murky, simply asks the astromed PC ("mssso40", which is the camera 
controller) to open the shutter then asks the astromed PC to query the ETS PC 
for the time that will go in the FITS header.
So the UT time in the header may not be the actual time that the shutter opened. 
You can determine the discrepancy between header time and shutter-opening time 
by listening to the shutter open (open the door to the dome slightly). Record
the time displayed on the ETS for several exposures and compare these times 
to those in the FITS header.

Note from Dennis Stello (Jul 1, 2004):
 I just checked on one of my images from the Imager:
 There are both exp. time, and time of observations (UT/MJD/LST).
 In my notes I noted that the UT and LST are consistent with each other
 and the time of start of exposure and they are
 correct if you set the time on the ETC correct.

Ximtool
-------
N is left, E is up on the screen.
To move a star left  or N dec offset on ETS is -ve
To     "       right or S dec        "         +ve
To     "       down  or W RA         "         +ve
To     "       up    or E RA         "         -ve
 (This is better seen with a diagram)


AUTOGUIDER
==========
Here follows Andrew's recipe for autoguiding with the Newell guider and SBIG ST-4 camera.
 June 1, 2002
 Updated Jan 2004
A preliminary note:
Some things might have changed and this will become out of date sometime so you 
might want to change a step or two or vary some settings to suit your own obs.
There are probably ways to make this faster, in particular by making the finding chart
before you start observing.
And if you want to update/correct these notes, go right ahead:)

Ingredients:
-Netscape
-Transparent "Finding Chart Overlay" found in folder: "40" Telescope 
   Newell Guider / SBIG Autoguider"
-Newell Guider control paddle
-Autoguider PC screen (RH screen on control desk)
-CCDTRACK: the SBIG autoguider software (appears on Autoguider PC screen!)

Optional toppings (for focussing guider):
-"Newell 40 inch Offset Guider" control box on Cass end of telescope. 
  This is referred to as "Newell focus".
-Graduated ring on ST-4 draw tube. Referred to as "ring focus".

Instructions
0/ Don't Panic! It's actually very straight-forward, like most things, once 
you've done it once. Although these instructions do make it look longwinded.

1/ Make a finding chart...
If you have a favourite way of making a finding chart use that.
Just ensure the chart has a field of view of 1.22 degrees and a physical size,
when printed out, of 17cm x 17cm. The centre of the chart should be where the
centre of the CCD is located not your source coordinates, of course.

You might be able to use the GSC CD-ROM that exists in the control room, and 
follow the IRAF recipe that is written up in the "40" Telescope Newell
Guider / SBIG Autoguider" folder but that didn't work for me (there are steps missing).

So...try the following. It sounds contrived, and it is, but it's pretty quick and 
is good enough to find a useful guide star.

Calibrate the pointing of the telescope. ie. slew to a brightish star (mag 5-8), 
centre the star on the chip (to within ~10 pixels), then Configuration|Calibrate pointing
on the ETS PC.

Slew to your object and then position it where you want it on the CCD. Note the 
RA and dec from the top of ETS screen.

Go to skyview_advanced interface:

Set the following parameters:
    a/ RA and Dec for the centre of the imaging CCD
	ie. the RA and Dec from top of the ETS screen AFTER you've put
        your object where you want it.
    b/ select your survey (use Digital Sky Survey or DSS2 Red or DSS2 Blue)
    c/ Set "Optional Parameters"
        Set the following and leave others as default
	-"image size" = 689 x 689 pixels
	-"image size" = 1.22 degrees
	-"colour table" = B-W Linear
	-"Brightness scaling" = linear  (makes for better contrast)
        -"Equinox" = as appropriate
And submit your request.

Netscape opens another window with the chart and other information (sometimes
takes a couple of minutes).
Click on the chart to get it in a window by itself.
Print it (Netscape menu button): Set orientation=portrait, paper size=A4

You now have a Finder Chart:) N is up, E is left as usual.

2/ Choose a guide star...
Centre the transparent overlay over your finding chart. It helps to draw 
short alignment marks at the middle of each side of your chart.

There are several overlays. I have marked the field of view (21' x 21') of the
2048x2048 SITe CCD in red on one the overlays (the outer box, the inner box was a mistake!).
It's a bit faint now.

Ensure the edges of your Skyview chart and the X=+/-85 grid lines coincide
ie. that your chart is the same width as the overlay grid. The parameters above
should ensure this. But, if not, you will need to go back to Skyview and adjust the
chart's image size (in pixels). The chart should have a physical size of 17x17cm
to match the size of the overlay grid.

Choose a guide star. If it is bright enough to see on your chart it should be 
bright enough for the autoguider. Avoid regions with -52 < X < +52 or Y>+20. For 
various reasons these areas are inaccessible to the autoguider or may (?) 
vignette the imaging CCD.

Read off X & Y for your chosen guide star.
Add 1 to X
Add 26 to Y
(These corrections still work in Jan 2004. Previous advice was 
 X=X-0.6, Y=Y+29.8)
The reason for this correction is that the Newell guider was modified 
(somehow?, sometime?) and now the probe holding the pick-off mirror is 
shorter than it used to be.

3/ Move the pick-off mirror onto your Guide Star...
 a) Find the Newell Guider paddle. It usually resides on the RH end of the 
    control desk. It is the industrial looking thingy with red LED displays of 
    X, Y position (it's also covered in rubber, presumably to prevent frozen 
    hands in the astonomical dark ages when you still had to observe from 
    the dome!)
 b) First, drive the X and Y displays as far negative as they will go (ignore
    the actual values for now). It gets stuck sometimes, just back-up a little 
    then continue going negative.
 c) When you are sure you have gone as far negative as possible hit the X and Y
    reset buttons. The display should now read X=-85.00, Y=-50.00
 d) Now drive the X and Y displays back to the values you calculated above.

The pick-off mirror should now be redirecting your guide star onto the ST-4 
camera.

4/ Get Guiding...
Look up at the Autoguider PC screen. The SBIG Tracking  program "CCDTRACK" 
should be running. It's icon is on the desktop.
The Maxim-DL autoguider program may be running. I can't get this to work so
I shut it down and use CCDtrack.

a) Set up some stuff and check your guide star is there:
Set the following from the menu:
Select Camera/Scope|Establish com-link
Select Tracking|Correction Speeds
	Set "1) X+" to be 6.4*cos(telescope dec)
	Set "2) X-" to be 8.3*cos(telescope dec)
Select Tracking|Exposure Setup
	Set the exposure time (try 5sec)
Select Tracking|Go...
CCDTRACK will take an exposure and display it. You should see your chosen 
guide star. If not, well...somethings gone wrong;)

You are not autoguiding yet, one more step.

b) Go back to your science target and set it up on the pixels where you want
it. You probably slewed to it earlier, so this is just to put it back in 
the right place on the CCD if it needs to be placed accurately.
Now, back to CCDTRACK,
Hit Esc
Once again select Tracking|Go...
CCDTRACK will take another exposure and display it.
Move the small box over the star (cursor keys),
Hit Enter

Now you are autoguiding! Finally...
Relax, make some tea, turn up your favourite CD and savour your work:)

Adding an Optional Topping
 ie. Focussing the autoguider
In fact I autoguided quite well with the autoguider wildly out of focus (very 
elliptical images on the CCDTRACK screen) so this may not be necessary (?).
Feel free to add more here if you think it's important.

 There are two focussing points:
  "Newell Focus" - Newell Guider control box on back of telescope
  "Ring Focus"   - the rotating scale on ST-4 draw tube
The folder recommends a procedure to focus the autoguider - "Newell Guider 
Focusing Procedure" and Mike Bessell has written some additional notes that may 
be helpful.

The recommended nominal settings are:
Newell Focus  37.0
Ring Focus     0.0
but you will probably want to adjust the ring focus value.
(Try RF=0.85 with telescope focus=32.52, Jan 2004)

Good Luck!

TELESCOPE TRACKING
------------------
Seems to be good east of meridian. But to the west the telescope tries t
 run away (unbalanced slightly? to avoid backlash?).
If not autoguiding you will need to keep pressing E button (intermittently)
 at "guide" speed on telescope paddle.

Or (better?) you could alter the tracking rate once you know the rate of 
error. Do this on ETS screen under Motion|Rate menu.

IRAF
----
If GIT is playing up or if you just prefer it IRAF can be used to examine images.

Open an xterm (not a terminal) on the left-hand terminal.
The first time: mkiraf
 choose xterm (or xgterm)
To start iraf:  cl (cd iraf ?)
Set stdimage=imt2048
cd to directory with images
Start a viewer: either ds9 with !ds9& or ximtool with ximtool&
imexam filename
 then r   - radial plot
      e   - contour plot
      l/c - line/column plot
      s   - surface plot
      j/k - line/col fit (Gauss)
      m   - statistics on a small area (5x5)
      q to exit to cl
To save radial plot data (ie. FWHM, X-,Y-position, max cts, etc) do
 epar imexam
 and set logfile name and keeplog=no
 :q to save and exit
then use 'w' to toggle saving on/off when in ds9

help command for copious help
e for command history
imhead filename lo+ to see the full fits header

Cicada Scripting
----------------
Subject: Re: [cicada #354] Cicada Scripts
Peter Mittermayer:
I thought it might be usefull tu write an short script which does the 
following:
- change the filterwheel to pos 1
- do a fixed number of exposerus with the same exposure time, display and 
  save them
- and repeat this procedure for the other two filters
- then restart with filter wheel in position 1

Peter Young:
Here is what I would try (not tested):

# Script to do multiple exposures for different filter settings

#set object - note if you want to pass quotes through, they must be 
# escaped with \.
cicada set object=\"NGC4755\"
cicada set_filter filter_pos=1
cicada set filter="U"
cicada set comment=\"NGC4755 filter U\"
set exposures 3
for {set i 0} {$i < $exposures} {incr i 1} {
    set run [expr ${CICADA_RUN_NUMBER} + ${i}]
    cicada expose run_number=${run} duration=2
}

Note that I have used one of the few (undocumented in V2 of the manual)
CICADA global TCL variables - CICADA_RUN_NUMBER for updating the run
number and keeping it in sync with the GUI. Other global TCL variables are
CICADA_OBJECT, CICADA_OUT_DIR and CICADA_OUT_PREFIX. Global variables are
set at the start of a script from values current from the GUI.

Here is an example script that has been tested and works, note
use of TCL looping structure:

# Sample Cicada TCL script for reading out multiple times
# PJY 
#

cicada set width=2048 height=4096 XO=0 YO=0 
cicada set DO_SAVE=1 DO_DISPLAY=1 DARK=0 DO_READOUT=1
cicada set UNIT=1000 DURATION=5 REPEAT=1 
cicada set out_dir=$CICADA_OUT_DIR out_prefix=$CICADA_OUT_PREFIX
cicada SET object=\"$CICADA_OBJECT\"
cicada set comment=\"This is a comment\"
for {set i 0} {$i < 2} {incr i 1} {
# remove the temporary image if already there, catch any failures
    catch {exec /bin/rm -f /tmp/IM${i}.fits}
# execute an expose request - abort script if an error occurs
    set run [expr ${CICADA_RUN_NUMBER} + ${i}]
    cicada EXPOSE RUN_NUMBER=${run}
}

I recommend that you find a manual on using TCL if you want more complex
scripts.