}

Guider Image Controller Overview

For version 3.0b27; last updated 6/22/00

Introduction

The guide camera image controller can control one or more guide cameras. For each camera it can take exposures, finds stars in images, determine accurate positions for stars and write images to FITS files. Image files can be retrieved via ftp and AppleShare. The Guider Image Controller is implemented in a Macintosh computer and commanded via a serial port. You cannot yet trigger a reset via the serial port, so if the Macintosh locks up you will probably have to go manually reboot it.

Commands are described in the Guider Image Controller Commands Manual and one of the commands is "help".

Each time the camera is read, the image is automatically saved to a fits file on a shared disk. The name of the most recently saved file is contained in the file "last.image". The number in the file name is automatically incremented and rolls over to one after it reaches a user-settable value (see the command setmaxfiles), so old images will be overwritten unless a copy is explicitly saved somewhere else.

Finding Stars

Star finding is done using an algorithm developed by Jeff Morgan at the University of Washington. It involves dividing the image into "super pixels", each of which contain summary information about a square of regular pixels. The size of a super pixel is chosen to be the size of an ordinary star. Very bright stars are assumed to cover a region of 5x5 super pixels. If two very bright regions overlap then both are rejected. If three bright pixels line on a line along rows or columns, all three are rejected. (Two bright adjacent super pixels are fine, as they are assumed to be one star that lies on the boundary between the two super pixels). Other tests are also used to reject pixels. The remaining bright super pixels (or sets of super pixels in the case of very bright stars) are centroided.

Centroiding

The algorithm and code are the SDSS centroiding code, as originally written by Jim Gunn and reworked into SDSS form by Heidi Newberg. The main routine is atDACentroid, which calls atObjectCenterFind_Ptr to do the centroiding, atEllipseFind to measure the shape of the star and atSigmaFind for whatever reason.

Handling Bad Pixels

Cameras that have bad pixels require "bad pixel maps" in order to find stars, centroid or even compute statistics for the image. These maps are used to determine which pixels to ignore when computing statistics, which stars to ignore when finding stars, and which stars to reject when centroiding.

Bad pixel maps are binary files containing pixel values of 0 (good) or any other value (bad). However, for the sake of coding simplicity, they have 16 bits per pixel, just like normal images. They are stored in the directory "bad pix maps" and are named as follows: "bad pixel map <camIDNum> <bin x> <bin y>". If a map doesn't exist for the particular binning factors that were used to take an image, then the operations mentioned above cannot be performed. (If this turns out to be too severe a restriction , I can change the code to calculate binned maps as needed. But the current system is faster and simpler).

Bad pixel maps may be created as follows: take an image that shows the defects in good contrast. A flat field would be a good candidate. View this image (for instance in NIH Image) and determine an upper and lower cutoff; pixels whose values are outside of this range are considered bad. You may wish to process the image to enhance the defective areas. If you have changed the image, save the changed version and manually load it. The issue the "makebadpixmap" command, using the threshold values you determined, save the resulting bad pixel map using the naming convention described above, and move it to the appropriate directory.

Hardware and Software

The controller is a Macintosh. The software can easily support any Photometric camera that can be driven by the PVCAM software library. As of this writing it supports three kinds of camera: two sizes of Photometrics SenSys cameras and one size of Photometrics PXL camera. Adding support for additional models of SenSys or PXL cameras consists of changing a data table defined in a header file, possibly modifying cam.init and recompiling and relinking the software. Adding support for other kinds of cameras requires modifying some interface subroutines, but should be fairly easy if the camera comes with a reasonable C or C++ interface library.

The system is written in Metrowerks C++. Most of the code is ANSI standard. The serial port code is Macintosh-specific, but can easily be replaced. The application contains a very tiny amount of additional Mac-specific code in "main" to handle opening the log window.

Troubleshooting

Cannot Communicate with the Guider Image Controller

  • If the Guider Image Controller talks to a terminal server and you know how to talk to it, first try some diagnosis. If you don't have a terminal server or do not know how to perform these steps, skip this part.
    • Log directly into the Guider Image Controller's port and see if the Guider Image Controller is alive. If it does not respond, reboot the Guider Image Controller. If it does respond, the problem is probably in the TCC, skip to those steps below.
    • If you cannot log into the Guider Image Controller's port, log into the terminal server itself, acquire privileges and log out the port.
  • Reboot the Guider Image Controller
    • Wait for it to fully reboot.
    • Make sure the GIm Ctrl process starts up successfully.
    • Make sure the image disk mounts correctly.
  • Initialize the camera see if communications is restored: gcam init
  • If the gcam init hangs, the TCC probably has a process tying up the port. Try restarting the likely candidates. The nicest way to free up the port is log it out via the terminal server. If that's not straightforward, then try restarting the likely processes:
    • spawn "restart guide"
    • spawn "restart gcamuser"
    • if that's not enough, stop and restart the TCC. Note that you will have to select the instrument again before you can talk to the guide camera.
  • On the other hand, if gcam init fails but does not hang, the problem is probably not in the TCC. It may be in the terminal server, the wiring, or a serious problem with the Guider Image Controller.

Disk/File Problems (e.g. cannot write image files)

  • Go to the Guider Image Controller and verify that:
    • The appropriate disk is mounted. If not:
      • If it is a local disk, you probably have hard disk problems
      • If it is a remote disk and cannot be remounted, see if the server is running. If it is, try rebooting the Guider Image Controller.
    • There is free disk space in the image directory. If not:
      • Delete some images
      • Longer term, consider buying a bigger disk and/or reducing the number of images automatically saved. You should be able to save a full set of images without running out of hard disk space.
    • The Guider Image Controller has write permission. Try creating a new folder in the image directory.
  • Reboot the Guider Image Controller.

Camera Error

  • Check cabling between the Guider Image Controller and the camera.
  • Power cycle the camera and any support electronics. Warning: some cameras (including the Photometrics PXL) have a specific power on sequence.
  • Reboot the Guider Image Controller.

History

6/22/00 Added a troubleshooting section.

6/23/99 Previous version.

Russell Owen