STScI Nov. 21, 1997
 Version 2.1 (Updated to reflect FITS changes in IRAF) David Soderblom (revised version of 1995 instructions by Palle Moller)
 
 
 How to obtain target coordinates from the DSS.
 ==============================================
 
 
 To ensure successful completion of your HST program, it is critical
 that you provide accurate and precise target coordinates, and that
 they be in the HST Guide Star reference frame. Several HST observations
 fail each cycle, and often the cause can be traced back to inaccurate
 target coordinates provided by the observer. In such cases the proposer
 must bear the responsibility for the failure, and the observations will
 not be repeated.
 
 
 These instructions are intended to help HST proposers obtain
 accurate coordinates for their targets, thereby minimizing a major
 source of observation failures. European observers who use the ESO-MIDAS
 system and do not have access to IRAF should contact the ST-ECF in
 Garching (e-mail: stdesk@eso.org) where they can obtain software tools
 adapted to work on ESO-MIDAS format images as well as instructions and
 assistance. Observers with access to IRAF and STSDAS should refer to the
 instructions given below. These come in two parts:
 
 
 Part A: Short summary. Gives a short list of things you need to do to
 obtain the coordinates. If you are familiar with accessing the
 Digitized Sky Survey (DSS), and with using IRAF, it should be
 enough for you to read this.
 
 
 Part B: Detailed "how to do it". This gives a complete step by step
 description of all you need to do to obtain the coordinates. If
 you are not familiar with accessing DSS, or with using IRAF,
 you should read Part B before you begin, or you can read it as
 you go along.
 
 
 
 ========================================================================
 
 **************************************************
 * For observers without access to STSDAS in IRAF *
 **************************************************
 
 Contact the ST-ECF in Garching, Germany where software and instructions
 can be obtained (e-mail: stdesk@eso.org).
 
 
 ========================================================================
 
 ***********************************************
 * For observers with access to STSDAS in IRAF *
 ***********************************************
 
 
 Part A --- Summary reference sheet.
 ===================================
 
 1. Obtain an image of your field from the DSS:
 http://stdatu.stsci.edu/dss/dss_form_phase2.html
 IMPORTANT NOTE: You *must* use the http address given above, not the
 normal DSS or Starview access. The address given above automatically
 defaults to the correct Guide Star Reference Frame scans, other
 methods of accessing the DSS may use different scans.
 2. Dump a small image containing the target on your disk as a FITS file.
 3. Display the IRAF-format image and identify your target; saoimage
 works well.
 4. Measure (x,y) coordinates of your target using the IRAF command
 "imexamine".
 5. Run IRAF command "xyeq" in the stsdas.gasp package. The output is in
 J2000 coordinates.
 6. Obtain the PLATE-ID from the header of the DSS image. The coordinates
 and corresponding PLATE-ID are to be inserted in your Phase II
 proposal.
 7. To check that you got it right, there is an example attached at the
 bottom of this sheet. Try to see if you can reproduce the correct
 coordinates of this object.
 
 
 
 Part B --- Detailed instruction sheet.
 ======================================
 
 In the detailed instructions below "pr>", "cl>" etc. at the beginning of
 a line is always your prompt (hence you DON'T type this), <RTN> means
 that you must press return.
 
 
 1. Obtain an image of your field from the DSS. You can do this using
 Netscape (do *not* use Starview, for parts of the sky Starview is
 accessing different scans). Go to:
 http://stdatu.stsci.edu/dss/dss_form_phase2.html
 
 Activate the "help" pointer at the top of the page, and read the
 instructions. Enter your best guess for the coordinates of the object
 (choose J2000 or B1950 coordinates), set the size of the image to be
 as small as possible but large enough that you can identify the
 object. If you are on a very slow network you may want to set the
 "Compression" to one of the two compression options. Then activate
 the "Retrieve Image" button.
 NOTE: Choosing B1950 or J2000 as input coordinates has no effect on
 your final output coordinates (see below), they are always J2000.
 
 
 2. When the data are ready, a new window will appear. Enter in it a name
 for your FITS file (e.g. DSSim.fits) and activate the "OK" button. The
 FITS image has now been created and is ready on your disk.
 
 
 3. Now enter IRAF the normal way (probably through an xterm window).
 If you are not familiar with IRAF, or you are not sure if you have
 access to IRAF, you must ask your local system manager. Once in IRAF,
 you get a "cl>" prompt. You must now load the "stsdas" package by
 typing
 
 cl> stsdas <RTN>
 
 which gives you an "st>" prompt.
 
 4. In your console window open a display package such as saoimage:
 saoimage & <RTN>
 
 5. Display the image using the display command and identify your object.
 
 Example:
 --------
 st> display DSSim <RTN>
 z1=2496. z2=4487.092
 st> 
 
 
 6. Use the command "imexamine" to measure the (x,y) coordinates. You do
 this by typing
 
 st> imexamine <RTN>
 
 place the cursor on top of your object and press "a" on the keyboard
 (press "a" only, no <RTN>), IRAF will then calculate the best center
 of the object under the cursor, and return its (x,y) coordinates. If
 you press "r" rather than "a" you will also get a radial plot of the
 object profile. This is useful to verify that the centering algorithm
 was successful, and that the object is not badly saturated. (If your
 object is badly saturated (hence bright) you should use the coordinates
 listed in the Guide Star Catalogue. For instructions and access to the
 GSC, go to http://www-gsss.stsci.edu/support/phase2.html). If you have 
 more objects to determine positions of in this image, then just continue 
 to the next one and type "a" again. When you are done, type "q" to leave 
 the imexamine command. You now have a normal prompt "st>" again. The
 numbers listed under "COL" and "LINE" are the x and y coordinates
 respectively.
 
 Example:
 --------
 st> imexam <RTN>
 # COL LINE RMAG FLUX SKY N PA PEAK FWHM
 88.91 89.04 18.37 44832.0 4244.00 75 -46.7 10899.37 2.03
 125.52 158.41 16.90 173211.0 3008.00 78 11.2 11312.93 3.91
 st>
 
 In the above example the (x,y) coordinates of two objects at
 positions (88.91, 89.04) and (125.52, 158.41) were determined.
 
 
 7. You are now ready to convert the (x,y) coordinates to (RA, dec).
 First you must load the "gasp" package (which is within "analysis")
 by typing
 
 st> analysis <RTN>
 an> gasp <RTN>
 
 which gives you a "ga>" prompt. To convert the coordinates you must
 execute the "xyeq" command. It is strongly recommended that you first
 type
 
 ga> help xyeq <RTN>
 
 and read the documentation carefully. This command critically needs
 a number of parameters to be set correctly. If the parameters are set
 incorrectly the command may not execute, or worse, it may return
 wrong coordinates. If you are not an experienced IRAF user, we
 recommend that you follow this method:
 
 a) Enter the (x,y) coordinates into an ascii file named "xydat".
 In the above example the file xydat should simply contain:
 88.91 89.04
 125.52 158.41
 
 b) Change the parameter file for the "xyeq" command. When you enter
 IRAF this is the default parameter list you will have for xyeq:
 iminfo = Is there an input image
 image = Input image name
 coeffile = Input astrometic solution file
 xyfile = Input (x,y) file name
 pix_center = "iraf" X,Y origin: iraf(1,1); dss(1.5,1.5); cos(0.5
 xcolnum = X pixel column number
 ycolnum = Y pixel column number
 nskip = Number of lines to skip in xy file
 (original = no) Use original plate solution?
 (new = yes) Use new plate solution?
 (cdmatx = no) Use CD matrix values?
 (ra_hours = no) Display RA in h:m:s?
 (ra_format = ) Output format for RA
 (dec_format = ) Output format for DEC
 (mode = "al") 
 
 Now edit this parameter file for the xyeq command by typing
 
 ga> epar xyeq <RTN>
 
 You should edit the following parameters:
 iminfo = yes Is there an input image
 image = "DSSim.fits" Input image name
 xyfile = STDIN Input (x,y) file name
 pix_center = "iraf" X,Y origin: iraf(1,1); dss(1.5,1.5); cos(0.5
 xcolnum = 1 X pixel column number
 ycolnum = 2 Y pixel column number
 nskip = 0 Number of lines to skip in xy file
 (original = yes) Use original plate solution?
 (new = no) Use new plate solution?
 (ra_hours = yes) Display RA in h:m:s?
 (ra_format = %12.2h) Output format for RA
 (dec_format = %12.2h) Output format for DEC
 
 c) Now you execute "xyeq" simply by typing
 
 ga> xyeq <RTN>
 
 Example:
 --------
 ga> xyeq <RTN>
 Is there an input image (yes): <RTN>
 Input image name (DSSim.hhh): <RTN>
 Input (x,y) file name (xydat): <RTN>
 X,Y origin: iraf(1,1); dss(1.5,1.5); (iraf|dss|cos) (iraf): <RTN>
 X pixel column number (1): <RTN>
 Y pixel column number (2): <RTN>
 Number of lines to skip in xy file (0): <RTN>
 Output format for RA: <RTN>
 Output format for DEC: <RTN>
 X Y RA_osol DEC_osol
 (hrs) (deg)
 88.91 89.04 1:04:36.07 41:16:00.13 
 125.52 158.41 1:04:30.46 41:17:57.57 
 ga> 
 
 You have now obtained the J2000 coordinates (RA_osol, DEC_osol) of
 your targets in this field. You can stay in the "gasp" package and
 repeat all of the above steps for your next field.
 
 
 8. Obtain the PLATE-ID from the header of the DSS image. It is important
 that the PLATE-ID is obtained from the same image as the coordinates,
 because it defines the coordinate system. Header information is most
 easily obtained with the "imheader" command. However, "imheader" will
 list the entire header. To select only the "PLATEID" keyword, pipe
 the output of the command through the UNIX command "grep" (this
 works only under a UNIX based IRAF). Type
 
 ga> imheader DSSim lo+ | grep PLATEID <RTN>
 Thu Dec 10 15:14:29 EST 1995
 PLATEID = '07WO ' /GSSS Plate ID
 
 Enter coordinates and PLATE-ID in your Phase II proposal. In case
 you run VMS based IRAS you may pipe through the "page" command and
 look for the PLATEID keyword. In case proper motion is important for
 your object, you must also obtain the epoch (header keyword named
 "EPOCH") of the plate and enter it into your proposal.
 
 
 9. To check that you understand the method, here is an example you can
 test. First retrieve a 3' by 3' image centred on the B1950
 coordinates (RA = 5 28 5) and (dec = -25 6). Convert and display
 the image. Determine (x,y) coordinates of the quasar (roughly 18 mag)
 seen a bit above, and slightly left of, the centre. Convert to J2000
 coordinates:
 
 Example:
 --------
 ga> display DSSim <RTN>
 frame to be written into (1:4) (1): <RTN>
 z1=3406. z2=6048.274
 ga> imexamine <RTN>
 [move cursor to object, hit "a" key]
 # COL LINE RMAG FLUX SKY N PA PEAK FWHM
 52.91 63.03 18.37 44832.0 4244.00 75 -46.6 10895.86 2.03
 [with cursor in saoimage window, hit "q"]
 ga> xyeq <RTN>
 Is there an input image (yes): <RTN>
 Input image name (DSSim.hhh): <RTN>
 Input (x,y) file name (xydat): <RTN>
 X,Y origin: iraf(1,1); dss(1.5,1.5); (iraf|dss|cos) (iraf): <RTN>
 [if in manual mode, enter x and y coordinates here, then <RTN>]
 X pixel column number (1): <RTN>
 Y pixel column number (2): <RTN>
 Number of lines to skip in xy file (0): <RTN>
 Output format for RA: <RTN>
 Output format for DEC: <RTN>
 X Y RA_osol DEC_osol
 (hrs) (deg)
 52.91 63.03 5:30:07.94 -25:03:30.1 
 ga> imheader DSSim lo+ | grep PLATEID <RTN>
 Mon Dec 11 16:11:39 EST 1995
 PLATEID = '04NM ' /GSSS Plate ID
 ga> imheader DSSim lo+ | grep EPOCH <RTN>
 Mon Dec 11 16:12:12 EST 1995
 EPOCH = 1.9801049804688E+03 /Epoch of plate
 ga>
 
 ========================================================================
 
 If you have further questions, please contact your Program Coordinator
 or Contact Scientist.