DIRECT IMAGING AT THE 1.5 METER USING PMIS CCD CONTROL SOFTWARE
Olga Kuhn, December 1998
=============================================================================

Directions to some sources of information relevant to direct imaging
at the 1.5 meter:

>>> The home page for the Observatorio Astronomico Nacional is at
       http://bufadora.astrosen.unam.mx

    There (at http://bufadora.astrosen.unam.mx/Telescopes/telescopes.html and
     http://bufadora.astrosen.unam.mx/Instruments/ you can find information 
     on the telescopes, instruments and filters, including:

    (1) optical characteristics of the 3 telescopes at OAN, plate scales 
    (2) limits of the telescopes in declination and hour angle 
    (2) a list of filters available
    (3) characteristics of the CCDs 
	- pixel sizes (in microns)
        - quantum efficiency curves 
    (4) and the following manuals for the: 

       GUIDER  and
       FILTER WHEEL ("LA RUCA") USED AT THE 1.5-m and 84 cm

    (5) The "CCD-Tek User's Manual", by J. A. Lopez, L. Gutierrez, J. Valdez, 
      		Dec 1994, IA-UNAM Tech. Report, describes the use of
		PMIS software, but the numbers are specifically for CCDTek1
		and CCDTek2. 
 	(http://132.248.3.70/manuales/ccdtek.htm)			

    (4) information on the macros used in PMIS to aquire and sthe macros used in PMIS to aquire and store data is
	found at http://

    (5) a manual for the guider at the 1.5m

>>> Help for the filter wheel control program, "La Ruca Nueva" may be found 
      in the window that is opened upon double clicking on the icon "OAN".

>>> UBVRI photometric standards: A copy of Landolt (1992) with charts
       is in the 1.5 m control room (or one of the telescopes). 

 Information from the above sources is collected in this guide, which
is intended to help the observer set up and start taking data using the
PMIS CCD control software at the 1.5 meter (and 84 cm and 2 meter). 
Comments, corrections may be sent to Olga Kuhn 
                                      (olga@bufadora.astrosen.unam.mx).

=============================================================================

CONTENTS

 1. Turning on the telescope and guider
 2. Starting the data acquisition system (PMIS)
	2.1 starting from scratch
	2.2 setting the CCD parameters
	2.3 acquiring and storing data 
            (= sending images to the workstation "vallecitos")
            (2.3.1) macros
            (2.3.2) taking and exporting images without the macros
 3. Initializing the guider
 4. Filter wheel
 5. Focussing



(1) TURNING ON THE TELESCOPE CONSOLE AND GUIDER

	(sheet pegged to the board at the 1.5m. NOTE: the guider
	should be turned on before the console; this order seems to prevent
	communication problems between the guider and telescope)
lems between the guider and telescope)
 
(2) STARTING THE DATA ACQUISITION SYSTEM (PMIS)

(2.1) STARTING FROM SCRATCH:

   	1. turn on PC from which the CCD is controlled: usually it is marked with
   	CCD  (e.g. CCD 2-m, CCD 1.5-m or CCD 84 cm) or PC-Usuario.  

   	2. A window will appear which prompts for username and password. 
	Both are "observa". Enter the username, then move with the mouse to the 
	space in which to type the password (YOU MUST TYPE THE PASSWORD --- OR
	ELSE THE CONNECTION TO THE SUN WORKSTATION: estopa in the 2-m, vallecitos
	in the 1.5-m or grulla in the 84-cm; WILL NOT BE MADE)
      	"Windows 95" should start up and a set of icons should appear. 

 	3. Double click on the icon for the CCD you are using: CCD_Tek,
      	or CCD2000 to open the PMIS data acquisition program.

   	Two windows should appear: 
   	(1) "PMIS Image Processing Software" - the main window; and
   	(2) "TK_1K" (for CCDTeK1 & 2) or "TH7389M(2K...)" (for CCD2000) --- called 
   	the Camera window

 	4. Go to the PMIS Image Processing window, pull down the Image menu, and 
 	select NEW IMAGE to open a image buffer.

(2.2) SETTING THE CCD PARAMETERS

	On the CAMED PARAMETERS

	On the CAMERA window, click the word Camera to pull down the menu.
   	Select Acquisition Area. This opens a window where you may set the gain
   	and binning. 

   	GAIN: There are 2 options: gain=1 and gain=4. 

   	For CCDTek1 and CCDTek2, the full well is 319,000 e-. 
            1. low gain mode (gain=1) corresponds to 4.88 e-/ADU  
            2. high gain mode (gain=4) corresponds to 1.22 e-/ADU  

   	For CCD2000, the full well is 123,000 e-. 
            1. low gain mode (gain=1) corresponds to 4.88 e-/ADU  
            2. high gain mode (gain=4) corresponds to 1.22 e-/ADU  
	
   	ACQUISITION AREA: You may specify which part of the array is
   	to be read, and whether or not the pixels are to be binned.

      	To BIN: enter the binning factor in X and Y, then "Binned Camera"
      	adjusts the size.

      	To SELECT SIZE: enter the first row, number of rows, first column and 
      	number of columns. Serial = columns and parallel = rows.
       	This is particularly useful when working with the B&C spectrograph:
   	e.g. when the dispersion runs parallel to the rows and the spatial 
   	axis is parallel to the columns, to read only the rows along the slit 
   	length, you may set parallel start value and parallel size to desired values: 
   	something like 355 for start value and 370 for size, though this should be 
   	checked at the beginning of the run. 

   ----------

 	The characteristics of the CCD	The characteristics of the CCDs at OAN (CCD_Tek and CCD2000, those
	of the new SI 003 are not included here) are:

 	CCD_Tek (CCD_Tek2 should be the same): 
   	operating temperature = -100 C
	
   	pixel size = 24 microns 
    	1.5m with f/13.5 => 10.18 asec/mm => 0.24 asec/pixel without focal reducer
     	focal reducer reduces the scale by a factor 1.6, so gives 0.39 asec/pixel
	
   	full well = 319,000 electrons
   	dark current = 0.76e-/hour
   	gain 1: 4.88e-/ADU , readnoise = 6.5e- RMS
   	gain 4: 1.22e-/ADU , readnoise = 3.0e- RMS
	
 	CCD2000: 
   	operating temperature = -90 C
	
   	pixel size = 14 microns => 0.14 asec/pixel without focal reducer,
                              	0.23 asec/pixel with focal reducer
   	full well = 123,000 electrons
   	dark current = 2.0e-/hour
   	gain 1: 1.89 e-/ADU , readnoise = 4.8e- RMS
   	gain 4: 0.5 e-/ADU , readnoise = 4.4e- RMS

    NOTE: Numerical saturation at 2^16 ADU. PMIS stores numbers as signed shorts: 
	pixel values go from 0 to 32000 to -32000 to -1.
      !!! IN IRAF, "rfits", datatype should be set to ushort to "unwrap"!!!

(2.3) ACQUIRING AND STORING DATA (CHECK that the communication with the
                                       workstation is OK --- see APPENDIX)

  (2.3.1) TAKING AND EXPORTING THE IMAGES WITHOUT THE MACROS

	In the image window, select ACQUIRE, then EXPOSE. Enter
	the exposure time and OK to begin the integration. If you
	want to save the image, go If you
	want to save the image, go to FILE, then select EXPORT and then
	FITS16. A window will appear to prompt for the file name, 
	type in the name you wish, e.g. d:\image (d:\ is not necessary
	as long as the network configuration is set up properly. Make sure
	the download directory is l:\ followed by the machine name (e.g.
	vallecitos) and the full pathname to which the files are sent. 
	Then click OK. You should hear the "vallecitos" disk as it receives 
	the image. 

  NOTE: IF YOU DON'T SEND THE FILE TO "vallecitos" OR TO ANOTHER DISK ON
	THE PC (C:\), BUT LEAVE THE FILE IN D:\, it will be erased upon
	taking the next image.

  Also: the data could be saved on the PC on the disk c:\, but normally
	this is not done, only if for some reason the network is down.

  (2.3.2) USING THE MACROS (automatically loaded on entering PMIS). 

 	The list of macros are under the menu USER (from either the image or main
	PMIS window), and are NEWINIT, ONEOBS, ONEFLAT, ONEBIAS, 3FLAT, 5BIAS, etc.
	There is a help file which gives the expected syntax on PC-CCD1.5 
	(C:\Pmis/MACROS/ccdmacro.txt) and another on WWW 
	(http://hussongs.astrosen.unam.mx/manuales/macros.htm).
	
	Quick macros.htm).
	
	Quick summary (<> = mandatory argument, [] = optional)
	
   ONEFLAT: to take one flat and send it to "estopa":
      	select USER, ONEFLAT and in the box which appears type
 	<# seconds> 

   ONEOBS:  to take an object image and send it to "estopa":
      	select USER, ONEOBS and in the box which appears
      	type the 
 	<#seconds>  [filter] [RA] [DEC] (hh:mm:ss dd:mm:ss)

   NEWINIT:
 	Upon starting up PMIS (either at the beginning of run, beginning of
	night - if you want a different starting sequence number for each night,
	or after exiting and restarting PMIS, e.g. after a crash)
	it is necessary to initialize. 

 	To initialize, pull down the menu under USER and click on NEWINIT.

 	You will be prompted for the following:
	
 	* UT: The macro reads the time from the PC and puts this into the header
    	as UT. If you need to change the computer time, you can do this by :
    	1. clicking on the START icon (lower left of PC)
    	2. select SETTINGS, CONTROL PANEL, DATE/TIME  
	
 	* new sequence number: (something like 1000 for 1st night, 2000 for 2nd...)
     	NOTE: if you have to restart PMIS during the night or run, you must 
     	reset the sequence number. There are two ways to reset it:
    	 
             	(1) Go to NEWINT and set the starting sequence number to 
     	be the last sequence taken (of all the bias, obj, flat...to avoid 
     	overwriting, though it may produce gapsting, though it may produce gaps in some series, i.e. last 
     	flat=flat1009.fit last object = obj1002.fit and new sequence number=1009 
     	===> next flat=flat1010.fit, next obj = obj1010.fit.
		
	     	(2) In the PMIS main window, type "vlist" to list the parameters
     	to be entered into the headers. Then to change these, e.g. to change
     	the bias sequence number to 1009, type "vdef biseq 1009".
	
 	* observer's name 
 	* instrument
 	* telescope
 	* export directory (use default, which should be d:\)
 	* final download directory (use default, l:\, this is where the auto-log goes) 
 	* location of the macros (use default, which I think is C:\Pmis\MACROS/ )
	
 (3) INITIALIZING THE GUIDER
	
 	(refer to the sheet that is pegged to the board at the 1.5m, or the
 	guider manual)
	
 (4) FILTER WHEEL (FOCAL REDUCER, POLARIZER & PLATINA), 
	
 	To open the window control for the filter wheel, double click on 
	the icon, OAN (red white and green background). Then double click
	on the icon, "La Ruca Nueva". A window should appear with a table
	format which displays, in the left column, the desired positions of
	the components which are controlled by the program: FILTER, POLARIZER, 
	FOCAL REDUCER, PLATINA, and in the right, the actual positions.
	 
	EDIT the list of filters to correspond to those in the wheel. Click 
	CARGA the load the list --- then clicking on the arrow to the right of
	box on the left which displays the filter, sho which displays the filter, should produce a list of the 
	filters with the names you have typed.
	
	Click on initialize to INITIALIZE filtros: 
	When filter 0 is in the beam, the number that you should see on the right 
	when the filter wheel cover is open is 4.
	
	MOVE PLATINA to -12 degrees to orient the rows along N-S and columns E-W. 
	
	Help for program which controls the filter wheel for the 1.5m is 
	available on the PC from the OAN window, the same one from which 
	the filter wheel program is run.

 (5) FOCUSSING (WITH THE NEW SECONDARY --- THE OLD SECONDARY IS CURRENTLY
 	December 4, 1998 MOUNTED ... at this time there is no control program 
 	"secundario" for the secondary - focus is moved with the switch at the top 
 	of the "paleta")

 	To open the window control for the secondary, double click on 
	the icon, "secundario" (green background).

 	From this window, select "foco". This opens a window with two
	boxes: the actual focus is displayed in the box above while in the
	one below, you can enter the desired focus. To move to this value, 
	click on "Mover a foco". NOTE: You should always approach the desired focus
	from the same direction (+ to - ?).ame direction (+ to - ?). 

 	To save the time of reading the entire array, you may select
	a small region of the array. There are two ways:

	(1) First select a sufficiently bright star that an exposure time
	of a few seconds suffices. Take an exposure of a few seconds. 
	In the image window, choose a ROI (Region of Interest) by selecting
	ROI and NEW, and drawing a box by dragging the cursor from one corner 
	to the other. Move to the desired focus.  In PMIS, enter
	focus mode (continuous integrations) by selecting ACQUIRE, then 
	FOCUS. This will start a series of integraions with the exposure time
	of the previous full-frame image. To exit this mode, hit  once 
	and wait about 2x the integration time. If it doesn't stop integrating, 
	try hitting  again. Try not to hit  repeatedly as the
	computer may hang up, in which case it is necessary to leave PMIS,
	"cntl"-"alt"-"del", "shutdown" PMIS program, or reset the PC.
 	You can measure the image with PMIS, selecting the option PLOT
	in the Image window. Then move the focus again and go back to focus
	mode. It is not possible to change the focus from the PC 
	while in "Focus" mode, though you can change the focus using the 
	button on the hand paddle. 
	
	(2) In the camera (TK_1K) window, select 
	CAMERA and ACQUISITION AREA, then enter the origin of the box (upper
	left corner) in column (serial) and row (parallel) and the 
	size (serial array size and parallel array s size and parallel array size). Click OK. 
	Shut the old Image window and, from the main PMIS window, reopen a 
	new Image window with the new subarray size.
 	Take a series of integrations with different focus values and send
	these to "vallecitos" to analyze.
	
   NOTE: there is some flexure in the telescope and the focus 
	changes from one position to the other. Thus, it is necessary to 
	refocus after slewing, or even every ~30 minutes (or as necessary)
	on the same field if the telescope is very inclined. 
	
   APPENDIX:

      CHECK (e.g. try to access files at vallecitos) that the network link 
        to the workstation, "vallecitos", is established. This is important 
	since the images on the PC are stored in an image buffer which is 
	erased upon taking another image. 
	    If there is no connection, open the task "Network Neighborhood", by 
	double clicking on its icon. Then in top bar, click on the 2nd icon 
	from the left, which is "map network drive". A box will appear with 
	prompts for the Drive and Path to which the data will be sent.
	
	To select the drive, scroll down the list till you find 
    	L:\\vallecitos/home2/observa\CCDS
	
	To select the path, scroll down the list till you find 
    	L:\\vallecitos/home2/observa\CCDS
	
	Click on OK, and then "yes" when it asks you to verify.
	You may have to reenter the username and password at this stage.
	   If that doesn't work, check the repeater - whether it is OK 
	or may need to be reset.
r may need to be reset.