! %W% (ESO-ASD) %G% %U% !+++++++++++++++++++++++++++++++++++++++++++++++++++++++ !.IDENT point.prg !.PURPOSE pointing procedure !.USE @c point !.AUTHOR Cristian Levin !.VERSION 1.0 01/06/92 Creation !.VERSION 2.0 17/05/94 Cleaned up - K.Banse !.VERSION 2.1 17/08/94 sleep stuff added (CL) !.VERSION 2.2 10/01/95 implementation of parameters file (CL) !.KEYWORDS ! ------------------------------------------------------ ! ! PARAMETERS: ! p1 --> x-position of the slit ! p2 --> y-position of the slit ! p3 --> Rotator angle (default=0). ! p4 --> C[URSOR] or G[AUSS] (default=G) ! p5 --> E[ast] or W[est] (default=E) ! ! SYSTEM DEPENDENCIES: ! Marked with SYSDEP below ! It calls the Unix command "sleep" ! It uses the UNIX remsh to send a remote command to the TCS ! ! EXTERNAL VARIABLES: ! From get_mode.prg: obsmode, imscale, ptoffset, comboff ! ! ------------------------------------------------------ ! define/param p1 ? N "Enter X position of slit: " define/param p2 ? N "Enter Y position of slit: " define/param p3 0. N define/param p4 G C define/param p5 E C ! define/local ycen/r/1/1 0.0 ! target y coordinate define/local xcen/r/1/1 0.0 ! target x coordinate define/local dx/r/1/1 0.0 ! target x offset define/local dy/r/1/1 0.0 ! target y offset define/local alfa/r/1/1 0.0 define/local ra/r/1/1 0.0 define/local dec/r/1/1 0.0 define/local sen/r/1/1 0.0 define/local cos/r/1/1 0.0 define/local c1/r/1/1 0.0 define/local c2/r/1/1 0.0 define/local ioff/i/1/2 0,0 define/local xoff/r/1/1 0.0 define/local yoff/r/1/1 0.0 define/local pa/r/1/1 0.0 define/local what/c/1/1 y ! ! ------------------------- SYSDEP ---------------------------------- ! sleep for a while because a lack of sinchronization ! between graphical interface and center/gauss $ sleep 1 ! if p4(1:1) .eq. "G" then center/gauss cursor if outputi(1) .eq. 0 then write/out write/out Invalid number of coordinates. return endif xcen = outputr(5) ycen = outputr(6) else get/cursor if outputi(1) .eq. 0 then write/out write/out Invalid number of coordinates. return endif xcen = outputr(12) ycen = outputr(13) endif ! dx = xcen - {p1} dy = ycen - {p2} ! ! get the image name ioff = ididev(6)*ididev(15)+1 !offset into keyword IDIMEMC ioff(2) = ioff(1)+19 define/local cmc/c/1/20 {idimemc({ioff}:{ioff(2)})} ! @c get_mode {cmc} ! get the observing mode ! alfa = {p3} + ptoffset if obsmode(1:4) .eq. "DFOS" then if p5(1:1) .eq. "E" then alfa = {p3} + ptoffset pa = {p3} else if p5(1:1) .eq. "W" then alfa = {p3} + ptoffset + 180. pa = {p3} + 180. else write/out ERROR: {p5(1:1)} not a recognized side of pier return endif endif sen = m$sin(alfa) cos = m$cos(alfa) if obsmode(1:4) .eq. "RILD" then ra = imscale*(dy*sen - dx*cos) dec = imscale*(dx*sen + dy*cos) else if obsmode(1:4) .eq. "BIMG" then ra = imscale*(dx*cos - dy*sen) dec = -imscale*(dx*sen + dy*cos) else if obsmode(1:4) .eq. "SUSI" then ra = imscale*(dy*sen - dx*cos) dec = imscale*(dx*sen + dy*cos) else if obsmode(1:4) .eq. "EFOS" then ra = imscale*(dx*sen - dy*cos) dec = imscale*(dx*cos + dy*sen) else if obsmode(1:4) .eq. "DFOS" then ra = imscale*(dy*sen - dx*cos) dec = imscale*(dy*cos + dx*sen) comp/key xoff = M$NINT(dec/0.01538) comp/key yoff = M$NINT(ra/0.01538) else return endif ! if p5(1:1) .eq. "E" then write/out Assuming the telescope is EAST of pier: else if p5(1:1) .eq. "W" then write/out Assuming the telescope is WEST of pier: else write/out ERROR: {p5(1:1)} not a recognized side of pier return endif set/format F7.2 F7.3 write/out Rotator angle: {p3} degrees. Scale: {imscale} write/out Slit position angle: {pa} degrees. set/format F7.2 F7.2 write/out write/out "Telescope offsets (arcsecs) RA: {ra} DEC: {dec}" ! if obsmode(1:4) .eq. "DFOS" then if p5(1:1) .eq. "E" then write/out " Guide probe offsets X: {xoff} Y: {yoff}" else if p5(1:1) .eq. "W" then comp/key xoff = -1. * {xoff} comp/key yoff = -1. * {yoff} write/out " Guide probe offsets X: {xoff} Y: {yoff}" else write/out ERROR: {p5(1:1)} not a recognized side of pier return endif endif ! If the combined offsetting has been enabled in obsinit.prg ! then proceed below (comboff==1) ! ! ------------------------- SYSDEP ---------------------------------- ! if obsmode(1:4) .eq. "DFOS" .and. comboff .eq. 1 then inquire/key what/C/1/1 "Perform combined offset? (y/n) [{what}]: " if what .EQ. "y" .OR. what .EQ. "Y" then $tcscomoff.csh -c {ra} {dec} {xoff} {yoff} return endif inquire/key what/C/1/1 "Perform telescope offset? (y/n) [{what}]: " if what .EQ. "y" .OR. what .EQ. "Y" then $tcscomoff.csh -t {ra} {dec} {xoff} {yoff} return endif endif