      PROGRAM OWNINIT
*+
*    TELESCOPE CONTROL SYSTEM          Isaac Newton Group of Telescopes
*    ------------------------               Royal Greenwich Observatory
*
* Copyright (c) 1998    Particle Physics and Astronomy Research Council
* All rights reserved
*
* Program : OWNINIT
*
* Purpose : Initializes the installed COMMON blocks ('global sections')
*           for the WHT.
*-
* History :
*  24-Jul-1996 JMB Original version, based on WHT.INI
*   1-Feb-1997 MPF/RAL Major amendments for generalised TCS.
*   2-May-1998 MPF Use new variable INS_AD_XY2MOUNT to handle change of
*                  instruments at WHT Prime.
*   7-May-1998 FJG Updated Prime Focus pointing model 
*   1-Jun-1998 MPF Added support for Integral.
*   9-Oct-1998 MPF Revert to previous (VAX) Prime Focus model.
*  10-Oct-1998 MPF Use corrected May 98 PF model (Alpha), improve comments.
*  13-Oct-1998 MPF New PF pointing model, update IERS coeffs
*  11-Dec-1998 FJG IERS coefficients from 10-Dec-1998, including 
*                  31-Dec-1998 leap second. 
*  04-Jan-1998 FJG Update corrections for old UES Optical derotator 
*  25-Jan-1999 MPF New UES pointing model, updated IERS coeffs, updated UES
*                  UV derot corrrections
*  28-Jan-1999 MPF Update UES UV derotator tracking corrections.
*  31-Mar-1999 MPF Increased linear gain for Nasmyth rotators from 0.5 to 2.0
*  24-Apr-1999 FJG GHRIL Pointing test (24-Apr-1999), IR Derot correction
*                  (24-Apr-1999) 
*  10-May-1999 RCLARK Updated IERS paraameters for 6-may-1999 report
*                  and set the linear gains for the nasmyth rotators
*                  to original value.
*
** Include files **
*
      INCLUDE         '($SMGDEF)'
      INCLUDE         '(_STRDEF)'
*
      INCLUDE         '(_APEDEF)'
      INCLUDE         '(_CEFDEF)'
      INCLUDE         '(_COMDEF)'
      INCLUDE         '(_CSPDEF)'
      INCLUDE         '(_DISDEF)'
      INCLUDE         '(_ENCDEF)'
      INCLUDE         '(_GUIDEF)'
      INCLUDE         '(_INSDEF)'
      INCLUDE         '(_LEFDEF)'
      INCLUDE         '(_MECDEF)'
      INCLUDE         '(_MTHDEF)'
      INCLUDE         '(_OFFDEF)'
      INCLUDE         '(_PIGDEF)'
      INCLUDE         '(_POIDEF)'
      INCLUDE         '(_PRKDEF)'
      INCLUDE         '(_QUEDEF)'
      INCLUDE         '(_TELDEF)'
      INCLUDE         '(_TVSDEF)'
      INCLUDE         '(_USRDEF)'
      INCLUDE         '(_APEGSD)'
      INCLUDE         '(_COMGSD)'
      INCLUDE         '(_DISGSD)'
      INCLUDE         '(_ENCGSD)'
      INCLUDE         '(_GUIGSD)'
      INCLUDE         '(_INSGSD)'
      INCLUDE         '(_MECGSD)'
      INCLUDE         '(_METGSD)'
      INCLUDE         '(_OFFGSD)'
      INCLUDE         '(_PIGGSD)'
      INCLUDE         '(_PNAGSD)'
      INCLUDE         '(_POIGSD)'
      INCLUDE         '(_POSGSD)'
      INCLUDE         '(_PRKGSD)'
      INCLUDE         '(_QUEGSD)'
      INCLUDE         '(_SYNGSD)'
      INCLUDE         '(_SYRGSD)'
      INCLUDE         '(_TELGSD)'
      INCLUDE         '(_TIMGSD)'
      INCLUDE         '(_TVSGSD)'
*
** Local variables **
*
      INTEGER         I
*
** Executable code ***********************************************************
*
*
* Aperture offsets global section (_APEGSD.INC, APERTURE)
* -------------------------------------------------------
*
      APE_GL_SELECT  = APE_K_NOMINAL  ! Nominal aperture is the default
*
*==============================================================================*
*
* Display global section (_DISGSD.INC, DISPLAY)
* ---------------------------------------------
*
* Identities for display pages
*
      DIS_GL_PAGE_TOT = 6
      DIS_GL_ROWS     = 30
      DIS_GL_COLUMNS  = 80
*
* Names of display pages
*
      DIS_AT_KEYW(1) = 'INFO'
      DIS_AT_KEYW(2) = 'ENCODERS'
      DIS_AT_KEYW(3) = 'SENSORS'
      DIS_AT_KEYW(4) = 'LIMITS'
      DIS_AT_KEYW(5) = 'ALARMS'
      DIS_AT_KEYW(6) = 'DOME'
*
* Text strings for mount coords
*
      DIS_AT_MOUNT(1) = 'AZ           '
      DIS_AT_MOUNT(2) = 'EL           '
*
* Number of elements of alarm/status array in use

      DIS_GL_SLW  = 6
*
* Masks to select valid alarm and status bits
*
      DIS_AL_VALID(1) = '0000003C'X
      DIS_AL_VALID(2) = '0000001F'X
      DIS_AL_VALID(3) = '00001FFF'X
      DIS_AL_VALID(4) = '000001FF'X
      DIS_AL_VALID(5) = '00FFFFFF'X
*
*  N.B. Mirror definer load cell alarm (bit 9 alarms register 2,
*       status number 169) disabled.
*
      DIS_AL_VALID(6) = '007FFDFF'X
*
* Data for display screens
*
      DIS_AT_STATUS_NAME(1)     = 'Shutters manual override  '
      DIS_AT_BIT_SET_STRING(1)  = 'ENABLED   '
      DIS_AT_BIT_CLR_STRING(1)  = 'DISABLED  '
      DIS_AL_PAGE(1)            = 6
      DIS_AL_LINE(1)            = 1
      DIS_AL_COLUMN(1)          = 42
      DIS_AL_SEVERITY(1)        = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(2)     = 'Dome manual override      '
      DIS_AT_BIT_SET_STRING(2)  = 'ENABLED   '
      DIS_AT_BIT_CLR_STRING(2)  = 'DISABLED  '
      DIS_AL_PAGE(2)            = 6
      DIS_AL_LINE(2)            = 1
      DIS_AL_COLUMN(2)          = 2
      DIS_AL_SEVERITY(2)        = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(3)     = 'Focus manual override     '
      DIS_AT_BIT_SET_STRING(3)  = 'ENABLED   '
      DIS_AT_BIT_CLR_STRING(3)  = 'DISABLED  '
      DIS_AL_PAGE(3)            = 6
      DIS_AL_LINE(3)            = 2
      DIS_AL_COLUMN(3)          = 2
      DIS_AL_SEVERITY(3)        = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(4)     = 'Mirror cover man override '
      DIS_AT_BIT_SET_STRING(4)  = 'ENABLED   '
      DIS_AT_BIT_CLR_STRING(4)  = 'DISABLED  '
      DIS_AL_PAGE(4)            = 6
      DIS_AL_LINE(4)            = 2
      DIS_AL_COLUMN(4)          = 42
      DIS_AL_SEVERITY(4)        = SMG$M_REVERSE
*
* Note error in Camac schedule: dome and shutter override bits are inter-
*   changed
      DIS_AT_STATUS_NAME(5)     = 'Emergency stop            '
      DIS_AT_BIT_SET_STRING(5)  = 'RELEASED  '
      DIS_AT_BIT_CLR_STRING(5)  = 'ACTUATED  '
      DIS_AL_PAGE(5)            = 4
      DIS_AL_LINE(5)            = 1
      DIS_AL_COLUMN(5)          = 2
      DIS_AL_SEVERITY(5)        = 0
      DIS_AT_STATUS_NAME(6)     = 'Computer reset button     '
      DIS_AT_BIT_SET_STRING(6)  = 'ENABLED   '
      DIS_AT_BIT_CLR_STRING(6)  = 'DISABLED  '
      DIS_AL_PAGE(6)            = 4
      DIS_AL_LINE(6)            = 1
      DIS_AL_COLUMN(6)          = 42
      DIS_AL_SEVERITY(6)        = SMG$M_BOLD
      DIS_AT_STATUS_NAME(7)     = 'Telescope power           '
      DIS_AT_BIT_SET_STRING(7)  = 'ON        '
      DIS_AT_BIT_CLR_STRING(7)  = 'OFF       '
      DIS_AL_PAGE(7)            = 4
      DIS_AL_LINE(7)            = 2
      DIS_AL_COLUMN(7)          = 2
      DIS_AL_SEVERITY(7)        = 0
      DIS_AT_STATUS_NAME(8)     = 'Mode selected             '
      DIS_AT_BIT_SET_STRING(8)  = 'COMPUTER  '
      DIS_AT_BIT_CLR_STRING(8)  = 'ENGINEER  '
      DIS_AL_PAGE(8)            = 4
      DIS_AL_LINE(8)            = 2
      DIS_AL_COLUMN(8)          = 42
      DIS_AL_SEVERITY(8)        = SMG$M_BOLD
      DIS_AT_STATUS_NAME(9)     = 'Control room temp alarm   '
      DIS_AT_BIT_SET_STRING(9)  = 'SET       '
      DIS_AT_BIT_CLR_STRING(9)  = 'CLEAR     '
      DIS_AL_PAGE(9)            = 0
      DIS_AL_LINE(9)            = 14
      DIS_AL_COLUMN(9)          = 2
      DIS_AL_SEVERITY(9)        = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(10)    = 'Dome control              '
      DIS_AT_BIT_SET_STRING(10) = 'REMOTE    '
      DIS_AT_BIT_CLR_STRING(10) = 'LOCAL     ' 
      DIS_AL_PAGE(10)           = 0
      DIS_AL_LINE(10)           = 4
      DIS_AL_COLUMN(10)         = 2
      DIS_AL_SEVERITY(10)       = 0
      DIS_AT_STATUS_NAME(11)    = 'Dome power                '
      DIS_AT_BIT_SET_STRING(11) = 'ON        '
      DIS_AT_BIT_CLR_STRING(11) = 'OFF       '
      DIS_AL_PAGE(11)           = 6
      DIS_AL_LINE(11)           = 4
      DIS_AL_COLUMN(11)         = 42
      DIS_AL_SEVERITY(11)       = 0
      DIS_AT_STATUS_NAME(12)    = 'Shutter control           '
      DIS_AT_BIT_SET_STRING(12) = 'REMOTE    '
      DIS_AT_BIT_CLR_STRING(12) = 'LOCAL     '
      DIS_AL_PAGE(12)           = 0
      DIS_AL_LINE(12)           = 5
      DIS_AL_COLUMN(12)         = 2
      DIS_AL_SEVERITY(12)       = 0
      DIS_AT_STATUS_NAME(13)    = 'Shutter power             '
      DIS_AT_BIT_SET_STRING(13) = 'ON        '
      DIS_AT_BIT_CLR_STRING(13) = 'OFF       '
      DIS_AL_PAGE(13)           = 6
      DIS_AL_LINE(13)           = 5
      DIS_AL_COLUMN(13)         = 42
      DIS_AL_SEVERITY(13)       = 0
      DIS_AT_STATUS_NAME(14)    = 'Shutter overtravel        '
      DIS_AT_BIT_SET_STRING(14) = 'SET       '
      DIS_AT_BIT_CLR_STRING(14) = 'CLEAR     '
      DIS_AL_PAGE(14)           = 6
      DIS_AL_LINE(14)           = 6
      DIS_AL_COLUMN(14)         = 2
      DIS_AL_SEVERITY(14)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(15)    = 'Shutter torque trip       '
      DIS_AT_BIT_SET_STRING(15) = 'TRIPPED   '
      DIS_AT_BIT_CLR_STRING(15) = 'CLEAR     '
      DIS_AL_PAGE(15)           = 6
      DIS_AL_LINE(15)           = 6
      DIS_AL_COLUMN(15)         = 42
      DIS_AL_SEVERITY(15)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(16)    = 'Windshield control        '
      DIS_AT_BIT_SET_STRING(16) = 'REMOTE    '
      DIS_AT_BIT_CLR_STRING(16) = 'LOCAL     '
      DIS_AL_PAGE(16)           = 6
      DIS_AL_LINE(16)           = 7
      DIS_AL_COLUMN(16)         = 2
      DIS_AL_SEVERITY(16)       = 0
      DIS_AT_STATUS_NAME(17)    = 'Windshield power          '
      DIS_AT_BIT_SET_STRING(17) = 'ON        '
      DIS_AT_BIT_CLR_STRING(17) = 'OFF       '
      DIS_AL_PAGE(17)           = 6
      DIS_AL_LINE(17)           = 7
      DIS_AL_COLUMN(17)         = 42
      DIS_AL_SEVERITY(17)       = 0
      DIS_AT_STATUS_NAME(18)    = 'Windshield overtravel     '
      DIS_AT_BIT_SET_STRING(18) = 'SET       '
      DIS_AT_BIT_CLR_STRING(18) = 'CLEAR     '
      DIS_AL_PAGE(18)           = 6
      DIS_AL_LINE(18)           = 8
      DIS_AL_COLUMN(18)         = 2
      DIS_AL_SEVERITY(18)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(19)    = 'Windshield torque trip    '
      DIS_AT_BIT_SET_STRING(19) = 'TRIPPED   '
      DIS_AT_BIT_CLR_STRING(19) = 'CLEAR     '
      DIS_AL_PAGE(19)           = 6
      DIS_AL_LINE(19)           = 8
      DIS_AL_COLUMN(19)         = 42
      DIS_AL_SEVERITY(19)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(20)    = 'Windshield                '
      DIS_AT_BIT_SET_STRING(20) = 'PARKED    '
      DIS_AT_BIT_CLR_STRING(20) = 'NOT PARKED'
      DIS_AL_PAGE(20)           = 6
      DIS_AL_LINE(20)           = 9
      DIS_AL_COLUMN(20)         = 2
      DIS_AL_SEVERITY(20)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(21)    = 'Platform pin              '
      DIS_AT_BIT_SET_STRING(21) = 'IN        '
      DIS_AT_BIT_CLR_STRING(21) = 'OUT       '
      DIS_AL_PAGE(21)           = 6
      DIS_AL_LINE(21)           = 9
      DIS_AL_COLUMN(21)         = 42
      DIS_AL_SEVERITY(21)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(22)    = 'Shutter and windshield    '
      DIS_AT_BIT_SET_STRING(22) = 'CLOSED    '
      DIS_AT_BIT_CLR_STRING(22) = 'OPEN      '
      DIS_AL_PAGE(22)           = 6
      DIS_AL_LINE(22)           = 10
      DIS_AL_COLUMN(22)         = 2
      DIS_AL_SEVERITY(22)       = SMG$M_REVERSE
*
* Note Nasmyth GHRIL and UES interchanged in Camac schedule.
*
      DIS_AT_STATUS_NAME(23)    = 'Cassegrain focus          '
      DIS_AT_BIT_SET_STRING(23) = 'SELECTED  '
      DIS_AT_BIT_CLR_STRING(23) = '          '
      DIS_AL_PAGE(23)           = 6
      DIS_AL_LINE(23)           = 12
      DIS_AL_COLUMN(23)         = 2
      DIS_AL_SEVERITY(23)       = SMG$M_BOLD
      DIS_AT_STATUS_NAME(24)    = 'Prime focus               '
      DIS_AT_BIT_SET_STRING(24) = 'SELECTED  '
      DIS_AT_BIT_CLR_STRING(24) = '          '
      DIS_AL_PAGE(24)           = 6
      DIS_AL_LINE(24)           = 12
      DIS_AL_COLUMN(24)         = 42
      DIS_AL_SEVERITY(24)       = SMG$M_BOLD
      DIS_AT_STATUS_NAME(25)    = 'GHRIL Nasmyth focus       '
      DIS_AT_BIT_SET_STRING(25) = 'SELECTED  '
      DIS_AT_BIT_CLR_STRING(25) = '          '
      DIS_AL_PAGE(25)           = 6
      DIS_AL_LINE(25)           = 13
      DIS_AL_COLUMN(25)         = 42
      DIS_AL_SEVERITY(25)       = SMG$M_BOLD
      DIS_AT_STATUS_NAME(26)    = 'UES Nasmyth focus         '
      DIS_AT_BIT_SET_STRING(26) = 'SELECTED  '
      DIS_AT_BIT_CLR_STRING(26) = '          '
      DIS_AL_PAGE(26)           = 6
      DIS_AL_LINE(26)           = 13
      DIS_AL_COLUMN(26)         = 2
      DIS_AL_SEVERITY(26)       = SMG$M_BOLD
      DIS_AT_STATUS_NAME(27)    = 'Folded Cass focus         '
      DIS_AT_BIT_SET_STRING(27) = 'SELECTED  '
      DIS_AT_BIT_CLR_STRING(27) = '          '
      DIS_AL_PAGE(27)           = 6
      DIS_AL_LINE(27)           = 14
      DIS_AL_COLUMN(27)         = 2
      DIS_AL_SEVERITY(27)       = SMG$M_BOLD
      DIS_AT_STATUS_NAME(28)    = 'Nasmyth flat              '
      DIS_AT_BIT_SET_STRING(28) = 'STOWED    '
      DIS_AT_BIT_CLR_STRING(28) = 'NOT STOWED'
      DIS_AL_PAGE(28)           = 6
      DIS_AL_LINE(28)           = 17
      DIS_AL_COLUMN(28)         = 2
      DIS_AL_SEVERITY(28)       = SMG$M_BOLD
      DIS_AT_STATUS_NAME(29)    = 'Primary mirror cover      '
      DIS_AT_BIT_SET_STRING(29) = 'CLOSED    '
      DIS_AT_BIT_CLR_STRING(29) = 'NOT CLOSED'
      DIS_AL_PAGE(29)           = 6
      DIS_AL_LINE(29)           = 16
      DIS_AL_COLUMN(29)         = 2
      DIS_AL_SEVERITY(29)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(30)    = 'Primary mirror cover      '
      DIS_AT_BIT_SET_STRING(30) = 'OPEN      '
      DIS_AT_BIT_CLR_STRING(30) = 'NOT OPEN  '
      DIS_AL_PAGE(30)           = 6
      DIS_AL_LINE(30)           = 16
      DIS_AL_COLUMN(30)         = 42
      DIS_AL_SEVERITY(30)       = 0
      DIS_AT_STATUS_NAME(31)    = 'Sec mirror cover          '
      DIS_AT_BIT_SET_STRING(31) = 'ON        '
      DIS_AT_BIT_CLR_STRING(31) = 'OFF       '
      DIS_AL_PAGE(31)           = 6
      DIS_AL_LINE(31)           = 17
      DIS_AL_COLUMN(31)         = 42
      DIS_AL_SEVERITY(31)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(32)    = 'Altitude,    -ve prelimit '
      DIS_AT_BIT_SET_STRING(32) = 'SET       '
      DIS_AT_BIT_CLR_STRING(32) = 'CLEAR     '
      DIS_AL_PAGE(32)           = 4
      DIS_AL_LINE(32)           = 7
      DIS_AL_COLUMN(32)         = 2
      DIS_AL_SEVERITY(32)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(33)    = 'Altitude,       -ve limit '
      DIS_AT_BIT_SET_STRING(33) = 'SET       '
      DIS_AT_BIT_CLR_STRING(33) = 'CLEAR     '
      DIS_AL_PAGE(33)           = 4
      DIS_AL_LINE(33)           = 7
      DIS_AL_COLUMN(33)         = 42
      DIS_AL_SEVERITY(33)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(34)    = 'Altitude,    +ve prelimit '
      DIS_AT_BIT_SET_STRING(34) = 'SET       '
      DIS_AT_BIT_CLR_STRING(34) = 'CLEAR     '
      DIS_AL_PAGE(34)           = 4
      DIS_AL_LINE(34)           = 8
      DIS_AL_COLUMN(34)         = 2
      DIS_AL_SEVERITY(34)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(35)    = 'Altitude,       +ve limit '
      DIS_AT_BIT_SET_STRING(35) = 'SET       '
      DIS_AT_BIT_CLR_STRING(35) = 'CLEAR     '
      DIS_AL_PAGE(35)           = 4
      DIS_AL_LINE(35)           = 8
      DIS_AL_COLUMN(35)         = 42
      DIS_AL_SEVERITY(35)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(36)    = 'Azimuth,     -ve prelimit '
      DIS_AT_BIT_SET_STRING(36) = 'SET       '
      DIS_AT_BIT_CLR_STRING(36) = 'CLEAR     '
      DIS_AL_PAGE(36)           = 4
      DIS_AL_LINE(36)           = 4
      DIS_AL_COLUMN(36)         = 2
      DIS_AL_SEVERITY(36)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(37)    = 'Azimuth,        -ve limit '
      DIS_AT_BIT_SET_STRING(37) = 'SET       '
      DIS_AT_BIT_CLR_STRING(37) = 'CLEAR     '
      DIS_AL_PAGE(37)           = 4
      DIS_AL_LINE(37)           = 4
      DIS_AL_COLUMN(37)         = 42
      DIS_AL_SEVERITY(37)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(38)    = 'Azimuth,     +ve prelimit '
      DIS_AT_BIT_SET_STRING(38) = 'SET       '
      DIS_AT_BIT_CLR_STRING(38) = 'CLEAR     '
      DIS_AL_PAGE(38)           = 4
      DIS_AL_LINE(38)           = 5
      DIS_AL_COLUMN(38)         = 2
      DIS_AL_SEVERITY(38)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(39)    = 'Azimuth,        +ve limit '
      DIS_AT_BIT_SET_STRING(39) = 'SET       '
      DIS_AT_BIT_CLR_STRING(39) = 'CLEAR     '
      DIS_AL_PAGE(39)           = 4
      DIS_AL_LINE(39)           = 5
      DIS_AL_COLUMN(39)         = 42
      DIS_AL_SEVERITY(39)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(40)    = 'Telescope beam            '
      DIS_AT_BIT_SET_STRING(40) = 'OBSCURED  '
      DIS_AT_BIT_CLR_STRING(40) = 'CLEAR     '
      DIS_AL_PAGE(40)           = 0
      DIS_AL_LINE(40)           = 0
      DIS_AL_COLUMN(40)         = 0
      DIS_AL_SEVERITY(40)       = 0
      DIS_AT_STATUS_NAME(41)    = 'Prime focus TT, +ve limit '
      DIS_AT_BIT_SET_STRING(41) = 'SET       '
      DIS_AT_BIT_CLR_STRING(41) = 'CLEAR     '
      DIS_AL_PAGE(41)           = 4
      DIS_AL_LINE(41)           = 11
      DIS_AL_COLUMN(41)         = 42
      DIS_AL_SEVERITY(41)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(42)    = 'Prime focus TT, -ve limit '
      DIS_AT_BIT_SET_STRING(42) = 'SET       '
      DIS_AT_BIT_CLR_STRING(42) = 'CLEAR     '
      DIS_AL_PAGE(42)           = 4
      DIS_AL_LINE(42)           = 11
      DIS_AL_COLUMN(42)         = 2
      DIS_AL_SEVERITY(42)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(43)    = 'Cassegrain TT,  -ve limit '
      DIS_AT_BIT_SET_STRING(43) = 'SET       '
      DIS_AT_BIT_CLR_STRING(43) = 'CLEAR     '
      DIS_AL_PAGE(43)           = 4
      DIS_AL_LINE(43)           = 13
      DIS_AL_COLUMN(43)         = 2
      DIS_AL_SEVERITY(43)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(44)    = 'Cassegrain TT,  +ve limit '
      DIS_AT_BIT_SET_STRING(44) = 'SET       '
      DIS_AT_BIT_CLR_STRING(44) = 'CLEAR     '
      DIS_AL_PAGE(44)           = 4
      DIS_AL_LINE(44)           = 13
      DIS_AL_COLUMN(44)         = 42
      DIS_AL_SEVERITY(44)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(45)    = 'Cass wrap,      -ve limit '
      DIS_AT_BIT_SET_STRING(45) = 'SET       '
      DIS_AT_BIT_CLR_STRING(45) = 'CLEAR     '
      DIS_AL_PAGE(45)           = 4
      DIS_AL_LINE(45)           = 14
      DIS_AL_COLUMN(45)         = 42
      DIS_AL_SEVERITY(45)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(46)    = 'Cass wrap,      +ve limit '
      DIS_AT_BIT_SET_STRING(46) = 'SET       '
      DIS_AT_BIT_CLR_STRING(46) = 'CLEAR     '
      DIS_AL_PAGE(46)           = 4
      DIS_AL_LINE(46)           = 14
      DIS_AL_COLUMN(46)         = 2
      DIS_AL_SEVERITY(46)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(47)    = 'Focus,          -ve limit '
      DIS_AT_BIT_SET_STRING(47) = 'SET       '
      DIS_AT_BIT_CLR_STRING(47) = 'CLEAR     '
      DIS_AL_PAGE(47)           = 4
      DIS_AL_LINE(47)           = 19
      DIS_AL_COLUMN(47)         = 2
      DIS_AL_SEVERITY(47)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(48)    = 'Focus,          +ve limit '
      DIS_AT_BIT_SET_STRING(48) = 'SET       '
      DIS_AT_BIT_CLR_STRING(48) = 'CLEAR     '
      DIS_AL_PAGE(48)           = 4
      DIS_AL_LINE(48)           = 19
      DIS_AL_COLUMN(48)         = 42
      DIS_AL_SEVERITY(48)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(49)    = 'Access park tie           '
      DIS_AT_BIT_SET_STRING(49) = 'IN        '
      DIS_AT_BIT_CLR_STRING(49) = 'OUT       '
      DIS_AL_PAGE(49)           = 6
      DIS_AL_LINE(49)           = 20
      DIS_AL_COLUMN(49)         = 2
      DIS_AL_SEVERITY(49)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(50)    = 'Dome interlock            '
      DIS_AT_BIT_SET_STRING(50) = 'ENABLED   '
      DIS_AT_BIT_CLR_STRING(50) = 'DISABLED  '
      DIS_AL_PAGE(50)           = 6
      DIS_AL_LINE(50)           = 10
      DIS_AL_COLUMN(50)         = 42
      DIS_AL_SEVERITY(50)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(51)    = 'AP 3 access platform      '
      DIS_AT_BIT_SET_STRING(51) = 'STOWED    '
      DIS_AT_BIT_CLR_STRING(51) = 'DEPLOYED  '
      DIS_AL_PAGE(51)           = 6
      DIS_AL_LINE(51)           = 20
      DIS_AL_COLUMN(51)         = 42
      DIS_AL_SEVERITY(51)       = 0
      DIS_AT_STATUS_NAME(52)    = 'Revolving floor latch     '
      DIS_AT_BIT_SET_STRING(52) = 'SET       '
      DIS_AT_BIT_CLR_STRING(52) = 'CLEAR     '
      DIS_AL_PAGE(52)           = 6
      DIS_AL_LINE(52)           = 21
      DIS_AL_COLUMN(52)         = 2
      DIS_AL_SEVERITY(52)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(53)    = 'Altitude,     final limit '
      DIS_AT_BIT_SET_STRING(53) = 'SET       '
      DIS_AT_BIT_CLR_STRING(53) = 'CLEAR     '
      DIS_AL_PAGE(53)           = 4
      DIS_AL_LINE(53)           = 9
      DIS_AL_COLUMN(53)         = 2
      DIS_AL_SEVERITY(53)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(54)    = 'Oil pad alarm             '
      DIS_AT_BIT_SET_STRING(54) = 'SET       '
      DIS_AT_BIT_CLR_STRING(54) = 'CLEAR     '
      DIS_AL_PAGE(54)           = 5
      DIS_AL_LINE(54)           = 1
      DIS_AL_COLUMN(54)         = 2
      DIS_AL_SEVERITY(54)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(55)    = 'Power amplifier           '
      DIS_AT_BIT_SET_STRING(55) = 'FAULTY    '
      DIS_AT_BIT_CLR_STRING(55) = 'WORKING   '
      DIS_AL_PAGE(55)           = 5
      DIS_AL_LINE(55)           = 2
      DIS_AL_COLUMN(55)         = 42
      DIS_AL_SEVERITY(55)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(56)    = 'Gearbox oil alarm         '
      DIS_AT_BIT_SET_STRING(56) = 'SET       '
      DIS_AT_BIT_CLR_STRING(56) = 'CLEAR     '
      DIS_AL_PAGE(56)           = 5
      DIS_AL_LINE(56)           = 2
      DIS_AL_COLUMN(56)         = 2
      DIS_AL_SEVERITY(56)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(57)    = 'Oil pump                  '
      DIS_AT_BIT_SET_STRING(57) = 'TRIPPED   '
      DIS_AT_BIT_CLR_STRING(57) = 'CLEAR     '
      DIS_AL_PAGE(57)           = 5
      DIS_AL_LINE(57)           = 3
      DIS_AL_COLUMN(57)         = 2
      DIS_AL_SEVERITY(57)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(58)    = 'Altitude oil filter alarm '
      DIS_AT_BIT_SET_STRING(58) = 'SET       '
      DIS_AT_BIT_CLR_STRING(58) = 'CLEAR     '
      DIS_AL_PAGE(58)           = 5
      DIS_AL_LINE(58)           = 4
      DIS_AL_COLUMN(58)         = 2
      DIS_AL_SEVERITY(58)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(59)    = 'Azimuth oil filter alarm  '
      DIS_AT_BIT_SET_STRING(59) = 'SET       '
      DIS_AT_BIT_CLR_STRING(59) = 'CLEAR     '
      DIS_AL_PAGE(59)           = 5
      DIS_AL_LINE(59)           = 5
      DIS_AL_COLUMN(59)         = 2
      DIS_AL_SEVERITY(59)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(60)    = 'Oil temperature           '
      DIS_AT_BIT_SET_STRING(60) = 'HIGH      '
      DIS_AT_BIT_CLR_STRING(60) = 'NORMAL    '
      DIS_AL_PAGE(60)           = 5
      DIS_AL_LINE(60)           = 6
      DIS_AL_COLUMN(60)         = 2
      DIS_AL_SEVERITY(60)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(61)    = 'Oil level                 '
      DIS_AT_BIT_SET_STRING(61) = 'LOW       '
      DIS_AT_BIT_CLR_STRING(61) = 'NORMAL    '
      DIS_AL_PAGE(61)           = 5
      DIS_AL_LINE(61)           = 7
      DIS_AL_COLUMN(61)         = 2
      DIS_AL_SEVERITY(61)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(62)    = 'Al oil flow divider alarm '
      DIS_AT_BIT_SET_STRING(62) = 'SET       '
      DIS_AT_BIT_CLR_STRING(62) = 'CLEAR     '
      DIS_AL_PAGE(62)           = 5
      DIS_AL_LINE(62)           = 8
      DIS_AL_COLUMN(62)         = 2
      DIS_AL_SEVERITY(62)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(63)    = 'Az oil flow divider alarm '
      DIS_AT_BIT_SET_STRING(63) = 'SET       '
      DIS_AT_BIT_CLR_STRING(63) = 'CLEAR     '
      DIS_AL_PAGE(63)           = 5
      DIS_AL_LINE(63)           = 9
      DIS_AL_COLUMN(63)         = 2
      DIS_AL_SEVERITY(63)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(64)    = 'Nitrogen pressure         '
      DIS_AT_BIT_SET_STRING(64) = 'LOW       '
      DIS_AT_BIT_CLR_STRING(64) = 'NORMAL    '
      DIS_AL_PAGE(64)           = 5
      DIS_AL_LINE(64)           = 4
      DIS_AL_COLUMN(64)         = 42
      DIS_AL_SEVERITY(64)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(65)    = 'Mirror height             '
      DIS_AT_BIT_SET_STRING(65) = 'HIGH      '
      DIS_AT_BIT_CLR_STRING(65) = 'NORMAL    '
      DIS_AL_PAGE(65)           = 5
      DIS_AL_LINE(65)           = 6
      DIS_AL_COLUMN(65)         = 42
      DIS_AL_SEVERITY(65)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(66)    = 'Mains alarm               '
      DIS_AT_BIT_SET_STRING(66) = 'SET       '
      DIS_AT_BIT_CLR_STRING(66) = 'CLEAR     '
      DIS_AL_PAGE(66)           = 5
      DIS_AL_LINE(66)           = 1
      DIS_AL_COLUMN(66)         = 42
      DIS_AL_SEVERITY(66)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(67)    = 'Wind alarm                '
      DIS_AT_BIT_SET_STRING(67) = 'SET       '
      DIS_AT_BIT_CLR_STRING(67) = 'CLEAR     '
      DIS_AL_PAGE(67)           = 0
      DIS_AL_LINE(67)           = 11
      DIS_AL_COLUMN(67)         = 2
      DIS_AL_SEVERITY(67)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(68)    = 'Rain alarm                '
      DIS_AT_BIT_SET_STRING(68) = 'SET       '
      DIS_AT_BIT_CLR_STRING(68) = 'CLEAR     '
      DIS_AL_PAGE(68)           = 0
      DIS_AL_LINE(68)           = 11
      DIS_AL_COLUMN(68)         = 42
      DIS_AL_SEVERITY(68)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(69)    = 'Ice alarm                 '
      DIS_AT_BIT_SET_STRING(69) = 'SET       '
      DIS_AT_BIT_CLR_STRING(69) = 'CLEAR     '
      DIS_AL_PAGE(69)           = 0
      DIS_AL_LINE(69)           = 12
      DIS_AL_COLUMN(69)         = 2
      DIS_AL_SEVERITY(69)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(70)    = 'Dust alarm                '
      DIS_AT_BIT_SET_STRING(70) = 'SET       '
      DIS_AT_BIT_CLR_STRING(70) = 'CLEAR     '
      DIS_AL_PAGE(70)           = 0
      DIS_AL_LINE(70)           = 12
      DIS_AL_COLUMN(70)         = 42
      DIS_AL_SEVERITY(70)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(71)    = 'UES TT,  -ve limit        '
      DIS_AT_BIT_SET_STRING(71) = 'CLEAR     '
      DIS_AT_BIT_CLR_STRING(71) = 'SET       '
      DIS_AL_PAGE(71)           = 4
      DIS_AL_LINE(71)           = 16
      DIS_AL_COLUMN(71)         = 2
      DIS_AL_SEVERITY(71)       = 0
      DIS_AT_STATUS_NAME(72)    = 'UES TT,  +ve limit        '
      DIS_AT_BIT_SET_STRING(72) = 'CLEAR     '
      DIS_AT_BIT_CLR_STRING(72) = 'SET       '
      DIS_AL_PAGE(72)           = 4
      DIS_AL_LINE(72)           = 16
      DIS_AL_COLUMN(72)         = 42
      DIS_AL_SEVERITY(72)       = 0
      DIS_AT_STATUS_NAME(73)    = 'GHRIL TT,  -ve limit      '
      DIS_AT_BIT_SET_STRING(73) = 'CLEAR     '
      DIS_AT_BIT_CLR_STRING(73) = 'SET       '
      DIS_AL_PAGE(73)           = 4
      DIS_AL_LINE(73)           = 17
      DIS_AL_COLUMN(73)         = 2
      DIS_AL_SEVERITY(73)       = 0
      DIS_AT_STATUS_NAME(74)    = 'GHRIL TT,  +ve limit      '
      DIS_AT_BIT_SET_STRING(74) = 'CLEAR     '
      DIS_AT_BIT_CLR_STRING(74) = 'SET       '
      DIS_AL_PAGE(74)           = 4
      DIS_AL_LINE(74)           = 17
      DIS_AL_COLUMN(74)         = 42
      DIS_AL_SEVERITY(74)       = 0
      DIS_AT_STATUS_NAME(75)    = 'Azimuth zone              '
      DIS_AT_BIT_SET_STRING(75) = 'YELLOW    '
      DIS_AT_BIT_CLR_STRING(75) = 'RED       '
      DIS_AL_PAGE(75)           = 6
      DIS_AL_LINE(75)           = 18
      DIS_AL_COLUMN(75)         = 2
      DIS_AL_SEVERITY(75)       = SMG$M_BOLD
      DIS_AT_STATUS_NAME(76)    = 'Nasmyth Gate              '
      DIS_AT_BIT_SET_STRING(76) = 'OPEN      '
      DIS_AT_BIT_CLR_STRING(76) = 'NOT OPEN  '
      DIS_AL_PAGE(76)           = 5
      DIS_AL_LINE(76)           = 14
      DIS_AL_COLUMN(76)         = 42
      DIS_AL_SEVERITY(76)       = SMG$M_REVERSE
      DIS_AT_STATUS_NAME(77)    = 'Dome emergency stop       '
      DIS_AT_BIT_SET_STRING(77) = 'SET       '
      DIS_AT_BIT_CLR_STRING(77) = 'CLEAR     '
      DIS_AL_PAGE(77)           = 5
      DIS_AL_LINE(77)           = 15
      DIS_AL_COLUMN(77)         = 2
      DIS_AL_SEVERITY(77)       = SMG$M_REVERSE
*                                           
* Cosine elements of RA_DEC structures
*
      DIS_GR_POS_2000.RA.COS  = 1D0
      DIS_GR_POS_2000.DEC.COS = 1D0
      DIS_GR_POS_1950.RA.COS  = 1D0
      DIS_GR_POS_1950.DEC.COS = 1D0
      DIS_GR_POS_USER.RA.COS  = 1D0
      DIS_GR_POS_USER.DEC.COS = 1D0
*
* Display coords
*
      DIS_GL_COORDSYS = DIS_K_USER
*
*==============================================================================*
*
* Encoder data global section (_ENCGSD.INC, ENCODERS)
* ---------------------------------------------------
*
      ENC_GL_ENC_TOT          = 21
      ENC_GL_SENS_TOT         = 11
*
* Encoder control variables
*
      ENC_AT_ENC_NAME(1)      = 'Elevation Absolute    '
      ENC_AT_ENC_KEYW(1)      = 'ABS'
      ENC_AB_ABSOLUTE(1)      = .TRUE.
      ENC_AL_UNIT(1)          = DIS_K_DMSF
      ENC_AL_PAGE(1)          = 2
      ENC_AL_LINE(1)          = 11
      ENC_AL_COLUMN(1)        = 2
      ENC_AB_ENABLED(1)       = .TRUE.
      ENC_AB_TRACKABLE(1,1)   = .FALSE.
      ENC_AB_IN_USE(1)        = .FALSE.
      ENC_AT_ENC_NAME(2)      = 'Azimuth Absolute      '
      ENC_AT_ENC_KEYW(2)      = 'ABS'
      ENC_AB_ABSOLUTE(2)      = .TRUE.
      ENC_AL_UNIT(2)          = DIS_K_DMSF
      ENC_AL_PAGE(2)          = 2
      ENC_AL_LINE(2)          = 3
      ENC_AL_COLUMN(2)        = 2
      ENC_AB_ENABLED(2)       = .TRUE.
      ENC_AB_TRACKABLE(2,1)   = .FALSE.
      ENC_AB_IN_USE(2)        = .FALSE.
      ENC_AT_ENC_NAME(3)      = 'Cassegrain Absolute   '
      ENC_AT_ENC_KEYW(3)      = 'ABS'
      ENC_AB_ABSOLUTE(3)      = .TRUE.
      ENC_AL_UNIT(3)          = DIS_K_DMS
      ENC_AL_PAGE(3)          = 2
      ENC_AL_LINE(3)          = 3
      ENC_AL_COLUMN(3)        = 42
      ENC_AB_ENABLED(3)       = .TRUE.
      ENC_AB_IN_USE(3)        = .FALSE.
      ENC_AT_ENC_NAME(4)      = 'Prime Focus Absolute  '
      ENC_AT_ENC_KEYW(4)      = 'ABS'
      ENC_AB_ABSOLUTE(4)      = .TRUE.
      ENC_AL_UNIT(4)          = DIS_K_DMS
      ENC_AL_PAGE(4)          = 2
      ENC_AL_LINE(4)          = 6
      ENC_AL_COLUMN(4)        = 42
      ENC_AB_ENABLED(4)       = .TRUE.
      ENC_AB_IN_USE(4)        = .FALSE.
      ENC_AT_ENC_NAME(5)      = 'GHRIL Absolute        '
      ENC_AT_ENC_KEYW(5)      = 'ABS'
      ENC_AB_ABSOLUTE(5)      = .TRUE.
      ENC_AL_UNIT(5)          = DIS_K_DMS
      ENC_AL_PAGE(5)          = 2
      ENC_AL_LINE(5)          = 12
      ENC_AL_COLUMN(5)        = 42
      ENC_AB_ENABLED(5)       = .TRUE.
      ENC_AB_IN_USE(5)        = .FALSE.
      ENC_AT_ENC_NAME(6)      = 'UES Absolute          '
      ENC_AT_ENC_KEYW(6)      = 'ABS'
      ENC_AB_ABSOLUTE(6)      = .TRUE.
      ENC_AL_UNIT(6)          = DIS_K_DMS
      ENC_AL_PAGE(6)          = 2
      ENC_AL_LINE(6)          = 9
      ENC_AL_COLUMN(6)        = 42
      ENC_AB_ENABLED(6)       = .TRUE.
      ENC_AB_IN_USE(6)        = .FALSE.
      ENC_AT_ENC_NAME(7)      = 'Elevation Gear        '
      ENC_AT_ENC_KEYW(7)      = 'GEAR'
      ENC_AB_ABSOLUTE(7)      = .FALSE.
      ENC_AL_UNIT(7)          = DIS_K_DMSF
      ENC_AL_PAGE(7)          = 2
      ENC_AL_LINE(7)          = 12
      ENC_AL_COLUMN(7)        = 2
      ENC_AB_ENABLED(7)       = .TRUE.
      ENC_AB_TRACKABLE(7,1)   = .TRUE.
      ENC_AB_IN_USE(7)        = .TRUE.
      ENC_AT_ENC_NAME(8)      = 'Elevation Roller      '
      ENC_AT_ENC_KEYW(8)      = 'ROLL'
      ENC_AB_ABSOLUTE(8)      = .FALSE.
      ENC_AL_UNIT(8)          = DIS_K_DMSF
      ENC_AL_PAGE(8)          = 2
      ENC_AL_LINE(8)          = 13
      ENC_AL_COLUMN(8)        = 2
      ENC_AB_ENABLED(8)       = .TRUE.
      ENC_AB_TRACKABLE(8,1)   = .TRUE.
      ENC_AB_IN_USE(8)        = .FALSE.
      ENC_AT_ENC_NAME(9)      = 'Azimuth Gear          '
      ENC_AT_ENC_KEYW(9)      = 'GEAR'
      ENC_AB_ABSOLUTE(9)      = .FALSE.
      ENC_AL_UNIT(9)          = DIS_K_DMSF
      ENC_AL_PAGE(9)          = 2
      ENC_AL_LINE(9)          = 4
      ENC_AL_COLUMN(9)        = 2
      ENC_AB_ENABLED(9)       = .TRUE.
      ENC_AB_TRACKABLE(9,1)   = .TRUE.
      ENC_AB_IN_USE(9)        = .TRUE.
      ENC_AT_ENC_NAME(10)     = 'Azimuth Roller        '
      ENC_AT_ENC_KEYW(10)     = 'ROLL'
      ENC_AB_ABSOLUTE(10)     = .FALSE.
      ENC_AL_UNIT(10)         = DIS_K_DMSF
      ENC_AL_PAGE(10)         = 2
      ENC_AL_LINE(10)         = 5
      ENC_AL_COLUMN(10)       = 2
      ENC_AB_ENABLED(10)      = .TRUE.
      ENC_AB_TRACKABLE(10,1)  = .FALSE.
      ENC_AB_IN_USE(10)       = .FALSE.
      ENC_AT_ENC_NAME(11)     = 'Azimuth Tape 1        '
      ENC_AT_ENC_KEYW(11)     = 'TAPE1'
      ENC_AB_ABSOLUTE(11)     = .FALSE.
      ENC_AL_UNIT(11)         = DIS_K_DMSF
      ENC_AL_PAGE(11)         = 2
      ENC_AL_LINE(11)         = 6
      ENC_AL_COLUMN(11)       = 2
      ENC_AB_ENABLED(11)      = .TRUE.
      ENC_AB_TRACKABLE(11,1)  = .TRUE.
      ENC_AB_IN_USE(11)       = .FALSE.
      ENC_AT_ENC_NAME(12)     = 'Azimuth Tape 2        '
      ENC_AT_ENC_KEYW(12)     = 'TAPE2'
      ENC_AB_ABSOLUTE(12)     = .FALSE.
      ENC_AL_UNIT(12)         = DIS_K_DMSF
      ENC_AL_PAGE(12)         = 2
      ENC_AL_LINE(12)         = 7
      ENC_AL_COLUMN(12)       = 2
      ENC_AB_ENABLED(12)      = .TRUE.
      ENC_AB_TRACKABLE(12,1)  = .TRUE.
      ENC_AB_IN_USE(12)       = .FALSE.
      ENC_AT_ENC_NAME(13)     = 'Azimuth Tape 3        '
      ENC_AT_ENC_KEYW(13)     = 'TAPE3'
      ENC_AB_ABSOLUTE(13)     = .FALSE.
      ENC_AL_UNIT(13)         = DIS_K_DMSF
      ENC_AL_PAGE(13)         = 2
      ENC_AL_LINE(13)         = 8
      ENC_AL_COLUMN(13)       = 2
      ENC_AB_ENABLED(13)      = .TRUE.
      ENC_AB_TRACKABLE(13,1)  = .TRUE.
      ENC_AB_IN_USE(13)       = .FALSE.
      ENC_AT_ENC_NAME(14)     = 'Azimuth Tape 4        '
      ENC_AT_ENC_KEYW(14)     = 'TAPE4'
      ENC_AB_ABSOLUTE(14)     = .FALSE.
      ENC_AL_UNIT(14)         = DIS_K_DMSF
      ENC_AL_PAGE(14)         = 2
      ENC_AL_LINE(14)         = 9
      ENC_AL_COLUMN(14)       = 2
      ENC_AB_ENABLED(14)      = .TRUE.
      ENC_AB_TRACKABLE(14,1)  = .TRUE.
      ENC_AB_IN_USE(14)       = .FALSE.
      ENC_AT_ENC_NAME(15)     = 'Cass Incremental      '
      ENC_AT_ENC_KEYW(15)     = 'INC'
      ENC_AB_ABSOLUTE(15)     = .FALSE.
      ENC_AL_UNIT(15)         = DIS_K_DMS
      ENC_AL_PAGE(15)         = 2
      ENC_AL_LINE(15)         = 4
      ENC_AL_COLUMN(15)       = 42
      ENC_AB_ENABLED(15)      = .TRUE.
      ENC_AB_IN_USE(15)       = .TRUE.
      ENC_AT_ENC_NAME(16)     = 'Prime Incremental     '
      ENC_AT_ENC_KEYW(16)     = 'INC'
      ENC_AB_ABSOLUTE(16)     = .FALSE.
      ENC_AL_UNIT(16)         = DIS_K_DMS
      ENC_AL_PAGE(16)         = 2
      ENC_AL_LINE(16)         = 7
      ENC_AL_COLUMN(16)       = 42
      ENC_AB_ENABLED(16)      = .TRUE.
      ENC_AB_IN_USE(16)       = .TRUE.
      ENC_AT_ENC_NAME(17)     = 'GHRIL Incremental     '
      ENC_AT_ENC_KEYW(17)     = 'INC'
      ENC_AB_ABSOLUTE(17)     = .FALSE.
      ENC_AL_UNIT(17)         = DIS_K_DMS
      ENC_AL_PAGE(17)         = 2
      ENC_AL_LINE(17)         = 13
      ENC_AL_COLUMN(17)       = 42
      ENC_AB_ENABLED(17)      = .TRUE.
      ENC_AB_IN_USE(17)       = .TRUE.
      ENC_AT_ENC_NAME(18)     = 'UES Incremental       '
      ENC_AT_ENC_KEYW(18)     = 'INC'
      ENC_AB_ABSOLUTE(18)     = .FALSE.
      ENC_AL_UNIT(18)         = DIS_K_DMS
      ENC_AL_PAGE(18)         = 2
      ENC_AL_LINE(18)         = 10
      ENC_AL_COLUMN(18)       = 42
      ENC_AB_ENABLED(18)      = .TRUE.
      ENC_AB_IN_USE(18)       = .TRUE.
      ENC_AT_ENC_NAME(19)     = 'Focus Absolute        '
      ENC_AT_ENC_KEYW(19)     = 'ABS'
      ENC_AB_ABSOLUTE(19)     = .TRUE.
      ENC_AL_UNIT(19)         = DIS_K_MM
      ENC_AL_PAGE(19)         = 2
      ENC_AL_LINE(19)         = 18
      ENC_AL_COLUMN(19)       = 2
      ENC_AB_ENABLED(19)      = .TRUE.
      ENC_AB_IN_USE(19)       = .TRUE.
      ENC_AT_ENC_NAME(20)     = 'Dome Absolute         '
      ENC_AT_ENC_KEYW(20)     = 'ABS'
      ENC_AB_ABSOLUTE(20)     = .TRUE.
      ENC_AL_UNIT(20)         = DIS_K_DM
      ENC_AL_PAGE(20)         = 2
      ENC_AL_LINE(20)         = 16
      ENC_AL_COLUMN(20)       = 2
      ENC_AB_ENABLED(20)      = .TRUE.
      ENC_AB_IN_USE(20)       = .FALSE.
      ENC_AT_ENC_NAME(21)     = 'Mirror Cover ADC      '
      ENC_AT_ENC_KEYW(21)     = 'ADC'
      ENC_AB_ABSOLUTE(21)     = .FALSE.
      ENC_AL_UNIT(21)         = DIS_K_TEMP
      ENC_AL_PAGE(21)         = 2
      ENC_AL_LINE(21)         = 20
      ENC_AL_COLUMN(21)       = 2
      ENC_AB_ENABLED(21)      = .TRUE.
      ENC_AB_IN_USE(21)       = .FALSE.
*
* Sensor data
*
      ENC_AT_SENS_NAME(1)     = 'GHRIL Up Truss Temp '
      ENC_AT_SENS_NAME(2)     = 'UES Up Truss Temp   '
      ENC_AT_SENS_NAME(3)     = 'Lower Truss Temp    '
      ENC_AT_SENS_NAME(4)     = 'Top end ring Temp   '
      ENC_AT_SENS_NAME(5)     = 'Horiz Displacement 1'
      ENC_AT_SENS_NAME(6)     = 'Horiz Displacement 2'
      ENC_AT_SENS_NAME(7)     = 'Horiz Displacement 3'
      ENC_AT_SENS_NAME(8)     = 'Horiz Displacement 4'
      ENC_AT_SENS_NAME(9)     = 'Secondary Position 1'
      ENC_AT_SENS_NAME(10)    = 'Secondary Position 2'
      ENC_AT_SENS_NAME(11)    = 'Secondary Position 3'
      ENC_AT_SENS_KEYW(1)     = 'TEMP_C'
      ENC_AT_SENS_KEYW(2)     = 'TEMP_D'
      ENC_AT_SENS_KEYW(3)     = 'TEMP_LOW'
      ENC_AT_SENS_KEYW(4)     = 'TEMP_TOP'
      ENC_AT_SENS_KEYW(5)     = 'HORDIS1'
      ENC_AT_SENS_KEYW(6)     = 'HORDIS2'
      ENC_AT_SENS_KEYW(7)     = 'HORDIS3'
      ENC_AT_SENS_KEYW(8)     = 'HORDIS4'
      ENC_AT_SENS_KEYW(9)     = 'SECPOS1'
      ENC_AT_SENS_KEYW(10)    = 'SECPOS2'
      ENC_AT_SENS_KEYW(11)    = 'SECPOS3'
      ENC_AL_SENS_UNIT(1)     = DIS_K_TEMP
      ENC_AL_SENS_UNIT(2)     = DIS_K_TEMP
      ENC_AL_SENS_UNIT(3)     = DIS_K_TEMP
      ENC_AL_SENS_UNIT(4)     = DIS_K_TEMP
      ENC_AL_SENS_UNIT(5)     = DIS_K_INT
      ENC_AL_SENS_UNIT(6)     = DIS_K_INT
      ENC_AL_SENS_UNIT(7)     = DIS_K_INT
      ENC_AL_SENS_UNIT(8)     = DIS_K_INT
      ENC_AL_SENS_UNIT(9)     = DIS_K_INT
      ENC_AL_SENS_UNIT(10)    = DIS_K_INT
      ENC_AL_SENS_UNIT(11)    = DIS_K_INT
      ENC_AL_SENS_PAGE(1)     = 3
      ENC_AL_SENS_PAGE(2)     = 3
      ENC_AL_SENS_PAGE(3)     = 3
      ENC_AL_SENS_PAGE(4)     = 3
      ENC_AL_SENS_PAGE(5)     = 3
      ENC_AL_SENS_PAGE(6)     = 3
      ENC_AL_SENS_PAGE(7)     = 3
      ENC_AL_SENS_PAGE(8)     = 3
      ENC_AL_SENS_PAGE(9)     = 3
      ENC_AL_SENS_PAGE(10)    = 3
      ENC_AL_SENS_PAGE(11)    = 3
      ENC_AL_SENS_LINE(1)     = 1
      ENC_AL_SENS_LINE(2)     = 2
      ENC_AL_SENS_LINE(3)     = 3
      ENC_AL_SENS_LINE(4)     = 4
      ENC_AL_SENS_LINE(5)     = 1
      ENC_AL_SENS_LINE(6)     = 2
      ENC_AL_SENS_LINE(7)     = 3
      ENC_AL_SENS_LINE(8)     = 4
      ENC_AL_SENS_LINE(9)     = 6
      ENC_AL_SENS_LINE(10)    = 7
      ENC_AL_SENS_LINE(11)    = 8
      ENC_AL_SENS_COL(1)      = 42
      ENC_AL_SENS_COL(2)      = 42
      ENC_AL_SENS_COL(3)      = 42
      ENC_AL_SENS_COL(4)      = 42
      ENC_AL_SENS_COL(5)      = 2
      ENC_AL_SENS_COL(6)      = 2
      ENC_AL_SENS_COL(7)      = 2
      ENC_AL_SENS_COL(8)      = 2
      ENC_AL_SENS_COL(9)      = 2
      ENC_AL_SENS_COL(10)     = 2
      ENC_AL_SENS_COL(11)     = 2
      ENC_AD_SENS_FACT(1)     =  5.04D-2         ! Upper Serrurier truss
      ENC_AD_SENS_FACT(2)     =  5.22D-2         ! temperature sensors
      ENC_AD_SENS_FACT(3)     =  5.195D-2        ! Lower serrurier temp
      ENC_AD_SENS_FACT(4)     =  5.195D-2        ! Top end ring temp
      ENC_AD_SENS_FACT(5)     =  7.3278D-2       ! Horiz 1 micron/bit
      ENC_AD_SENS_FACT(6)     =  7.3278D-2       ! Horiz 2 micron/bit
      ENC_AD_SENS_FACT(7)     =  7.3278D-2       ! Horiz 3 micron/bit
      ENC_AD_SENS_FACT(8)     =  7.3278D-2       ! Horiz 4 micron/bit
      ENC_AD_SENS_FACT(9)     =  4.8852D-2       ! Secondary sensor 1
      ENC_AD_SENS_FACT(10)    =  4.8852D-2       !                  2
      ENC_AD_SENS_FACT(11)    =  4.8852D-2       !                  3
      ENC_AD_SENS_ZPT(1)      = -5.174D1         ! Sep 28th 1988
      ENC_AD_SENS_ZPT(2)      = -5.368D1         ! Sep 28th 1988
      ENC_AD_SENS_ZPT(3)      = -5.3291D1        ! Aug 6th 1988
      ENC_AD_SENS_ZPT(4)      = -5.3291D1        ! Aug 6th 1988
*
      ENC_GR_SCALE.COARSE  =  2.454369261D-2  ! Main axes coarse encoder scale
      ENC_GR_SCALE.FINE    =  2.354044177D-6  ! Main axes fine encoder scale
*
* Absolute encoder ranging constants (bits)
*
      ENC_AL_RANGER(1)  =  23                 ! Altitude coarse
      ENC_AL_RANGER(2)  =  178                ! Azimuth coarse
*
* Fine absolute encoder zero-points (rad)
*
      ENC_GD_FINE_ZP(1)  = -2.6068443D-3      ! Altitude
      ENC_GD_FINE_ZP(2)  =  1.038301D-1       ! Azimuth
*
* Encoder/ADC scale factors: labelling as above (rad/bit)
*  Absolute
*
      ENC_AD_FACTOR(1)   =  2.354044177D-6     ! Altitude fine
      ENC_AD_FACTOR(2)   =  2.354044177D-6     ! Azimuth fine
      ENC_AD_FACTOR(3)   = -1.307060553D-3     ! Cassegrain turntable
      ENC_AD_FACTOR(4)   = -24.33894231*AS2RAD ! Prime focus
      ENC_AD_FACTOR(5)   = -158.2417582*AS2RAD ! GHRIL
      ENC_AD_FACTOR(6)   = -158.2417582*AS2RAD ! UES
      ENC_AD_FACTOR(19)  =  0.003D0            ! Focus
      ENC_AD_FACTOR(20)  = -6.1359D-3          ! Dome   
      ENC_AD_FACTOR(21)  =  6.1359D-3          ! Shutter
      ENC_AD_FACTOR(22)  =  6.1359D-3          ! Windshield
      ENC_AD_FACTOR(23)  = -4.9432D-2          ! Mirror cover
*
* Incremental
*
      ENC_AD_FACTOR(7)   = -1.453968463D-7     ! Altitude gear 
      ENC_AD_FACTOR(8)   = -1.460515759D-7     ! Altitude roller
      ENC_AD_FACTOR(9)   =  1.453968463D-7     ! Azimuth gear
      ENC_AD_FACTOR(10)  =  4.026204143D-8     ! Azimuth mean tape
      ENC_AD_FACTOR(11)  =  4.026204143D-8     ! Az tape hd 1
      ENC_AD_FACTOR(12)  =  4.026204143D-8     ! Az tape hd 2
      ENC_AD_FACTOR(13)  =  4.026204143D-8     ! Az tape hd 3
      ENC_AD_FACTOR(14)  =  4.026204143D-8     ! Az tape hd 4
      ENC_AD_FACTOR(15)  =  1.673037508D-5     ! Cassegrain turntable
      ENC_AD_FACTOR(16)  =  2.416609733D-5     ! Prime turntable
      ENC_AD_FACTOR(17)  =  2.416609733D-5     ! Nasmyth GHRIL turntable
      ENC_AD_FACTOR(18)  =  2.416609733D-5     ! Nasmyth UES turntable
*
* Encoder/ADC zero-points: labelling as above
*
      ENC_AD_ZEROPT(3)    =   4.5709D0       ! 17-Jan-1995 JMB
      ENC_AD_ZEROPT(4)    =   3.4067D0       ! AF2 1-Nov-1996
      ENC_AD_ZEROPT(5)    =   5.75           ! May 2nd 1994 mf
      ENC_AD_ZEROPT(6)    =   0.4257         ! May 25th 1988
      ENC_AD_ZEROPT(20)   =   2.1002         ! August 10th 1987
      ENC_AD_ZEROPT(21)   =  1.0119D2        ! Aug 6th 1988
*
*
* Azimuth wrap (default range includes the unambiguous part of the travel)
*                                              
      ENC_GL_AZ_WRAP      = 0
*
      ENC_GB_LOGGING      = .FALSE.          ! Logging of encoder readings
      ENC_GL_LOG_PERIOD   = 20               ! 1 second default
*
* Encoder model parameters
*
* Introduce two sawtooth periods to be applied. Currently 0.4 and 1.09 degrees
* for azimuth.
*
      ENC_AR_MODEL(9).SAW_AMP(1)       =  0D0       ! 0.4 saw amplitude
      ENC_AR_MODEL(9).SAW_PHASE(1, 1)  =  -1.5022D0 ! Sawtooth phase
                                                    ! (increasing Az)
      ENC_AR_MODEL(9).SAW_PHASE(1, 2)  =  -3.8582D0 ! 0.4 saw phase
                                                    ! (decreasing Az)
      ENC_AR_MODEL(9).SAW_PERIOD(1) = 7.01248361D-3 ! 0.4 saw period
*
*  1.09 deg sawtooth amplitude (Azimuth encoder gearbox)
*
      ENC_AR_MODEL(9).SAW_AMP(2)    =  -4.242D-6    ! 1.09 saw amplitude
      ENC_AR_MODEL(9).SAW_PHASE(2, 1)  =  -3.142D0  ! 1.09 saw phase
                                                    ! (increasing Az)
      ENC_AR_MODEL(9).SAW_PHASE(2, 2)  =  -3.142D0  ! 1.09 saw phase
                                                    ! (decreasing Az)
      ENC_AR_MODEL(9).SAW_PERIOD(2) = 1.90574554D-2 ! 1.09 saw period
*    
      ENC_AR_MODEL(9).COS_AMP(1)    = 0D0          
      ENC_AR_MODEL(9).COS_PHASE(1)  = 0D0
      ENC_AR_MODEL(9).COS_PERIOD(1) = 1.54274639D-1 ! 8.8 deg
      ENC_AR_MODEL(9).COS_AMP(2)    = 0D0          
      ENC_AR_MODEL(9).COS_PHASE(2)  = 0D0
      ENC_AR_MODEL(9).COS_PERIOD(2) = 7.71373197D-2 ! 4.4 deg
*
* Transducer scaling
*
      ENC_GD_AZ_MULT(1)   =  0.5D0     ! Transducer corrections applied.
      ENC_GD_AZ_MULT(2)   =  0.5D0     ! Transducer corrections applied.
*
      ENC_GD_D_TO_AZ(1)   = 5.6224D-7  ! rad/micron
      ENC_GD_D_TO_AZ(2)   = -5.6224D-7 
      ENC_GD_D_TO_AZ(3)   =  5.6224D-7
      ENC_GD_D_TO_AZ(4)   = -5.6224D-7
*
* Secondary
*
      DO I = 1,3                               ! Secondary tilt
        ENC_GD_SEC_SCALE(I) = 2.04D-6          ! rad/micron
      ENDDO
*
      ENC_AD_SEC_TRANS2TILT(1,1) = 0D0         ! Conversions between 
      ENC_AD_SEC_TRANS2TILT(1,2) = 0.57735D0   ! sensor reading and
      ENC_AD_SEC_TRANS2TILT(1,3) = -0.57735D0  ! secondary tilt
      ENC_AD_SEC_TRANS2TILT(2,1) = 0.695033D0
      ENC_AD_SEC_TRANS2TILT(2,2) = -0.34752D0
      ENC_AD_SEC_TRANS2TILT(2,3) = -0.34752D0
*
      ENC_GD_SEC_GAIN            =  0.01D0     ! Recursive filter gain
      ENC_GL_TEMP_NSAMP = 12000 ! Number of samples over which to calculate
                                ! temperature running mean for focus comp.
*
*==============================================================================*
*
* Guiding data global section (_GUIGSD.INC, GUIDE)
* ------------------------------------------------
*
* Defaults
*
      GUI_GB_REF_ENABLE    = .TRUE.    ! Enable refraction correction
      GUI_GL_GUIDING       = .FALSE.   ! Start with application of guiding
                                       ! adjustments disabled.
      GUI_GL_LOGGING       = .FALSE.   ! Logging of autoguider errors disabled
      GUI_GL_AUTOGUIDER    = 1         ! Default Cass focus
      GUI_GD_WAVELENGTH    = 0.6D0     ! Microns
*
* Total number of defined autoguiders
*
      GUI_GL_TOT      = 8
*
* Autoguider names
*
      GUI_AT_NAME(1)  = 'CASSEGRAIN'
      GUI_AT_NAME(2)  = 'UES slit viewer'
      GUI_AT_NAME(3)  = 'UES probe'
      GUI_AT_NAME(4)  = 'PRIME'
      GUI_AT_NAME(5)  = 'AF2 fixed probe'
      GUI_AT_NAME(6)  = 'AF2 moving probe'
      GUI_AT_NAME(7)  = 'WHIRCAM'
      GUI_AT_NAME(8)  = 'Integral'
*
* Autoguider keywords
*
      GUI_AT_KEYW(1)  = 'CASSEGRAIN'
      GUI_AT_KEYW(2)  = 'UESSLIT'
      GUI_AT_KEYW(3)  = 'UESPROBE'
      GUI_AT_KEYW(4)  = 'PRIME'
      GUI_AT_KEYW(5)  = 'AF2_FIXED'
      GUI_AT_KEYW(6)  = 'AF2_MOVING'
      GUI_AT_KEYW(7)  = 'WHIRCAM'
      GUI_AT_KEYW(8)  = 'INTEGRAL'
*
* Autoguider movable
*
      GUI_AB_MOVE(1)  = .TRUE.
      GUI_AB_MOVE(2)  = .FALSE.
      GUI_AB_MOVE(3)  = .TRUE.
      GUI_AB_MOVE(4)  = .TRUE.
      GUI_AB_MOVE(5)  = .FALSE.
      GUI_AB_MOVE(6)  = .TRUE.
      GUI_AB_MOVE(7)  = .FALSE.
      GUI_AB_MOVE(8)  = .TRUE.
*
* Autoguider timeout
*
      GUI_GL_TIMEOUT = 3
*
* Individual autoguider geometry and loop control parameters
*
* Loop gains (.XI for Azimuth; .ETA for Elevation)
*
      GUI_GR_LOOP_GAIN(1).XI  = 0.3
      GUI_GR_LOOP_GAIN(1).ETA = 0.3
      GUI_GR_LOOP_GAIN(2).XI  = 0.3
      GUI_GR_LOOP_GAIN(2).ETA = 0.3
      GUI_GR_LOOP_GAIN(3).XI  = 0.3
      GUI_GR_LOOP_GAIN(3).ETA = 0.3
      GUI_GR_LOOP_GAIN(4).XI  = 0.25
      GUI_GR_LOOP_GAIN(4).ETA = 0.25
      GUI_GR_LOOP_GAIN(5).XI  = 0.3            ! 11-Oct-1994
      GUI_GR_LOOP_GAIN(5).ETA = 0.3            ! 11-Oct-1994
      GUI_GR_LOOP_GAIN(6).XI  = 0.3            ! 11-Oct-1994
      GUI_GR_LOOP_GAIN(6).ETA = 0.3            ! 11-Oct-1994
      GUI_GR_LOOP_GAIN(7).XI  = 0.3
      GUI_GR_LOOP_GAIN(7).ETA = 0.3
      GUI_GR_LOOP_GAIN(8).XI  = 0.3
      GUI_GR_LOOP_GAIN(8).ETA = 0.3
*
* Maximum guiding offset allowed per cycle
*
      GUI_GR_MAX_OFFSET(1).X  = 30.0
      GUI_GR_MAX_OFFSET(1).Y  = 30.0
      GUI_GR_MAX_OFFSET(2).X  = 30.0
      GUI_GR_MAX_OFFSET(2).Y  = 30.0
      GUI_GR_MAX_OFFSET(3).X  = 30.0
      GUI_GR_MAX_OFFSET(3).Y  = 30.0
      GUI_GR_MAX_OFFSET(4).X  = 30.0
      GUI_GR_MAX_OFFSET(4).Y  = 30.0
      GUI_GR_MAX_OFFSET(5).X  = 30.0           ! 11-Oct-1994
      GUI_GR_MAX_OFFSET(5).Y  = 30.0           ! 11-Oct-1994
      GUI_GR_MAX_OFFSET(6).X  = 30.0           ! 11-Oct-1994
      GUI_GR_MAX_OFFSET(6).Y  = 30.0           ! 11-Oct-1994
      GUI_GR_MAX_OFFSET(7).X  = 30.0
      GUI_GR_MAX_OFFSET(7).Y  = 30.0
      GUI_GR_MAX_OFFSET(8).X  = 30.0
      GUI_GR_MAX_OFFSET(8).Y  = 30.0
*
* Lost guiding radius (pixels)
*
      GUI_GL_GUIDE_RAD(1)     = 100
      GUI_GL_GUIDE_RAD(2)     = 100
      GUI_GL_GUIDE_RAD(3)     = 100
      GUI_GL_GUIDE_RAD(4)     = 100
      GUI_GL_GUIDE_RAD(5)     = 100            ! 11-Oct-1994
      GUI_GL_GUIDE_RAD(6)     = 100            ! 11-Oct-1994
      GUI_GL_GUIDE_RAD(7)     = 100
      GUI_GL_GUIDE_RAD(8)     = 100
*
* Allowed pixel ranges
*
      GUI_GD_PIXEL_XMIN(1)    = 32.0
      GUI_GD_PIXEL_YMIN(1)    = 20.0
      GUI_GD_PIXEL_XMAX(1)    = 374.0
      GUI_GD_PIXEL_YMAX(1)    = 267.0
      GUI_GD_PIXEL_XMIN(3)    = 213.0          ! 19-Sep-1994
      GUI_GD_PIXEL_YMIN(3)    = 86.0           ! 19-Sep-1994 
      GUI_GD_PIXEL_XMAX(3)    = 358.0          ! 19-Sep-1994
      GUI_GD_PIXEL_YMAX(3)    = 244.0          ! 19-Sep-1994
      GUI_GD_PIXEL_XMIN(2)    = 29.0           ! 19-Sep-1994
      GUI_GD_PIXEL_YMIN(2)    = 87.0           ! 19-Sep-1994
      GUI_GD_PIXEL_XMAX(2)    = 176.0          ! 19-Sep-1994
      GUI_GD_PIXEL_YMAX(2)    = 240.0          ! 19-Sep-1994
      GUI_GD_PIXEL_XMIN(4)    = 172.0
      GUI_GD_PIXEL_YMIN(4)    = 62.0
      GUI_GD_PIXEL_XMAX(4)    = 306.0
      GUI_GD_PIXEL_YMAX(4)    = 196.0
      GUI_GD_PIXEL_XMIN(5)    = 236.0          ! 12-Oct-1994
      GUI_GD_PIXEL_YMIN(5)    =   5.0          ! 12-Oct-1994
      GUI_GD_PIXEL_XMAX(5)    = 396.0          ! 12-Oct-1994
      GUI_GD_PIXEL_YMAX(5)    = 198.0          ! 12-Oct-1994
      GUI_GD_PIXEL_XMIN(6)    =  22.0          ! 12-Oct-1994
      GUI_GD_PIXEL_YMIN(6)    =   4.0          ! 12-Oct-1994
      GUI_GD_PIXEL_XMAX(6)    = 203.0          ! 12-Oct-1994
      GUI_GD_PIXEL_YMAX(6)    = 209.0          ! 12-Oct-1994
      GUI_GD_PIXEL_XMIN(7)    = 32.0           ! 12-Jun-1995 JMB
      GUI_GD_PIXEL_YMIN(7)    = 20.0           ! 12-Jun-1995 JMB
      GUI_GD_PIXEL_XMAX(7)    = 374.0          ! 12-Jun-1995 JMB
      GUI_GD_PIXEL_YMAX(7)    = 267.0          ! 12-Jun-1995 JMB
      GUI_GD_PIXEL_XMIN(8)    = 32.0
      GUI_GD_PIXEL_YMIN(8)    = 20.0
      GUI_GD_PIXEL_XMAX(8)    = 374.0
      GUI_GD_PIXEL_YMAX(8)    = 267.0
*
* Central pixel
*
      GUI_GR_CHIP_CENTRE(1).X = 203.0
      GUI_GR_CHIP_CENTRE(1).Y = 143.5
      GUI_GR_CHIP_CENTRE(5).X = 316.0          ! 12-Oct-1994
      GUI_GR_CHIP_CENTRE(5).Y = 101.0          ! 12-Oct-1994
      GUI_GR_CHIP_CENTRE(6).X = 112.0          ! 12-Oct-1994
      GUI_GR_CHIP_CENTRE(6).Y = 106.0          ! 12-Oct-1994
      GUI_GR_CHIP_CENTRE(7).X = 203.0          ! 12-Jun-1995 JMB
      GUI_GR_CHIP_CENTRE(7).Y = 143.5          ! 12-Jun-1995 JMB
      GUI_GR_CHIP_CENTRE(8).X = 203.0
      GUI_GR_CHIP_CENTRE(8).Y = 143.5 
*
* Pixel sizes
*
      GUI_GR_PIXEL_SIZE(1).X  = 0.220*AS2RAD
      GUI_GR_PIXEL_SIZE(1).Y  = 0.220*AS2RAD
      GUI_GR_PIXEL_SIZE(2).X  = 0.078*AS2RAD   ! 19-Sep-1994
      GUI_GR_PIXEL_SIZE(2).Y  = 0.078*AS2RAD   ! 19-Sep-1994
      GUI_GR_PIXEL_SIZE(3).X  = 0.078*AS2RAD   ! 19-Sep-1994
      GUI_GR_PIXEL_SIZE(3).Y  = 0.078*AS2RAD   ! 19-Sep-1994
      GUI_GR_PIXEL_SIZE(4).X  = 0.200*AS2RAD 
      GUI_GR_PIXEL_SIZE(4).Y  = 0.200*AS2RAD 
      GUI_GR_PIXEL_SIZE(5).X  = 0.156*AS2RAD   ! 12-Oct-1994
      GUI_GR_PIXEL_SIZE(5).Y  = 0.156*AS2RAD   ! 12-Oct-1994
      GUI_GR_PIXEL_SIZE(6).X  = 0.156*AS2RAD   ! 12-Oct-1994
      GUI_GR_PIXEL_SIZE(6).Y  = 0.156*AS2RAD   ! 12-Oct-1994
      GUI_GR_PIXEL_SIZE(7).X  = 0.194*AS2RAD   ! 26-Apr-1996 JMB
      GUI_GR_PIXEL_SIZE(7).Y  = 0.194*AS2RAD   ! 26-Apr-1996 JMB
      GUI_GR_PIXEL_SIZE(8).X  = 5.7D-7
      GUI_GR_PIXEL_SIZE(8).Y  = 5.7D-7
*
* Sense of rotation of autoguider
*
      GUI_AL_ROTSENSE(1)      = 1
      GUI_AL_ROTSENSE(2)      = 1
      GUI_AL_ROTSENSE(3)      = 1
      GUI_AL_ROTSENSE(4)      = 1
      GUI_AL_ROTSENSE(5)      = 1
      GUI_AL_ROTSENSE(6)      = 1
      GUI_AL_ROTSENSE(7)      = 1
      GUI_AL_ROTSENSE(8)      = 1
*
* Rotation of autoguider detector with respect to focal-plane coordinate
* system
*
      GUI_GD_ROTATION(1)      = 0.0D0
      GUI_GD_ROTATION(2)      = 180.0*DEG2RAD  ! 19-Sep-1994
      GUI_GD_ROTATION(3)      = 180.0*DEG2RAD  ! 19-Sep-1994
      GUI_GD_ROTATION(4)      =  90.0*DEG2RAD + 1.3589
      GUI_GD_ROTATION(5)      = -90.0*DEG2RAD  ! 12-Oct-1994
      GUI_GD_ROTATION(6)      = -90.0*DEG2RAD  ! 12-Oct-1994
      GUI_GD_ROTATION(7)      =   0.0*DEG2RAD  !  5-Sep-1995 JMB
      GUI_GD_ROTATION(8)      = -0.5148
*
* Reversal of autoguider coordinate system
*
      GUI_GL_FLIP(1) = -1 ! LH coordinates
      GUI_GL_FLIP(2) = -1 ! LH coordinates     ! 19-Sep-1994
      GUI_GL_FLIP(3) = -1 ! LH coordinates
      GUI_GL_FLIP(4) =  1 ! RH coordinates
      GUI_GL_FLIP(5) =  1 ! RH coordinates     ! 12-Oct-1994
      GUI_GL_FLIP(6) =  1 ! RH coordinates     ! 12-Oct-1994
      GUI_GL_FLIP(7) =  1 ! RH coordinates     ! 13-Jun-1995 JMB
      GUI_GL_FLIP(8) =  1 ! RH coordinates
*
* Probe geometry variables
*
* r-theta flag (.TRUE. => r-theta; .FALSE. => xy)
*
      GUI_AB_RTHETA(1) = .TRUE.
      GUI_AB_RTHETA(2) = .FALSE.
      GUI_AB_RTHETA(3) = .FALSE.
      GUI_AB_RTHETA(4) = .FALSE.
      GUI_AB_RTHETA(5) = .FALSE.               ! 11-Oct-1994
      GUI_AB_RTHETA(6) = .FALSE.               ! 11-Oct-1994
      GUI_AB_RTHETA(7) = .FALSE.
      GUI_AB_RTHETA(8) = .FALSE.
*
* Probe scaling parameters: r-theta systems
*
      GUI_GD_THETA_OFFSET(1)   = -1.561D-2     ! rad
      GUI_GD_R_OFFSET(1)       = 2.428D-3      ! radial offset
      GUI_GD_R_SCALE(1)        = 2.1865D-8     ! radian/micron
      GUI_GD_THETA_SCALE(1)    = 1.7453D-5     ! radian/millideg
*
* Probe limits: r-theta systems
*
      GUI_GD_PROBE_RMIN(1)     =      0.0      ! Min r (micron)
      GUI_GD_PROBE_RMAX(1)     =  40000.0      ! Max r (micron)
      GUI_GD_PROBE_THETAMIN(1) =      0.0      ! millideg
      GUI_GD_PROBE_THETAMAX(1) = 180000.0      ! millideg
*
* Probe scaling: xy systems
*
      GUI_GR_XYSCALE(2).X      = 1.0D0         ! UES slit viewer: no probe
      GUI_GR_XYSCALE(2).Y      = 1.0D0         ! motion
      GUI_GR_XYSCALE(3).X      = 2.1526D-8     ! UES probe
      GUI_GR_XYSCALE(3).Y      = 2.1526D-8
      GUI_GR_XYSCALE(4).X      = 8.3589D-8     ! Prime
      GUI_GR_XYSCALE(4).Y      = 8.3589D-8
      GUI_GR_XYSCALE(5).X      = 1.0D0         ! af2 fixed: no probe motion
      GUI_GR_XYSCALE(5).Y      = 1.0D0      
      GUI_GR_XYSCALE(6).X      = 4.4074D-8     ! af2 moving
      GUI_GR_XYSCALE(6).Y      = 4.4074D-8   
      GUI_GR_XYSCALE(7).X      = 1.0D0         ! WHIRCAM: no probe motion
      GUI_GR_XYSCALE(7).Y      = 1.0D0
      GUI_GR_XYSCALE(8).X      = 2.1526D-8     ! Integral
      GUI_GR_XYSCALE(8).Y      = 2.1526D-8
*
* Theta is zero for xy systems
*
      GUI_GD_THETA(2) = 0.0D0
      GUI_GD_THETA(3) = 0.0D0
      GUI_GD_THETA(4) = 0.0D0
      GUI_GD_THETA(5) = 0.0D0
      GUI_GD_THETA(6) = 0.0D0
      GUI_GD_THETA(7) = 0.0D0
      GUI_GD_THETA(8) = 0.0D0
*
* XY origin in FP (radians)
*
      GUI_GR_CENTRE(3).X  = -7.6187D-4         ! UES probe
      GUI_GR_CENTRE(3).Y  = -7.3866D-4         ! UES probe
      GUI_GR_CENTRE(6).X  = -495.45*AS2RAD     ! AF2 11-Oct-1994
      GUI_GR_CENTRE(6).Y  =  674.54*AS2RAD     ! AF2 11-Oct-1994
*
* Fixed XY position 
*
      GUI_GD_XYPOS(5).X  = -920.91*AS2RAD      ! AF2 fixed 11-Oct-1994
      GUI_GD_XYPOS(5).Y  =    1.14*AS2RAD      ! AF2 fixed 11-Oct-1994
*
* Probe limits: xy systems
* 
      GUI_GD_PROBE_XMIN(3)    = 0.0
      GUI_GD_PROBE_XMAX(3)    = 73600.0
      GUI_GD_PROBE_YMIN(3)    = 0.0
      GUI_GD_PROBE_YMAX(3)    = 73200.0
      GUI_GD_PROBE_XMIN(4)    = 0.0
      GUI_GD_PROBE_XMAX(4)    = 110000.0
      GUI_GD_PROBE_YMIN(4)    = 0.0
      GUI_GD_PROBE_YMAX(4)    = 20000.0
      GUI_GD_PROBE_XMIN(6)    = -128000.0      ! 11-Oct-1994
      GUI_GD_PROBE_XMAX(6)    =  190000.0      ! 11-Oct-1994
      GUI_GD_PROBE_YMIN(6)    = -180000.0      ! 11-Oct-1994
      GUI_GD_PROBE_YMAX(6)    =  138000.0      ! 11-Oct-1994
      GUI_GD_PROBE_XMIN(8)    = 0.0
      GUI_GD_PROBE_XMAX(8)    = 129467.0
      GUI_GD_PROBE_YMIN(8)    = 0.0
      GUI_GD_PROBE_YMAX(8)    = 25506.0
*
* Handset
*
      GUI_GL_MODE          = GUI_K_XY  ! Default guide mode is to change 
                                     ! reference position in x-y coordinates

*==============================================================================*
*
* Instrument data in global COMMON (_INSGSD.INC, INST)
* ----------------------------------------------------
*
* Total number of defined instruments
*
      INS_GL_TOT      = 11
*
* Instrument names
*
      INS_AT_NAME(1)  = 'ISIS'
      INS_AT_NAME(2)  = 'TAURUS'
      INS_AT_NAME(3)  = 'Manchester Echelle Spectrograph'
      INS_AT_NAME(4)  = 'Durham Polarimeter'
      INS_AT_NAME(5)  = 'Auxiliary port CCD'
      INS_AT_NAME(6)  = 'UES'
      INS_AT_NAME(7)  = 'OWN'
      INS_AT_NAME(8)  = 'LDSS'
      INS_AT_NAME(9)  = 'AUTOFIB'
      INS_AT_NAME(10) = 'Prime focus CCD camera'
      INS_AT_NAME(11) = 'Integral'
*
* Instrument keywords
*
      INS_AT_KEYW(1)  = 'ISIS'
      INS_AT_KEYW(2)  = 'TAURUS'
      INS_AT_KEYW(3)  = 'MES'
      INS_AT_KEYW(4)  = 'DURPOL'
      INS_AT_KEYW(5)  = 'AUXCCD'
      INS_AT_KEYW(6)  = 'UES'
      INS_AT_KEYW(7)  = 'OWN'
      INS_AT_KEYW(8)  = 'LDSS'
      INS_AT_KEYW(9)  = 'AUTOFIB'
      INS_AT_KEYW(10) = 'PFCCD'
      INS_AT_KEYW(11) = 'INTEGRAL'
*
* Default instrument is ISIS
*
      INS_GL_INSTRUMENT = 1
*
* Default focus
*
      INS_AD_DEF_FOCUS(1)  = 97.45D0
      INS_AD_DEF_FOCUS(2)  = 97.45D0
      INS_AD_DEF_FOCUS(3)  = 97.45D0
      INS_AD_DEF_FOCUS(4)  = 97.45D0
      INS_AD_DEF_FOCUS(5)  = 97.45D0
      INS_AD_DEF_FOCUS(6)  = 97.45D0
      INS_AD_DEF_FOCUS(7)  = 97.45D0
      INS_AD_DEF_FOCUS(8)  = 97.45D0
      INS_AD_DEF_FOCUS(9)  = 83.0D0
      INS_AD_DEF_FOCUS(10) = 83.0D0
      INS_AD_DEF_FOCUS(11) = 97.45D0
*
* Instrument rotational offsets
*  ISIS and LDSS offsets reset 24/3/1992 RAL
*
      INS_AD_OFF(1)  = -1.59921D0 ! ISIS -91.6 deg  JMB 17-Jan-1995
      INS_AD_OFF(2)  = 0D0        ! Taurus
      INS_AD_OFF(3)  = -0.8026D0  ! MES (WHIRCAM fixup JMB 21-Nov-1996)*******
      INS_AD_OFF(4)  = 0D0        ! Durham polarimeter
      INS_AD_OFF(5)  = 0D0        ! Auxiliary port CCD
      INS_AD_OFF(6)  = -1.5708D0  ! Utrecht Echelle spectrograph
      INS_AD_OFF(7)  = 0D0        ! GHRIL
      INS_AD_OFF(8)  = -1.60745D0 ! LDSS -92.1 degrees
      INS_AD_OFF(9)  = 0D0        ! Autofib fibre positioner
      INS_AD_OFF(10) = 1.3589D0   ! Prime focus CCD camera
      INS_AD_OFF(11) = -0.5148D0  ! Integral
*
      INS_AD_XY2MOUNT(1)  = 0D0
      INS_AD_XY2MOUNT(2)  = 0D0
      INS_AD_XY2MOUNT(3)  = 0D0
      INS_AD_XY2MOUNT(4)  = 0D0
      INS_AD_XY2MOUNT(5)  = 0D0
      INS_AD_XY2MOUNT(6)  = 0D0
      INS_AD_XY2MOUNT(7)  = 0D0
      INS_AD_XY2MOUNT(8)  = 0D0
      INS_AD_XY2MOUNT(9)  = 0D0
      INS_AD_XY2MOUNT(10) = 1.3589D0   ! PFCCD
      INS_AD_XY2MOUNT(11) = -0.5148D0  ! Integral
*
* Instrument-specific rotator limits
*
      DO I = 1, 10
        INS_AD_ROT_LIMIT(I).IN_USE = .FALSE.
      END DO
      INS_AD_ROT_LIMIT(11).MAX    = 6.2483D0   ! Integral
      INS_AD_ROT_LIMIT(11).MIN    = 0.0524D0
      INS_AD_ROT_LIMIT(11).IN_USE = .TRUE.
*
* Parameters for TWEAK command
* (Initial set-up for ISIS and LDSS only, 
*  TAURUS, MES, DURPOL and AUXCCD added 06-Apr-1992)
*
* Isis
      INS_AR_FPSCALE(1).X = 1D0           ! x scale (arcsec)
      INS_AR_FPSCALE(1).Y = 1D0           ! y scale (arcsec)
      INS_AD_ROTSCALE(1)  = 1D0           ! rotn scale (deg)
      INS_AD_FPROTN(1)    = 0D0           ! Rotn offset (rad)
*
* Taurus
      INS_AR_FPSCALE(2).X = 1D0           ! x scale (arcsec)
      INS_AR_FPSCALE(2).Y = 1D0           ! y scale (arcsec)
      INS_AD_ROTSCALE(2)  = 1D0           ! rotn scale (deg)
      INS_AD_FPROTN(2)    = 0D0           ! Rotn offset (rad)
*
* Manchester Echelle Spectrograph?
      INS_AR_FPSCALE(3).X = 1D0           ! x scale (arcsec)
      INS_AR_FPSCALE(3).Y = 1D0           ! y scale (arcsec)
      INS_AD_ROTSCALE(3)  = 1D0           ! rotn scale (deg)
      INS_AD_FPROTN(3)    = 0D0           ! Rotn offset (rad)
*
* Durham polarimeter
      INS_AR_FPSCALE(4).X = 1D0           ! x scale (arcsec)
      INS_AR_FPSCALE(4).Y = 1D0           ! y scale (arcsec)
      INS_AD_ROTSCALE(4)  = 1D0           ! rotn scale (deg)
      INS_AD_FPROTN(4)    = 0D0           ! Rotn offset (rad)
*
* Auxilary Port CCD
      INS_AR_FPSCALE(5).X = 1D0           ! x scale (arcsec)
      INS_AR_FPSCALE(5).Y = 1D0           ! y scale (arcsec)
      INS_AD_ROTSCALE(5)  = 1D0           ! rotn scale (deg)
      INS_AD_FPROTN(5)    = 0D0           ! Rotn offset (rad)
*
* Durham Low Dispersion Survey Spectrograph
      INS_AR_FPSCALE(8).X = -1D0          ! x scale (arcsec)
      INS_AR_FPSCALE(8).Y = 1D0           ! y scale (arcsec)
      INS_AD_ROTSCALE(8)  = 1D0           ! rotn scale (deg)
      INS_AD_FPROTN(8)    = PIBY2         ! Rotn offset (rad)
*
* Autofib fibre positioner 
      INS_AR_FPSCALE(9).X = 1D0           ! x scale (arcsec)
      INS_AR_FPSCALE(9).Y = 1D0           ! y scale (arcsec)
      INS_AD_ROTSCALE(9)  = 1D0           ! rotn scale (deg)
      INS_AD_FPROTN(9)    = 0D0           ! Rotn offset (rad)
*
* Prime focus CCD
      INS_AR_FPSCALE(10).X = 1D0          ! x scale (arcsec)
      INS_AR_FPSCALE(10).Y = 1D0          ! y scale (arcsec)
      INS_AD_ROTSCALE(10)  = 1D0          ! rotn scale (deg)
      INS_AD_FPROTN(10)    = 0D0          ! Rotn offset (rad)
*
* OWN: user's own instrument
      INS_AR_FPSCALE(7).X  = 1D0          ! x scale (arcsec)
      INS_AR_FPSCALE(7).Y  = 1D0          ! y scale (arcsec)
      INS_AD_ROTSCALE(7)   = 1D0          ! rotn scale (deg)
      INS_AD_FPROTN(7)     = 0D0          ! Rotn offset (rad)
*
* Integral
      INS_AR_FPSCALE(11).X = 1D0          ! x scale (arcsec)
      INS_AR_FPSCALE(11).Y = 1D0          ! y scale (arcsec)
      INS_AD_ROTSCALE(11)  = 1D0          ! rotn scale (deg)
      INS_AD_FPROTN(11)    = 0D0          ! Rotn offset (rad)
*
*==============================================================================*
*
* Mechanism data global section (_MECGSD.INC, MECH)
* -------------------------------------------------
*
      MEC_GL_SERV_TOT = 8
      MEC_GL_AUX_TOT  = 1
      MEC_GL_TOT      = MEC_GL_SERV_TOT + MEC_GL_AUX_TOT
      MEC_GL_ENCTOT   = 7
      MEC_GL_AXIS1    = 1
      MEC_GL_AXIS2    = 2
      MEC_GL_ROT      = 3
      MEC_GL_FOCUS    = 7
      MEC_GL_DOME     = 8
      MEC_GL_MIRRCOV  = 9
      MEC_GL_SHUT1    = 0
      MEC_GL_WINDSH1  = 0
      MEC_GL_NSPEED   = 1
*
* Mechanism names
*
      MEC_AT_NAME(MEC_GL_AXIS1)   = 'Azimuth'
      MEC_AT_NAME(MEC_GL_AXIS2)   = 'Altitude'
      MEC_AT_NAME(3)              = 'Cassegrain rotator'
      MEC_AT_NAME(4)              = 'Prime rotator'
      MEC_AT_NAME(5)              = 'GHRIL rotator'
      MEC_AT_NAME(6)              = 'UES rotator'
      MEC_AT_NAME(MEC_GL_FOCUS)   = 'Focus'
      MEC_AT_NAME(MEC_GL_DOME)    = 'Dome'
      MEC_AT_NAME(MEC_GL_MIRRCOV) = 'Mirror Cover'
*
* Mechanism keywords
*
      MEC_AT_KEYW(MEC_GL_AXIS1)   = 'AZIMUTH'
      MEC_AT_KEYW(MEC_GL_AXIS2)   = 'ALTITUDE'
      MEC_AT_KEYW(3)              = 'CASS'
      MEC_AT_KEYW(4)              = 'PRIME'
      MEC_AT_KEYW(5)              = 'GHRIL'
      MEC_AT_KEYW(6)              = 'UES'
      MEC_AT_KEYW(MEC_GL_FOCUS)   = 'FOCUS'
      MEC_AT_KEYW(MEC_GL_DOME)    = 'DOME'
      MEC_AT_KEYW(MEC_GL_MIRRCOV) = 'MIRR_COV'
*
* Conversion factor, user to encoder units
*
      MEC_AD_UNITS(MEC_GL_AXIS1)   = DEG2RAD
      MEC_AD_UNITS(MEC_GL_AXIS2)   = DEG2RAD
      MEC_AD_UNITS(3)              = DEG2RAD
      MEC_AD_UNITS(4)              = DEG2RAD
      MEC_AD_UNITS(5)              = DEG2RAD
      MEC_AD_UNITS(6)              = DEG2RAD
      MEC_AD_UNITS(MEC_GL_FOCUS)   = 1.0D0
      MEC_AD_UNITS(MEC_GL_DOME)    = DEG2RAD
      MEC_AD_UNITS(MEC_GL_MIRRCOV) = 1.0D0
*
* Code for formatting of display
*
      MEC_AL_DISPUNIT(MEC_GL_AXIS1)   = DIS_K_DMSF
      MEC_AL_DISPUNIT(MEC_GL_AXIS2)   = DIS_K_DMSF
      MEC_AL_DISPUNIT(3)              = DIS_K_DMS
      MEC_AL_DISPUNIT(4)              = DIS_K_DMS
      MEC_AL_DISPUNIT(5)              = DIS_K_DMS
      MEC_AL_DISPUNIT(6)              = DIS_K_DMS
      MEC_AL_DISPUNIT(MEC_GL_FOCUS)   = DIS_K_MM
      MEC_AL_DISPUNIT(MEC_GL_DOME)    = DIS_K_DM
      MEC_AL_DISPUNIT(MEC_GL_MIRRCOV) = DIS_K_TEMP
*
* Flag defining whether mechanism is allowed to follow
*
      MEC_AB_FOLLOW(MEC_GL_AXIS1)   = .TRUE.
      MEC_AB_FOLLOW(MEC_GL_AXIS2)   = .TRUE.
      MEC_AB_FOLLOW(3)              = .TRUE.
      MEC_AB_FOLLOW(4)              = .TRUE.
      MEC_AB_FOLLOW(5)              = .TRUE.
      MEC_AB_FOLLOW(6)              = .TRUE.
      MEC_AB_FOLLOW(MEC_GL_FOCUS)   = .TRUE.
      MEC_AB_FOLLOW(MEC_GL_DOME)    = .TRUE.
      MEC_AB_FOLLOW(MEC_GL_MIRRCOV) = .FALSE.
*
* Flag defining whether mechanism is controllable
*
      MEC_AB_MOVABLE(MEC_GL_AXIS1)   = .TRUE.
      MEC_AB_MOVABLE(MEC_GL_AXIS2)   = .TRUE.
      MEC_AB_MOVABLE(3)              = .TRUE.
      MEC_AB_MOVABLE(4)              = .TRUE.
      MEC_AB_MOVABLE(5)              = .TRUE.
      MEC_AB_MOVABLE(6)              = .TRUE.
      MEC_AB_MOVABLE(MEC_GL_FOCUS)   = .TRUE.
      MEC_AB_MOVABLE(MEC_GL_DOME)    = .TRUE.
      MEC_AB_MOVABLE(MEC_GL_MIRRCOV) = .FALSE.
*
* Encoders defined for each mechanism (index into encoder arrays)
*
      MEC_AL_ENCLIST(1,1) = 2  ! Azimuth
      MEC_AL_ENCLIST(2,1) = 9
      MEC_AL_ENCLIST(3,1) = 10
      MEC_AL_ENCLIST(4,1) = 11
      MEC_AL_ENCLIST(5,1) = 12
      MEC_AL_ENCLIST(6,1) = 13
      MEC_AL_ENCLIST(7,1) = 14
      MEC_AL_ENCLIST(1,2) = 1  ! Altitude
      MEC_AL_ENCLIST(2,2) = 7 
      MEC_AL_ENCLIST(3,2) = 8
      MEC_AL_ENCLIST(1,3) = 3  ! Cassegrain
      MEC_AL_ENCLIST(2,3) = 15
      MEC_AL_ENCLIST(1,4) = 4  ! Prime
      MEC_AL_ENCLIST(2,4) = 16
      MEC_AL_ENCLIST(1,5) = 5  ! GHRIL
      MEC_AL_ENCLIST(2,5) = 17
      MEC_AL_ENCLIST(1,6) = 6  ! UES
      MEC_AL_ENCLIST(2,6) = 18
      MEC_AL_ENCLIST(1,7) = 19 ! Focus
      MEC_AL_ENCLIST(1,8) = 20 ! Dome
      MEC_AL_ENCLIST(1,9) = 21 ! Mirror cover
*                                                           
* Secondary mirror magnifications
*
      MEC_AD_SECMAG(MEC_GL_AXIS1) =  0.461D0   ! Left-right
      MEC_AD_SECMAG(MEC_GL_AXIS2) = -0.461D0   ! Up-down
*
* Default conversions between secondary tilt and collimation correction
* appropriate for Cassegrain (default) focus
*
      MEC_AD_SECMULT(MEC_GL_AXIS1) =  MEC_AD_SECMAG(MEC_GL_AXIS1)
      MEC_AD_SECMULT(MEC_GL_AXIS2) =  MEC_AD_SECMAG(MEC_GL_AXIS2)
*
* Limits   
* ------
*
* Each mechanism may have the following limits specified:
*
* MAX          = Maximum position limit (defined in MEC_AR_DAT)
* MIN          = Minimum position limit           "
* ACCEL_LIMIT  = Acceleration limit     (defined in MEC_AR_SERV)
* VEL_LIMIT    = Velocity limit                   "
*
*
* In-use flags for limits 
*
      MEC_AR_DAT(MEC_GL_AXIS2).LIMIT.IN_USE  = .TRUE.         ! Altitude
      MEC_AR_DAT(MEC_GL_AXIS1).LIMIT.IN_USE  = .TRUE.         ! Azimuth
      MEC_AR_DAT(3).LIMIT.IN_USE             = .TRUE.         ! Cassegrain
      MEC_AR_DAT(4).LIMIT.IN_USE             = .TRUE.         ! Prime
      MEC_AR_DAT(5).LIMIT.IN_USE             = .FALSE.        ! Namyth GHRIL
      MEC_AR_DAT(6).LIMIT.IN_USE             = .FALSE.        ! Nasmyth UES
      MEC_AR_DAT(MEC_GL_FOCUS).LIMIT.IN_USE  = .TRUE.         ! Focus
      MEC_AR_DAT(MEC_GL_DOME).LIMIT.IN_USE   = .FALSE.        ! Dome
*
* Altitude
*
      MEC_AR_DAT(MEC_GL_AXIS2).LIMIT.MAX        =  1.623D0    ! 93 deg
      MEC_AR_DAT(MEC_GL_AXIS2).LIMIT.MIN        =  1.745D-1   ! 10 deg
      MEC_AR_SERV(MEC_GL_AXIS2).ACCEL_LIMIT(1)  =  5.236D-3   ! 0.3 deg/s**2
*
* Velocity limit for 2A mode
*
      MEC_AR_SERV(MEC_GL_AXIS2).VEL_LIMIT(1)    =  1.745D-2   ! 1 deg/s
* Tempory fix for hardware problem - slow slews
*      MEC_AR_SERV(MEC_GL_AXIS2).VEL_LIMIT(1)   =  0.9D-2     ! 0.5 deg/s
*
* Azimuth
*
      MEC_AR_DAT(MEC_GL_AXIS1).LIMIT.MAX        =  6.196D0    !  355 deg
      MEC_AR_DAT(MEC_GL_AXIS1).LIMIT.MIN        = -3.054D0    ! -175 deg
      MEC_AR_SERV(MEC_GL_AXIS1).ACCEL_LIMIT(1)  =  5.236D-3   ! 0.3 deg/s**2
*
* Velocity limit for 2A mode
*
      MEC_AR_SERV(MEC_GL_AXIS1).VEL_LIMIT(1)    =  1.745D-2   ! 1 deg/s
*
* Cassegrain turntable
*
*  h/w limits 253 and -254 degrees 
*
      MEC_AR_DAT(3).LIMIT.MAX              =  250D0*DEG2RAD   ! 1992 Nov
      MEC_AR_DAT(3).LIMIT.MIN              = -250D0*DEG2RAD   ! 13
      MEC_AR_SERV(3).ACCEL_LIMIT(1)        =  5.236D-3        ! 0.3 deg/s**2
      MEC_AR_SERV(3).VEL_LIMIT(1)          =  1.745D-2        ! 1 deg/s
*
* Prime focus turntable
*
*       MEC_AR_DAT(4).LIMIT.MAX                 =  4.7383   ! PFIP 1-Mar-1997 JMB
*       MEC_AR_DAT(4).LIMIT.MIN                 =  -1.4925  ! PFIP 1-Mar-1997 JMB
* Enable the preceding two statements for PFIP, the following two for AF2.
      MEC_AR_DAT(4).LIMIT.MAX                  =  3.3794     ! AF2 1-Nov-1996
      MEC_AR_DAT(4).LIMIT.MIN                  = -2.8514     ! AF2 1-Nov-1996
      MEC_AR_SERV(4).ACCEL_LIMIT(1)            =  5.236D-3   ! 0.3 deg/s**2
      MEC_AR_SERV(4).VEL_LIMIT(1)              =  1.745D-2   ! 1 deg/s
*
* Nasmyth GHRIL focus turntable
*
      MEC_AR_SERV(5).ACCEL_LIMIT(1)            =  5.236D-3   ! 0.3 deg/s**2
      MEC_AR_SERV(5).VEL_LIMIT(1)              =  1.745D-2   ! 1 deg/s
*                                                   
* Nasmyth UES focus turntable
*
      MEC_AR_SERV(6).ACCEL_LIMIT(1)            =  5.236D-3   ! 0.3 deg/s**2
      MEC_AR_SERV(6).VEL_LIMIT(1)              =  1.745D-2   ! 1 deg/s
*                   
* Focus drive
*
      MEC_AR_DAT(MEC_GL_FOCUS).LIMIT.MAX       = 129.0D0     !  mm
      MEC_AR_DAT(MEC_GL_FOCUS).LIMIT.MIN       =  34.5D0     !  mm
      MEC_AR_SERV(MEC_GL_FOCUS).VEL_LIMIT(1)   =   0.001D0   !  unknown units
      MEC_AR_SERV(MEC_GL_FOCUS).ACCEL_LIMIT(1) = 100.0D0     !  not used
*
* Dome - no position limits are applicable but the following are given
*        for the purpose of validating user input.
*
      MEC_AR_DAT(MEC_GL_DOME).LIMIT.MAX        =  TWOPI      ! 360 deg 
      MEC_AR_DAT(MEC_GL_DOME).LIMIT.MIN        =  0.0D0      !   0 deg 
*
      MEC_AR_SERV(MEC_GL_DOME).VEL_LIMIT(1)    = 99.0D0      ! Output units
*
* Mirror cover
*
      MEC_AR_DAT(MEC_GL_MIRRCOV).LIMIT.MAX     =  1.0D0      ! Fully open
      MEC_AR_DAT(MEC_GL_MIRRCOV).LIMIT.MIN     =  0.0D0      ! Fully closed
*
* Shutter (pure guesswork)
* Actual shutter position is used to warn of vignetting.  At present,
* there are no restrictions, so set equal to 90 deg.
*
*      MEC_AR_DAT(MEC_K_SH).POS_ACTUAL         =  1.5708d0   ! 90 deg
*      MEC_AR_DAT(MEC_K_SH).LIMIT.MAX          =  1.9199D0   ! 110 deg (?)
*      MEC_AR_DAT(MEC_K_SH).LIMIT.MIN          =  0.0873D0   !   5 deg (?)
*
* Windshield (pure guesswork)
*
*      MEC_AR_DAT(MEC_K_WS).LIMIT.MAX          =  1.2217D0   !  70 deg (?)
*      MEC_AR_DAT(MEC_K_WS).LIMIT.MIN          =  0.0873D0   !   5 deg (?)
*
* Servo constants
* ---------------
*
* Altitude (Type 2A)
*
      MEC_AR_SERV(MEC_GL_AXIS2).VEL_TO_RATE(1)        = -5.5463D-7  ! rad/s/bit
* Square root to linear servo transition radius
      MEC_AR_SERV(MEC_GL_AXIS2).SERVO.RAD_SQRT2LIN(1) = 1.5D-4
      MEC_AR_DAT(MEC_GL_AXIS2).RAD_IN_POSN    = 4.848D-6 ! Max tracking error
      MEC_AR_DAT(MEC_GL_AXIS2).RAD_STOP       = 4.848D-6 ! Stopping window
      MEC_AR_SERV(MEC_GL_AXIS2).SERVO.K_SQRTPOS(1) = 5.0D-2 ! Square root servo 
*                                                           ! constant
      MEC_AR_SERV(MEC_GL_AXIS2).SERVO.K_LINPOS(1)  = 4.0D0  ! Linear servo gain
*
* Azimuth (Type 2A)
*
      MEC_AR_SERV(MEC_GL_AXIS1).VEL_TO_RATE(1)        = 5.5463D-7   ! rad/s/bit
* Square root to linear servo transition radius
      MEC_AR_SERV(MEC_GL_AXIS1).SERVO.RAD_SQRT2LIN(1) = 1.5D-4
      MEC_AR_DAT(MEC_GL_AXIS1).RAD_IN_POSN    = 4.848D-6 ! Max tracking error
      MEC_AR_DAT(MEC_GL_AXIS1).RAD_STOP       = 4.848D-6 ! Stopping window
      MEC_AR_SERV(MEC_GL_AXIS1).SERVO.K_SQRTPOS(1) = 5.0D-2 ! Square root servo 
                                                            ! constant
      MEC_AR_SERV(MEC_GL_AXIS1).SERVO.K_LINPOS(1)  = 4.0D0  ! Linear servo gain
*
      MEC_GD_PROJECT  = 1.0D-2 ! Max projection factor for transition radii
*
* Cassegrain turntable (Type 2A)
*
      MEC_AR_SERV(3).VEL_TO_RATE(1)        = -6.3740D-7    ! rad/s/bit
* Square root to linear servo transition radius
      MEC_AR_SERV(3).SERVO.RAD_SQRT2LIN(1) = 7.5D-2 
      MEC_AR_DAT(3).RAD_IN_POSN            = 1.454D-4      ! Max tracking error
      MEC_AR_DAT(3).RAD_STOP               = 3.0D-4        ! Stopping window
      MEC_AR_SERV(3).SERVO.K_SQRTPOS(1)    = 5.0D-2        ! Square root servo
                                                           ! constant
      MEC_AR_SERV(3).SERVO.K_LINPOS(1)     = 0.2D0         ! Linear servo gain
*
* Prime Focus turntable (Type 2A)
*
      MEC_AR_SERV(4).VEL_TO_RATE(1)        =  6.3358D-7    ! rad/s/bit
* Square root to linear servo transition radius
      MEC_AR_SERV(4).SERVO.RAD_SQRT2LIN(1) = 7.5D-2 
      MEC_AR_DAT(4).RAD_IN_POSN            = 1.0D-4        ! Max tracking error
      MEC_AR_DAT(4).RAD_STOP               = 3.0D-4        ! Stopping window
      MEC_AR_SERV(4).SERVO.K_SQRTPOS(1)    = 5.0D-2        ! Square root servo
                                                           ! constant
      MEC_AR_SERV(4).SERVO.K_LINPOS(1)     = 1.0D0     ! Linear servo gain 1/94
*
* Nasmyth GHRIL turntable (Type 2A)
*
      MEC_AR_SERV(5).VEL_TO_RATE(1)        = -5.3263D-7    ! rad/s/bit
* Square root to linear servo transition radius
      MEC_AR_SERV(5).SERVO.RAD_SQRT2LIN(1) = 7.5D-2
      MEC_AR_DAT(5).RAD_IN_POSN            = 5.0D-5        ! Max tracking error
      MEC_AR_DAT(5).RAD_STOP               = 1.0D-4        ! Stopping window
      MEC_AR_SERV(5).SERVO.K_SQRTPOS(1)    = 5.0D-2        ! Square root servo
                                                           ! constant
      MEC_AR_SERV(5).SERVO.K_LINPOS(1)     = 0.5D0         ! Linear servo gain
*
* Nasmyth UES turntable (Type 2A)
*
      MEC_AR_SERV(6).VEL_TO_RATE(1)        = -5.3263D-7    ! rad/s/bit
* Square root to linear servo transition radius
      MEC_AR_SERV(6).SERVO.RAD_SQRT2LIN(1) = 7.5D-2
      MEC_AR_DAT(6).RAD_IN_POSN            = 5.0D-5        ! Max tracking error
      MEC_AR_DAT(6).RAD_STOP               = 1.0D-4        ! Stopping window
      MEC_AR_SERV(6).SERVO.K_SQRTPOS(1)    = 5.0D-2        ! Square root servo
                                                           ! constant
      MEC_AR_SERV(6).SERVO.K_LINPOS(1)     = 0.5D0         ! Linear servo gain
*
* Focus
*
      MEC_AR_SERV(MEC_GL_FOCUS).VEL_TO_RATE(1)        = 1.5D-5 
      MEC_AR_SERV(MEC_GL_FOCUS).SERVO.RAD_SQRT2LIN(1) = 100.0D0
      MEC_AR_SERV(MEC_GL_FOCUS).SERVO.RAD_INTEG = 0.06D0  ! Radius within which
                                                          ! integration is 
                                                          ! applied (mm)
                                                          ! 1988 Oct 5 RAL
      MEC_AR_DAT(MEC_GL_FOCUS).RAD_IN_POSN      = 5.0D-3  ! Restart window (mm)
      MEC_AR_DAT(MEC_GL_FOCUS).RAD_STOP         = 5.0D-3  ! Stopping window (mm)
      MEC_AR_SERV(MEC_GL_FOCUS).SERVO.K_LINPOS(1) = -3.0D-3 ! Linear servo gain
                                                            ! 1988 Oct 5 RAL
      MEC_AR_SERV(MEC_GL_FOCUS).SERVO.K_INTEGPOS  = -2.0D-4 ! Integrator gain
*
* Dome
*
      MEC_AR_SERV(MEC_GL_DOME).SERVO.K_LINPOS(1) = 500D0 ! Linear servo constant
      MEC_AR_DAT(MEC_GL_DOME).RAD_IN_POSN = 1.7D-2         ! Max tracking error
      MEC_AR_DAT(MEC_GL_DOME).RAD_STOP    = 1.7D-2         ! Stopping window
*
      MEC_GL_DOME_RADIUS = 12000.0D0                   ! Dome radius (mm)
      MEC_GL_DECOFF      = 0.0D0                       ! Dec axis displacement
*
* Mirror cover (units unknown)
*
      MEC_AR_DAT(MEC_GL_MIRRCOV).RAD_STOP  = 0.01      ! Stopping window
*
* Default positions
* -----------------
*
      MEC_AR_DAT(MEC_GL_AXIS2).POS_DEMAND = 1.57    ! Default altitude
*                                                   ! just less than limit
      MEC_AR_DAT(MEC_GL_AXIS1).POS_DEMAND = 0.0     ! Default azimuth
      MEC_AR_DAT(3).POS_DEMAND            = 0.0     ! Default cass TT
      MEC_AR_DAT(4).POS_DEMAND            = 0.0     ! Default prime TT
      MEC_AR_DAT(5).POS_DEMAND            = 0.0     ! Default GHRIL TT
      MEC_AR_DAT(6).POS_DEMAND            = 0.0     ! Default UES TT
      MEC_GD_FOCUS = INS_AD_DEF_FOCUS(INS_GL_INSTRUMENT) ! Default focus
      MEC_GL_POLEAX                       = 1       ! No meaning for altaz  
*
* Zeroset information
* -------------------
*
      MEC_AR_DAT(MEC_GL_AXIS1).ZERO.TARGET = -2.3001103D-2        ! Target 
      MEC_AR_DAT(MEC_GL_AXIS2).ZERO.TARGET = 1.567466835D0        ! Target
*
* Focus temperature relation
* --------------------------
*
* JMB 10-Jan-1996  Changed gradient from 0.092mm/K to 0.1127mm/K for Cass.
*
      MEC_GD_TEMP2FOC(1) =  0.1127 ! Gradient (mm/K)
      MEC_GD_TEMP2FOC(2) = -0.092  ! Gradient (mm/K)
      MEC_GD_TEMP2FOC(3) =  0.092  ! Gradient (mm/K)
      MEC_GD_TEMP2FOC(4) =  0.092  ! Gradient (mm/K)
      MEC_GD_TEMP2FOC(5) =  0.092  ! Gradient (mm/K)
      MEC_GD_TEMP2FOC(6) =  0.092  ! Gradient (mm/K)
      MEC_GD_TEMP2FOC(7) =  0.092  ! Gradient (mm/K)
      MEC_GD_TEMP2FOC(8) =  0.092  ! Gradient (mm/K)
      MEC_GD_TEMP2FOC(9) =  0.092  ! Gradient (mm/K)
*
      MEC_GD_TEMPZERO    = 5.0     ! Fiducial temp. (C)
      MEC_GD_DELTA_T     = 0.2     ! Allowable temp 
                                   ! change before 
                                   ! focus change (K)
* Focus-elevation
*
      MEC_GD_EL2FOC(1)   = -0.09167D0   ! Cassegrain (-0.0016 mm/deg)
      MEC_GD_FO_ELZERO   = PIBY2        ! Correction = 0 at zenith
      MEC_GD_FO_DELTA_EL = 0.0561       ! Elevation change before changing
                                        ! focus (3.2 deg => 0.005mm)
*
* Initial value of COMMAND field
* ------------------------------
*
      DO I = 1, 6                                 ! Zerosettable mechanisms
        MEC_AR_DAT(I).COMMAND = MEC_M_STOP .OR. MEC_M_ZEROSET_3
      ENDDO
*
      DO I = 7, MEC_GL_TOT
        MEC_AR_DAT(I).COMMAND = MEC_M_STOP
      ENDDO
*
* Initial value of STATUS field for rotators, dome and focus
* ----------------------------------------------------------
*
      DO I = 3, 6
        MEC_AR_DAT(I).STATUS = MEC_M_FOLLOWING
      ENDDO
*
      MEC_AR_DAT(MEC_GL_DOME).STATUS = MEC_M_FOLLOWING
      MEC_AR_DAT(MEC_GL_FOCUS).STATUS = MEC_M_FOLLOWING
*
* Initial values of logical flags
* -------------------------------
*
      MEC_GB_COMPMODE   =  .FALSE.    ! Engineering mode
      MEC_GB_LIM_ERR    =  .FALSE.    ! No limit error
      MEC_GB_ENG_ERR    =  .FALSE.    ! No eng mode error
      MEC_GB_ENG_COMM   =  .FALSE.    ! No eng mode command
      MEC_AB_CONTROL(1) = .TRUE.      ! Engineering mode
      MEC_AB_CONTROL(2) = .TRUE.      ! Gear encoder selected
*
*==============================================================================*
*
* Meteorological data global section (_METGSD.INC, METDATA)
* ---------------------------------------------------------
*
* Default values
*
      MET_GD_HUMID     = 0.5D0             ! Relative humidity
      MET_GD_PRESS     = 779D0             ! Pressure (mbar)
      MET_GD_TEMP_OUT  = 279D0             ! Outside temperature (K)
      MET_GD_TLR       = 0.0065D0          ! Temperature lapse rate (K/m)
      MET_GD_WAVEL     = 0.4D0             ! Wavelength for refraction (micron)
*
* Limits used in validating user interface input of parameters needed
* for refraction correction
*
      MET_GD_MIN_PRESS = 750D0             ! Min pressure (mbar)
      MET_GD_MAX_PRESS = 800D0             ! Max pressure (mbar)
      MET_GD_MAX_TEMP  = 30D0              ! Max temperature (degC)
      MET_GD_MIN_TEMP  = -10D0             ! Min temperature (degC)
      MET_GD_MAX_HUMID = 1D0               ! Max humidity
      MET_GD_MIN_HUMID = 0D0               ! Min humidity
      MET_GD_MAX_WAVEL = 35D0              ! Max wavelength
      MET_GD_MIN_WAVEL = 0.3D0             ! Min wavelength
*
*==============================================================================*
*
* Astrometric global section (_PNAGSD, PNA)
* -----------------------------------------
*
* Diagonal elements of matrices
*
      DO I = 1, 2
        PNA_AR_PREU24(I).ARRAY(1,1)   = 1D0
        PNA_AR_PREU24(I).ARRAY(2,2)   = 1D0
        PNA_AR_PREU24(I).ARRAY(3,3)   = 1D0
        PNA_AR_PREU25(I).ARRAY(1,1)   = 1D0
        PNA_AR_PREU25(I).ARRAY(2,2)   = 1D0
        PNA_AR_PREU25(I).ARRAY(3,3)   = 1D0
        PNA_AR_PREGS24(I).ARRAY(1,1)  = 1D0
        PNA_AR_PREGS24(I).ARRAY(2,2)  = 1D0
        PNA_AR_PREGS24(I).ARRAY(3,3)  = 1D0
        PNA_AR_PREGS25(I).ARRAY(1,1)  = 1D0
        PNA_AR_PREGS25(I).ARRAY(2,2)  = 1D0
        PNA_AR_PREGS25(I).ARRAY(3,3)  = 1D0
        PNA_AD_AMPRMS(2,I)            = 1D0
        PNA_AD_AMPRMS(5,I)            = 1D0
        PNA_AD_AMPRMS(12,I)           = 1D0
        PNA_AD_AMPRMS(13,I)           = 1D0
        PNA_AD_AMPRMS(17,I)           = 1D0
        PNA_AD_AMPRMS(21,I)           = 1D0
      ENDDO
*                                               
*==============================================================================*
* Pointing coefficients global section (_POIGSD.INC, POINT)
* ---------------------------------------------------------
*
* Limit on rms value from TPOINT analysis
*
      POI_GD_RMS_MAX     = 4.0D0            ! Maximum good rms
*
* Pointing files
*
      POI_GL_LOGFILE_TOT = 5
      POI_AL_ENCOMB(1,1) = 9  ! Az gear
      POI_AL_ENCOMB(2,1) = 7  ! Al gear
      POI_AL_ENCOMB(1,2) = 11 ! Az tape 1
      POI_AL_ENCOMB(2,2) = 7  ! Al gear
      POI_AL_ENCOMB(1,3) = 12 ! Az tape 2
      POI_AL_ENCOMB(2,3) = 7  ! Al gear
      POI_AL_ENCOMB(1,4) = 13 ! Az tape 3
      POI_AL_ENCOMB(2,4) = 7  ! Al gear
      POI_AL_ENCOMB(1,5) = 14 ! Az tape 4
      POI_AL_ENCOMB(2,5) = 7  ! Al gear
*
* Pointing coefficients (indexed on focal station number as defined in
* the TEL_ section).
*
* Cassegrain (Pointing test 12-Jun-1998 : GEAR encoder)
*
* Analysed by RAL, entered by MPF, 15-Jun-1998
*
      POI_GD_AXIS1_ZERO(1) =   4.36D0*AS2RAD  ! IA Azimuth zero-point 
      POI_GD_AXIS2_ZERO(1) = -23.37D0*AS2RAD  ! IE Elevation zero-point
      POI_GD_AXIS1_COLL(1) =  91.26D0*AS2RAD  ! CA Horizontal collimation
      POI_GD_NP(1)         =  -8.62D0*AS2RAD  ! NPAE Non-perpendicularity
      POI_GD_XTILT(1)      =  36.36D0*AS2RAD  ! x-component of azimuth (AN)
      POI_GD_YTILT(1)      =  16.72D0*AS2RAD  ! y-component of azimuth (AW)
      POI_GD_TF(1)         = -10.75D0*AS2RAD  ! Tube flexure (sinz)
      POI_GD_TX(1)         =  -0.64D0*AS2RAD  ! Tube flexure (tanz)
      POI_GD_HSSA1(1)      =  -0.88D0*AS2RAD  ! sinA term in Asinz 
      POI_GD_HSCA1(1)      =   0.00D0*AS2RAD  ! cosA term in Asinz 
      POI_GD_HZSA1(1)      =   0.00D0*AS2RAD  ! sinA term in z
      POI_GD_HZCA1(1)      =   0.00D0*AS2RAD  ! cosA term in z
      POI_GD_HSSA2(1)      =   0.00D0*AS2RAD  ! sin2A term in Asinz
      POI_GD_HSCA2(1)      =   1.58D0*AS2RAD  ! cos2A term in Asinz
      POI_GD_HZSA2(1)      =   0.35D0*AS2RAD  ! sin2A term in z
      POI_GD_HZCA2(1)      =  -0.41D0*AS2RAD  ! cos2A term in z
      POI_GD_HSSA3(1)      =   2.60D0*AS2RAD  ! sin3A term in Asinz
      POI_GD_HSCA3(1)      =   0.00D0*AS2RAD  ! cos3A term in Asinz
      POI_GD_HZSA3(1)      =   0.94D0*AS2RAD  ! sin3A term in z
      POI_GD_HZCA3(1)      =  -2.22D0*AS2RAD  ! cos3A term in z
      POI_GD_HZSZ4(1)      =   0.00D0*AS2RAD  ! sin 4z term in z
*
* Prime focus
*
* Last updated: MPF,  13 Oct 1998
*
      POI_GD_AXIS1_ZERO(2) =     3.61*AS2RAD  ! Azimuth index error (IA)
      POI_GD_AXIS2_ZERO(2) =    10.58*AS2RAD  ! Elevation index error (IE)
      POI_GD_AXIS1_COLL(2) =    86.23*AS2RAD  ! Azimuth collimation error (CA)
      POI_GD_NP(2)         =   -11.82*AS2RAD  ! Non-perpendicularity (NPAE)
      POI_GD_XTILT(2)      =    40.35*AS2RAD  ! NS tilt of azimuth axis (AN)
      POI_GD_YTILT(2)      =    20.20*AS2RAD  ! EW tilt of azimuth axis (AW)
      POI_GD_TF(2)         =   -24.21*AS2RAD  ! sin z tube flexure
      POI_GD_TX(2)         =    -1.92*AS2RAD  ! tan z tube flexure
      POI_GD_HSSA1(2)      =    -5.71*AS2RAD  ! sin A term in Azimuth
      POI_GD_HSCA1(2)      =    -0.56*AS2RAD  ! cos A term in Azimuth
      POI_GD_HZSA1(2)      =    -0.23*AS2RAD  ! sin A term in ZD
      POI_GD_HZCA1(2)      =     7.07*AS2RAD  ! cos A term in ZD
      POI_GD_HSSA2(2)      =     0.55*AS2RAD  ! sin 2A term in Azimuth
      POI_GD_HSCA2(2)      =     2.11*AS2RAD  ! cos 2A term in Azimuth
      POI_GD_HZSA2(2)      =     1.24*AS2RAD  ! sin 2A term in ZD
      POI_GD_HZCA2(2)      =    -0.25*AS2RAD  ! cos 2A term in ZD
      POI_GD_HSSA3(2)      =     2.55*AS2RAD  ! sin 3A term in Azimuth
      POI_GD_HSCA3(2)      =    -0.69*AS2RAD  ! cos 3A term in Azimuth
      POI_GD_HZSA3(2)      =     0.00*AS2RAD  ! sin 3A term in ZD
      POI_GD_HZCA3(2)      =    -2.08*AS2RAD  ! cos 3A term in ZD
      POI_GD_HZSZ4(2)      =    -2.36*AS2RAD  ! sin 4z term in ZD
*
* Nasmyth GHRIL with instrument rotation
*
* Pointing test 24-Apr-1999
*
* Last updated: FJG  24-Apr-1999
*
      POI_GD_AXIS1_ZERO(3) =   1.76D0*AS2RAD  ! IA Azimuth zero-point      
      POI_GD_AXIS2_ZERO(3) = -21.24D0*AS2RAD  ! IE Elevation zero-point    
      POI_GD_AXIS1_COLL(3) =  79.73D0*AS2RAD  ! CA Horizontal collimation  
      POI_GD_NP(3)         =  -6.92D0*AS2RAD  ! NPAE Non-perpendicularity  
      POI_GD_XTILT(3)      =  39.41D0*AS2RAD  ! x-component of azimuth (AN)
      POI_GD_YTILT(3)      =  15.61D0*AS2RAD  ! y-component of azimuth (AW)
      POI_GD_TF(3)         =  -6.59D0*AS2RAD  ! Tube flexure (sinz)        
      POI_GD_TX(3)         =  -0.62D0*AS2RAD  ! Tube flexure (tanz)        
      POI_GD_HSSA1(3)      =  -3.02D0*AS2RAD  ! sinA term in Asinz         
      POI_GD_HSCA1(3)      =   0.00D0*AS2RAD  ! cosA term in Asinz         
      POI_GD_HZSA1(3)      =   0.00D0*AS2RAD  ! sinA term in z             
      POI_GD_HZCA1(3)      =   3.28D0*AS2RAD  ! cosA term in z             
      POI_GD_HSSA2(3)      =   0.00D0*AS2RAD  ! sin2A term in Asinz        
      POI_GD_HSCA2(3)      =   1.71D0*AS2RAD  ! cos2A term in Asinz        
      POI_GD_HZSA2(3)      =   0.48D0*AS2RAD  ! sin2A term in z            
      POI_GD_HZCA2(3)      =   0.00D0*AS2RAD  ! cos2A term in z            
      POI_GD_HSSA3(3)      =   2.55D0*AS2RAD  ! sin3A term in Asinz        
      POI_GD_HSCA3(3)      =   0.00D0*AS2RAD  ! cos3A term in Asinz        
      POI_GD_HZSA3(3)      =   0.63D0*AS2RAD  ! sin3A term in z            
      POI_GD_HZCA3(3)      =  -2.01D0*AS2RAD  ! cos3A term in z            
      POI_GD_HZSZ4(3)      =  -1.72D0*AS2RAD  ! sin 4z term in z           
*
* Nasmyth GHRIL with IR derotator
*
* Pointing test 24-Apr-1999
*
* Last updated: FJG  24-Apr-1999
*
      POI_GD_AXIS1_ZERO(4) =   1.76D0*AS2RAD  ! IA Azimuth zero-point      
      POI_GD_AXIS2_ZERO(4) = -21.24D0*AS2RAD  ! IE Elevation zero-point    
      POI_GD_AXIS1_COLL(4) =  79.73D0*AS2RAD  ! CA Horizontal collimation  
      POI_GD_NP(4)         =  -6.92D0*AS2RAD  ! NPAE Non-perpendicularity  
      POI_GD_XTILT(4)      =  39.41D0*AS2RAD  ! x-component of azimuth (AN)
      POI_GD_YTILT(4)      =  15.61D0*AS2RAD  ! y-component of azimuth (AW)
      POI_GD_TF(4)         =  -6.59D0*AS2RAD  ! Tube flexure (sinz)        
      POI_GD_TX(4)         =  -0.62D0*AS2RAD  ! Tube flexure (tanz)        
      POI_GD_HSSA1(4)      =  -3.02D0*AS2RAD  ! sinA term in Asinz         
      POI_GD_HSCA1(4)      =   0.00D0*AS2RAD  ! cosA term in Asinz         
      POI_GD_HZSA1(4)      =   0.00D0*AS2RAD  ! sinA term in z             
      POI_GD_HZCA1(4)      =   3.28D0*AS2RAD  ! cosA term in z             
      POI_GD_HSSA2(4)      =   0.00D0*AS2RAD  ! sin2A term in Asinz        
      POI_GD_HSCA2(4)      =   1.71D0*AS2RAD  ! cos2A term in Asinz        
      POI_GD_HZSA2(4)      =   0.48D0*AS2RAD  ! sin2A term in z            
      POI_GD_HZCA2(4)      =   0.00D0*AS2RAD  ! cos2A term in z            
      POI_GD_HSSA3(4)      =   2.55D0*AS2RAD  ! sin3A term in Asinz        
      POI_GD_HSCA3(4)      =   0.00D0*AS2RAD  ! cos3A term in Asinz        
      POI_GD_HZSA3(4)      =   0.63D0*AS2RAD  ! sin3A term in z            
      POI_GD_HZCA3(4)      =  -2.01D0*AS2RAD  ! cos3A term in z            
      POI_GD_HZSZ4(4)      =  -1.72D0*AS2RAD  ! sin 4z term in z           
*
* GHRIL infrared derotator tracking corrections.
*
* Last updated 24-Apr-1999 FJG 
*
* Determined from data taken on 24-Apr-1999 by FJG
* 
      POI_GD_NCOS1X(4)     =   0.7132E-05 ! cos PA term in x
      POI_GD_NSIN1X(4)     =  -0.1243E-04 ! sin PA term in x
      POI_GD_NCOS1Y(4)     =   0.1243E-04 ! cos PA term in y
      POI_GD_NSIN1Y(4)     =   0.7132E-05 ! sin PA term in y
*
* Nasmyth GHRIL with optical derotator
*
* Pointing test 24-Apr-1999
*
* Last updated: FJG  24-Apr-1999
*
      POI_GD_AXIS1_ZERO(5) =   1.76D0*AS2RAD  ! IA Azimuth zero-point      
      POI_GD_AXIS2_ZERO(5) = -21.24D0*AS2RAD  ! IE Elevation zero-point    
      POI_GD_AXIS1_COLL(5) =  79.73D0*AS2RAD  ! CA Horizontal collimation  
      POI_GD_NP(5)         =  -6.92D0*AS2RAD  ! NPAE Non-perpendicularity  
      POI_GD_XTILT(5)      =  39.41D0*AS2RAD  ! x-component of azimuth (AN)
      POI_GD_YTILT(5)      =  15.61D0*AS2RAD  ! y-component of azimuth (AW)
      POI_GD_TF(5)         =  -6.59D0*AS2RAD  ! Tube flexure (sinz)        
      POI_GD_TX(5)         =  -0.62D0*AS2RAD  ! Tube flexure (tanz)        
      POI_GD_HSSA1(5)      =  -3.02D0*AS2RAD  ! sinA term in Asinz         
      POI_GD_HSCA1(5)      =   0.00D0*AS2RAD  ! cosA term in Asinz         
      POI_GD_HZSA1(5)      =   0.00D0*AS2RAD  ! sinA term in z             
      POI_GD_HZCA1(5)      =   3.28D0*AS2RAD  ! cosA term in z             
      POI_GD_HSSA2(5)      =   0.00D0*AS2RAD  ! sin2A term in Asinz        
      POI_GD_HSCA2(5)      =   1.71D0*AS2RAD  ! cos2A term in Asinz        
      POI_GD_HZSA2(5)      =   0.48D0*AS2RAD  ! sin2A term in z            
      POI_GD_HZCA2(5)      =   0.00D0*AS2RAD  ! cos2A term in z            
      POI_GD_HSSA3(5)      =   2.55D0*AS2RAD  ! sin3A term in Asinz        
      POI_GD_HSCA3(5)      =   0.00D0*AS2RAD  ! cos3A term in Asinz        
      POI_GD_HZSA3(5)      =   0.63D0*AS2RAD  ! sin3A term in z            
      POI_GD_HZCA3(5)      =  -2.01D0*AS2RAD  ! cos3A term in z            
      POI_GD_HZSZ4(5)      =  -1.72D0*AS2RAD  ! sin 4z term in z           
*
* GHRIL optical derotator tracking corrections. (not determined)
*
      POI_GD_NCOS1X(5)     =  0.0D0 ! cos PA term in x
      POI_GD_NSIN1X(5)     =  0.0D0 ! sin PA term in x
      POI_GD_NCOS1Y(5)     =  0.0D0 ! cos PA term in y
      POI_GD_NSIN1Y(5)     =  0.0D0 ! sin PA term in y
*
* Nasmyth GHRIL (no rotation)
*
* Identical to Nasmyth GHRIL with derotation.
*
* Pointing test 24-Apr-1999
*
* Last updated: FJG  24-Apr-1999
*
      POI_GD_AXIS1_ZERO(6) =   1.76D0*AS2RAD  ! IA Azimuth zero-point      
      POI_GD_AXIS2_ZERO(6) = -21.24D0*AS2RAD  ! IE Elevation zero-point    
      POI_GD_AXIS1_COLL(6) =  79.73D0*AS2RAD  ! CA Horizontal collimation  
      POI_GD_NP(6)         =  -6.92D0*AS2RAD  ! NPAE Non-perpendicularity  
      POI_GD_XTILT(6)      =  39.41D0*AS2RAD  ! x-component of azimuth (AN)
      POI_GD_YTILT(6)      =  15.61D0*AS2RAD  ! y-component of azimuth (AW)
      POI_GD_TF(6)         =  -6.59D0*AS2RAD  ! Tube flexure (sinz)        
      POI_GD_TX(6)         =  -0.62D0*AS2RAD  ! Tube flexure (tanz)        
      POI_GD_HSSA1(6)      =  -3.02D0*AS2RAD  ! sinA term in Asinz         
      POI_GD_HSCA1(6)      =   0.00D0*AS2RAD  ! cosA term in Asinz         
      POI_GD_HZSA1(6)      =   0.00D0*AS2RAD  ! sinA term in z             
      POI_GD_HZCA1(6)      =   3.28D0*AS2RAD  ! cosA term in z             
      POI_GD_HSSA2(6)      =   0.00D0*AS2RAD  ! sin2A term in Asinz        
      POI_GD_HSCA2(6)      =   1.71D0*AS2RAD  ! cos2A term in Asinz        
      POI_GD_HZSA2(6)      =   0.48D0*AS2RAD  ! sin2A term in z            
      POI_GD_HZCA2(6)      =   0.00D0*AS2RAD  ! cos2A term in z            
      POI_GD_HSSA3(6)      =   2.55D0*AS2RAD  ! sin3A term in Asinz        
      POI_GD_HSCA3(6)      =   0.00D0*AS2RAD  ! cos3A term in Asinz        
      POI_GD_HZSA3(6)      =   0.63D0*AS2RAD  ! sin3A term in z            
      POI_GD_HZCA3(6)      =  -2.01D0*AS2RAD  ! cos3A term in z            
      POI_GD_HZSZ4(6)      =  -1.72D0*AS2RAD  ! sin 4z term in z           
*
* Nasmyth UES with instrument rotation
*
* Identical to Nasmyth UES with derotation.
*
* Last updated: MPF  25-Jan-1999
*
      POI_GD_AXIS1_ZERO(7) =   0.82D0*AS2RAD  ! IA Azimuth zero-point      
      POI_GD_AXIS2_ZERO(7) = -42.86D0*AS2RAD  ! IE Elevation zero-point    
      POI_GD_AXIS1_COLL(7) = 125.48D0*AS2RAD  ! CA Horizontal collimation  
      POI_GD_NP(7)         =   8.65D0*AS2RAD  ! NPAE Non-perpendicularity  
      POI_GD_XTILT(7)      =  39.66D0*AS2RAD  ! x-component of azimuth (AN)
      POI_GD_YTILT(7)      =  13.41D0*AS2RAD  ! y-component of azimuth (AW)
      POI_GD_TF(7)         =   2.10D0*AS2RAD  ! Tube flexure (sinz)        
      POI_GD_TX(7)         =   0.00D0*AS2RAD  ! Tube flexure (tanz)        
      POI_GD_HSSA1(7)      =  -3.60D0*AS2RAD  ! sinA term in Asinz         
      POI_GD_HSCA1(7)      =   0.00D0*AS2RAD  ! cosA term in Asinz         
      POI_GD_HZSA1(7)      =   0.00D0*AS2RAD  ! sinA term in z             
      POI_GD_HZCA1(7)      =   3.03D0*AS2RAD  ! cosA term in z             
      POI_GD_HSSA2(7)      =   0.00D0*AS2RAD  ! sin2A term in Asinz        
      POI_GD_HSCA2(7)      =   1.68D0*AS2RAD  ! cos2A term in Asinz        
      POI_GD_HZSA2(7)      =   0.00D0*AS2RAD  ! sin2A term in z            
      POI_GD_HZCA2(7)      =  -0.38D0*AS2RAD  ! cos2A term in z            
      POI_GD_HSSA3(7)      =   2.65D0*AS2RAD  ! sin3A term in Asinz        
      POI_GD_HSCA3(7)      =   0.00D0*AS2RAD  ! cos3A term in Asinz        
      POI_GD_HZSA3(7)      =   0.59D0*AS2RAD  ! sin3A term in z            
      POI_GD_HZCA3(7)      =  -2.26D0*AS2RAD  ! cos3A term in z            
      POI_GD_HZSZ4(7)      =  -1.11D0*AS2RAD  ! sin 4z term in z           
*
* Nasmyth UES with UV derotator
*
* Last updated: MPF  25-Jan-1999
*
      POI_GD_AXIS1_ZERO(8) =   0.82D0*AS2RAD  ! IA Azimuth zero-point      
      POI_GD_AXIS2_ZERO(8) = -42.86D0*AS2RAD  ! IE Elevation zero-point    
      POI_GD_AXIS1_COLL(8) = 125.48D0*AS2RAD  ! CA Horizontal collimation  
      POI_GD_NP(8)         =   8.65D0*AS2RAD  ! NPAE Non-perpendicularity  
      POI_GD_XTILT(8)      =  39.66D0*AS2RAD  ! x-component of azimuth (AN)
      POI_GD_YTILT(8)      =  13.41D0*AS2RAD  ! y-component of azimuth (AW)
      POI_GD_TF(8)         =   2.10D0*AS2RAD  ! Tube flexure (sinz)        
      POI_GD_TX(8)         =   0.00D0*AS2RAD  ! Tube flexure (tanz)        
      POI_GD_HSSA1(8)      =  -3.60D0*AS2RAD  ! sinA term in Asinz         
      POI_GD_HSCA1(8)      =   0.00D0*AS2RAD  ! cosA term in Asinz         
      POI_GD_HZSA1(8)      =   0.00D0*AS2RAD  ! sinA term in z             
      POI_GD_HZCA1(8)      =   3.03D0*AS2RAD  ! cosA term in z             
      POI_GD_HSSA2(8)      =   0.00D0*AS2RAD  ! sin2A term in Asinz        
      POI_GD_HSCA2(8)      =   1.68D0*AS2RAD  ! cos2A term in Asinz        
      POI_GD_HZSA2(8)      =   0.00D0*AS2RAD  ! sin2A term in z            
      POI_GD_HZCA2(8)      =  -0.38D0*AS2RAD  ! cos2A term in z            
      POI_GD_HSSA3(8)      =   2.65D0*AS2RAD  ! sin3A term in Asinz        
      POI_GD_HSCA3(8)      =   0.00D0*AS2RAD  ! cos3A term in Asinz        
      POI_GD_HZSA3(8)      =   0.59D0*AS2RAD  ! sin3A term in z            
      POI_GD_HZCA3(8)      =  -2.26D0*AS2RAD  ! cos3A term in z            
      POI_GD_HZSZ4(8)      =  -1.11D0*AS2RAD  ! sin 4z term in z           
*
* UES UV derotator tracking corrections.
*
* Data taken on 16-Jun-1998 by FJG
*
      POI_GD_NCOS1X(8)     = -7.4866D-7  ! cos PA term in x
      POI_GD_NSIN1X(8)     =  2.9143D-5  ! sin PA term in x
      POI_GD_NCOS1Y(8)     = -2.9143D-5  ! cos PA term in y
      POI_GD_NSIN1Y(8)     = -7.4866D-7  ! sin PA term in y
*
* Nasmyth UES with optical derotator
*
* Pointing test  4-Jan-1999 (FJG) : Gear encoder
*
* Last updated: MPF  25-Jan-1999
*
      POI_GD_AXIS1_ZERO(9) =   0.82D0*AS2RAD  ! IA Azimuth zero-point      
      POI_GD_AXIS2_ZERO(9) = -42.86D0*AS2RAD  ! IE Elevation zero-point    
      POI_GD_AXIS1_COLL(9) = 125.48D0*AS2RAD  ! CA Horizontal collimation  
      POI_GD_NP(9)         =   8.65D0*AS2RAD  ! NPAE Non-perpendicularity  
      POI_GD_XTILT(9)      =  39.66D0*AS2RAD  ! x-component of azimuth (AN)
      POI_GD_YTILT(9)      =  13.41D0*AS2RAD  ! y-component of azimuth (AW)
      POI_GD_TF(9)         =   2.10D0*AS2RAD  ! Tube flexure (sinz)        
      POI_GD_TX(9)         =   0.00D0*AS2RAD  ! Tube flexure (tanz)        
      POI_GD_HSSA1(9)      =  -3.60D0*AS2RAD  ! sinA term in Asinz         
      POI_GD_HSCA1(9)      =   0.00D0*AS2RAD  ! cosA term in Asinz         
      POI_GD_HZSA1(9)      =   0.00D0*AS2RAD  ! sinA term in z             
      POI_GD_HZCA1(9)      =   3.03D0*AS2RAD  ! cosA term in z             
      POI_GD_HSSA2(9)      =   0.00D0*AS2RAD  ! sin2A term in Asinz        
      POI_GD_HSCA2(9)      =   1.68D0*AS2RAD  ! cos2A term in Asinz        
      POI_GD_HZSA2(9)      =   0.00D0*AS2RAD  ! sin2A term in z            
      POI_GD_HZCA2(9)      =  -0.38D0*AS2RAD  ! cos2A term in z            
      POI_GD_HSSA3(9)      =   2.65D0*AS2RAD  ! sin3A term in Asinz        
      POI_GD_HSCA3(9)      =   0.00D0*AS2RAD  ! cos3A term in Asinz        
      POI_GD_HZSA3(9)      =   0.59D0*AS2RAD  ! sin3A term in z            
      POI_GD_HZCA3(9)      =  -2.26D0*AS2RAD  ! cos3A term in z            
      POI_GD_HZSZ4(9)      =  -1.11D0*AS2RAD  ! sin 4z term in z           
*
* UES optical derotator tracking corrections.
*
* Updated by FJG on 04-Jan-1999
* Based on test data taken on 03-Jan-1999
*
      POI_GD_NCOS1X(9)     =  -0.35936728D-5 ! cos PA term in x
      POI_GD_NSIN1X(9)     =  -0.43582440D-5 ! sin PA term in x
      POI_GD_NCOS1Y(9)     =   0.43582440D-5 ! cos PA term in y
      POI_GD_NSIN1Y(9)     =  -0.35936728D-5 ! sin PA term in y
*
* Nasmyth UES (no rotation)
*
* Identical to Nasmyth UES with derotation.
*
* Last updated: MPF  25-Jan-1999
*
      POI_GD_AXIS1_ZERO(10) =   0.82D0*AS2RAD  ! IA Azimuth zero-point      
      POI_GD_AXIS2_ZERO(10) = -42.86D0*AS2RAD  ! IE Elevation zero-point    
      POI_GD_AXIS1_COLL(10) = 125.48D0*AS2RAD  ! CA Horizontal collimation  
      POI_GD_NP(10)         =   8.65D0*AS2RAD  ! NPAE Non-perpendicularity  
      POI_GD_XTILT(10)      =  39.66D0*AS2RAD  ! x-component of azimuth (AN)
      POI_GD_YTILT(10)      =  13.41D0*AS2RAD  ! y-component of azimuth (AW)
      POI_GD_TF(10)         =   2.10D0*AS2RAD  ! Tube flexure (sinz)        
      POI_GD_TX(10)         =   0.00D0*AS2RAD  ! Tube flexure (tanz)        
      POI_GD_HSSA1(10)      =  -3.60D0*AS2RAD  ! sinA term in Asinz         
      POI_GD_HSCA1(10)      =   0.00D0*AS2RAD  ! cosA term in Asinz         
      POI_GD_HZSA1(10)      =   0.00D0*AS2RAD  ! sinA term in z             
      POI_GD_HZCA1(10)      =   3.03D0*AS2RAD  ! cosA term in z             
      POI_GD_HSSA2(10)      =   0.00D0*AS2RAD  ! sin2A term in Asinz        
      POI_GD_HSCA2(10)      =   1.68D0*AS2RAD  ! cos2A term in Asinz        
      POI_GD_HZSA2(10)      =   0.00D0*AS2RAD  ! sin2A term in z            
      POI_GD_HZCA2(10)      =  -0.38D0*AS2RAD  ! cos2A term in z            
      POI_GD_HSSA3(10)      =   2.65D0*AS2RAD  ! sin3A term in Asinz        
      POI_GD_HSCA3(10)      =   0.00D0*AS2RAD  ! cos3A term in Asinz        
      POI_GD_HZSA3(10)      =   0.59D0*AS2RAD  ! sin3A term in z            
      POI_GD_HZCA3(10)      =  -2.26D0*AS2RAD  ! cos3A term in z            
      POI_GD_HZSZ4(10)      =  -1.11D0*AS2RAD  ! sin 4z term in z           
*
* Initial values of transformation matrices
*                                               
      DO I = 1, 2
        POI_AR_OTMUA(I).ARRAY(1,1)    = 1D0
        POI_AR_OTMUA(I).ARRAY(2,2)    = 1D0
        POI_AR_OTMUA(I).ARRAY(3,3)    = 1D0
        POI_AR_OTMHE(I).ARRAY(1,1)    = 0.481151D0
        POI_AR_OTMHE(I).ARRAY(1,3)    = -0.876638D0
        POI_AR_OTMHE(I).ARRAY(2,2)    = 1D0
        POI_AR_OTMHE(I).ARRAY(3,1)    = 0.876638D0
        POI_AR_OTMHE(I).ARRAY(3,3)    = 0.481151D0
      ENDDO
*
      POI_AD_AX1TILT(1,1) = 1D0         
      POI_AD_AX1TILT(2,2) = 1D0         
      POI_AD_AX1TILT(3,3) = 1D0         
*
*==============================================================================*
*
* Positions global section (_POSGSD, POSITIONS)
* ---------------------------------------------
*
* Cosines of RA_DEC structures and z-components of unit vectors
*
      POS_GR_REF.RA.COS  = 1D0
      POS_GR_REF.DEC.COS = 1D0
      POS_GR_TARGET.Z    = 1D0
*
* Default TV sky PA (slit PA 0)
*
      POS_GD_SKY_PA      = -INS_AD_OFF(INS_GL_INSTRUMENT)
*
*==============================================================================*
*
* Park positions global section (_PRKGSD.INC, PARK)
* -------------------------------------------------
*
      PRK_GL_TOT           = 2
      PRK_AT_KEYW(1)       = 'ZENITH'                     ! Zenith park
      PRK_AT_NAME(1)       = 'Zenith park position'
      PRK_AD_POSITION(1,1) = 5.21219D0                    ! Azimuth
      PRK_AD_POSITION(2,1) = 1.57572D0                    ! Altitude
      PRK_AB_ROT(1)        = .FALSE.
      PRK_AT_KEYW(2)       = 'AP1'                        ! Access park 1
      PRK_AT_NAME(2)       = 'Access park 1 position'
      PRK_AD_POSITION(1,2) = 5.21219D0                    ! Azimuth
      PRK_AD_POSITION(2,2) = 0.34252D0                    ! Altitude
      PRK_AB_ROT(2)        = .FALSE.
*
*==============================================================================*
*
* Synchronous process timing global section (_SYNGSD.INC, SYNC)
* -------------------------------------------------------------
*
      SYN_GL_NHZ        = 20             ! Interrupts/s
      SYN_GL_MED_PERIOD = 1              ! 1 s (ticks)
      SYN_GL_SLO_PERIOD = 300            ! 5 min (ticks)
      SYN_GL_DELAY      = 1              ! 1 s delay as no hardware fix
*
* Pointers for position data
*
      SYN_GL_MED_PTR    = 1
      SYN_GL_SLO_PTR    = 1
      SYN_GL_ASYN_PTR   = 1                             
*
* Set new rotator flag to force call to mnt_choose_wrap first time through
*
      SYN_GL_NEW_ROT = 1
*
*==============================================================================*
*
* Telescope position and optical configuration (_TELGSD.INC, TELESCOP)
* --------------------------------------------------------------------
*
      TEL_AT_TELNAME  = 'William Herschel Telescope'
      TEL_AT_TELKEYW  = 'WHT'
*
      TEL_GD_HEIGHT   =  2344.0D0             ! Height above sea level (m)
      TEL_GD_MEANLAT  =  0.5019669D0          ! Mean geodetic latitude 
*                                             !   of telescope (rad)
      TEL_GD_MEANLONG = -0.3120935D0          ! Mean geodetic longitude
*                                             !   of telescope (rad)
*                                             !   (range: -PI to +PI)
*                                             !   (East positive)
      TEL_GR_LAT.THETA  = TEL_GD_MEANLAT
      TEL_GR_LAT.SIN    = SIN(TEL_GD_MEANLAT)
      TEL_GR_LAT.COS    = COS(TEL_GD_MEANLAT)
      TEL_GR_LONG.THETA = TEL_GD_MEANLONG
      TEL_GR_LONG.SIN   = SIN(TEL_GD_MEANLONG)
      TEL_GR_LONG.COS   = COS(TEL_GD_MEANLONG)
!
! Focal station data
*
      TEL_GL_FOC_STN = 1              ! Default focal station is Cassegrain
      TEL_GL_TOT     = 10
*
* Focal station keywords
*
      TEL_AT_KEYW(1)  = 'CASSEGRAIN'
      TEL_AT_KEYW(2)  = 'PRIME'
      TEL_AT_KEYW(3)  = 'GHRIL_ROT'
      TEL_AT_KEYW(4)  = 'GHRIL_IRDEROT'
      TEL_AT_KEYW(5)  = 'GHRIL_OPTDEROT'
      TEL_AT_KEYW(6)  = 'GHRIL_NOROT'
      TEL_AT_KEYW(7)  = 'UES_ROT'
      TEL_AT_KEYW(8)  = 'UES_UVDEROT'
      TEL_AT_KEYW(9)  = 'UES_OPTDEROT'
      TEL_AT_KEYW(10) = 'UES_NOROT'
* 
* Focal station names
*
      TEL_AT_NAME(1)  = 'Cassegrain'
      TEL_AT_NAME(2)  = 'Prime focus'
      TEL_AT_NAME(3)  = 'GHRIL, instrument rotation'
      TEL_AT_NAME(4)  = 'GHRIL, IR derotation'
      TEL_AT_NAME(5)  = 'GHRIL, optical derotation'
      TEL_AT_NAME(6)  = 'GHRIL, no field rotation'
      TEL_AT_NAME(7)  = 'UES, instrument rotation'
      TEL_AT_NAME(8)  = 'UES derotation, small-field UV'
      TEL_AT_NAME(9)  = 'UES derotation, 5 arcmin field'
      TEL_AT_NAME(10) = 'UES, no field rotation'
*
* Rotator - index into MEC_AR_DAT array
*
      TEL_AL_MECHNUM(1)  = 3
      TEL_AL_MECHNUM(2)  = 4
      TEL_AL_MECHNUM(3)  = 5
      TEL_AL_MECHNUM(4)  = 5
      TEL_AL_MECHNUM(5)  = 5
      TEL_AL_MECHNUM(6)  = 5
      TEL_AL_MECHNUM(7)  = 6
      TEL_AL_MECHNUM(8)  = 6
      TEL_AL_MECHNUM(9)  = 6
      TEL_AL_MECHNUM(10) = 6
*
* Field rotation code - 1 => rotate instrument
*                       2 => rotate optics
*                       3 => static
*
      TEL_AL_ROTCODE(1)  = 1
      TEL_AL_ROTCODE(2)  = 1
      TEL_AL_ROTCODE(3)  = 1
      TEL_AL_ROTCODE(4)  = 2
      TEL_AL_ROTCODE(5)  = 2
      TEL_AL_ROTCODE(6)  = 3
      TEL_AL_ROTCODE(7)  = 1
      TEL_AL_ROTCODE(8)  = 2
      TEL_AL_ROTCODE(9)  = 2
      TEL_AL_ROTCODE(10) = 3
*
* Position angle offset of derotation optics (only used if TEL_AL_ROTCODE = 2)
*
      TEL_AD_DEROT(4)  =  3.6415D0   ! GHRIL (optical derotation)
      TEL_AD_DEROT(5)  =  3.6415D0   ! GHRIL (optical derotation)
      TEL_AD_DEROT(6)  =  3.102D0    ! GHRIL (no rotation)
      TEL_AD_DEROT(8)  = -0.8930D0   ! UES (optical derotation)
      TEL_AD_DEROT(9)  = -0.8930D0   ! UES (optical derotation)
      TEL_AD_DEROT(10) =  0.0D0      ! UES (no rotation)
*
* Correction factor to turntables for field rotation due to change in elevation
*
      TEL_AD_EL_DEPEND(1)  = 0D0   ! No rotation introduced by Nasmyth flat
      TEL_AD_EL_DEPEND(2)  = 0D0   ! No rotation introduced by Nasmyth flat
      TEL_AD_EL_DEPEND(3)  = 1D0   ! Elevation is subtracted from sky position
*                                    angle by reflection from Nasmyth flat
      TEL_AD_EL_DEPEND(4)  = 1D0
      TEL_AD_EL_DEPEND(5)  = 1D0
      TEL_AD_EL_DEPEND(6)  = 1D0
      TEL_AD_EL_DEPEND(7)  = -1D0  ! Elevation is added to sky position angle
*                                    by reflection from Nasmyth flat
      TEL_AD_EL_DEPEND(8)  = -1D0
      TEL_AD_EL_DEPEND(9)  = -1D0
      TEL_AD_EL_DEPEND(10) = -1D0
*
      TEL_GD_SCALE(1)     = 2.162D-5   ! Cassegrain
      TEL_GD_SCALE(2)     = 9.522D-5   ! Prime

      TEL_GD_SCALE(3)     = 2.187D-5   ! Nasmyth foci with
      TEL_GD_SCALE(7)     = 2.187D-5   ! instrument rotation
      TEL_GD_SCALE(6)     = 2.187D-5   ! Nasmyth foci with
      TEL_GD_SCALE(10)    = 2.187D-5   ! no rotation
*
      TEL_GD_SCALE(4)     = 2.153D-5   ! Nasmyth foci with
      TEL_GD_SCALE(5)     = 2.153D-5   ! derotator optics
      TEL_GD_SCALE(8)     = 2.153D-5
      TEL_GD_SCALE(9)     = 2.153D-5
*
* Flag for secondary/tertiary focus (controls use of secondary collimation
* corrections)
*
      TEL_AB_TWOMIRROR(1)  = .TRUE.
      TEL_AB_TWOMIRROR(2)  = .FALSE.    ! Prime
      TEL_AB_TWOMIRROR(3)  = .TRUE.
      TEL_AB_TWOMIRROR(4)  = .TRUE.
      TEL_AB_TWOMIRROR(5)  = .TRUE.
      TEL_AB_TWOMIRROR(6)  = .TRUE.
      TEL_AB_TWOMIRROR(7)  = .TRUE.
      TEL_AB_TWOMIRROR(8)  = .TRUE.
      TEL_AB_TWOMIRROR(9)  = .TRUE.
      TEL_AB_TWOMIRROR(10) = .TRUE.
*
*==============================================================================*
*
* Time global section (_TIMGSD, TIME)
* -----------------------------------
*
* TIM_GD_DELT is the difference between international atomic time and
* terrestral dynamical time (*) and needs 1 adding with next ERPS update
* after each leap second (TAI-UTC+32.184)
      TIM_GD_DELT   =  ((64.184/60)/60)/24     !  TDT-UTC/days 25-Jan-1999
*                                                                              
*
* The array time_gd_erps is filled using the ERPS bulletin
* NB. The numbers in the bulletin are in a different order*
* The bulletin says something like:
* x = 0.0549  - 0.0721 cosA - 0.0349 sinA - 0.1482 cosC - 0.1183 sinC
*     erps(1)   erps(2)       erps(3)      erps(4)       erps(5)
*
* y = 0.3119  - 0.0312 cosA - 0.0568 sinA - 0.1183 cosC + 0.1482 sinC
*     erps(7)   erps(9)       erps(8)       erps(5)       erps(4)
* NB 8 and 9 are the wrong way round.
*
* UT1-UTC = 0.4952  - 0.00203 ( MJD - 48312 )  -(UT2-UT1)
*           erps(11)  erps(12)       erps(13)
*                                    erps(14)
* NB2 13 and 14 are written in the formulae as a negative number, but they
* are entered into OWNINIT.FOR as positive numbers, being Mean Julian Date.
*
* Last updated: RCLARK  07-MAY-1999
*
      TIM_GD_ERPS(1)  =  0.0203D0
      TIM_GD_ERPS(2)  = -0.0586D0
      TIM_GD_ERPS(3)  =  0.0869D0
      TIM_GD_ERPS(4)  =  0.0152D0
      TIM_GD_ERPS(5)  = -0.1447D0
      TIM_GD_ERPS(6)  =  0.0D0        ! always zero
      TIM_GD_ERPS(7)  =  0.3320D0

      TIM_GD_ERPS(8)  =  0.0478D0     ! warning 8 & 9 other way round
      TIM_GD_ERPS(9)  =  0.0805D0     ! in the IERS Bulletin

      TIM_GD_ERPS(10) =  0.0D0        ! always zero
      TIM_GD_ERPS(11) =  0.6158D0
      TIM_GD_ERPS(12) = -0.00104D0
      TIM_GD_ERPS(13) =  51304D0      ! Warning always +ve (MJD) of bulletin
      TIM_GD_ERPS(14) =  51304D0      ! Warning always +ve (MJD) of bulletin
*                     
* MJD of the next leap second 
* Last modified: 17-Apr-1997  MPF
*
* RCLARK 07MAY1999 there will be no leap second
* at the end of June 1999 so
* it should be safe to leave the value 51179 in this variable
* for about 10 months. Making a crontab entry to
* send a mail at the start of december 1999 on ORION.
*
      TIM_GD_LEAP_DAY =  51179D0 ! = 31-Dec-1998 24:00 UT 
*                                                                        
      TIM_GR_LAST.COS = 1D0
*
*==============================================================================*
*
* TV Global section (_TVSGSD, TV)
* -------------------------------
*
* Defaults
*
      TVS_GL_CURRENT_TV = 1         ! Cass slit direct
      TVS_GL_GUIDING    = .FALSE.   ! Autoguiding disabled
      TVS_GL_LOGGING    = .FALSE.   ! Logging disabled
      TVS_GL_TOT        = 6
*
* TV names
*
      TVS_AT_NAME(1)  = 'Cassegrain slit view (4.5 arcsec/mm)'
      TVS_AT_NAME(2)  = 'Cassegrain slit view (12 arcsec/mm)'
      TVS_AT_NAME(3)  = 'Cassegrain field view (4.5 arcsec/mm)'
      TVS_AT_NAME(4)  = 'Cassegrain field view (12 arcsec/mm)'
      TVS_AT_NAME(5)  = 'Cassegrain Shack-Hartmann'
      TVS_AT_NAME(6)  = 'Prime Focus Shack-Hartmann'
*
* TV keywords
*
      TVS_AT_KEYW(1)  = 'SLIT_DIRECT'
      TVS_AT_KEYW(2)  = 'SLIT_REDUCE'
      TVS_AT_KEYW(3)  = 'FIELD_DIRECT'
      TVS_AT_KEYW(4)  = 'FIELD_REDUCE'
      TVS_AT_KEYW(5)  = 'SH_CASS'
      TVS_AT_KEYW(6)  = 'SH_PRIME'
*
* TV timeout
*
      TVS_GL_TIMEOUT = 3
*
* Loop gains
*
      TVS_GR_LOOP_GAIN.XI     = 0.3       ! Loop gain (azimuth)
      TVS_GR_LOOP_GAIN.ETA    = 0.3       ! Loop gain (elevation)
      TVS_GR_MAX_OFFSET.X     = 30.0      ! Limit to accepted
      TVS_GR_MAX_OFFSET.Y     = 30.0      ! guiding offsets.
      TVS_GR_REF_REQSTD.X     = 256.0     ! Guiding reference
      TVS_GR_REF_REQSTD.Y     = 256.0     ! (star-to-field)
      TVS_GL_GUIDE_RAD        = 100       ! Lost guiding radius
*
* Pixel sizes (radians)
*
      TVS_GR_PIXEL_SIZE(1).X  = 8.484D-7     ! camera 8 direct 1989 Jan 21
      TVS_GR_PIXEL_SIZE(1).Y  = 5.042D-7
      TVS_GR_PIXEL_SIZE(2).X  = 3.3936D-6    ! camera 8 reduced 1989 Jan 21
      TVS_GR_PIXEL_SIZE(2).Y  = 2.0168D-6
      TVS_GR_PIXEL_SIZE(3).X  = 8.484D-7     ! camera 8 direct 1989 Jan 21
      TVS_GR_PIXEL_SIZE(3).Y  = 5.042D-7
      TVS_GR_PIXEL_SIZE(4).X  = 3.3936D-6    ! camera 8 reduced 1989 Jan 21
      TVS_GR_PIXEL_SIZE(4).Y  = 2.0168D-6
      TVS_GR_PIXEL_SIZE(5).X  = 0.11*AS2RAD  ! CASS (Shack-Hartmann) PRELIM
      TVS_GR_PIXEL_SIZE(5).Y  = 0.085*AS2RAD ! PRELIM
      TVS_GR_PIXEL_SIZE(6).X  = 0.22*AS2RAD  ! Prime focus (Shack-Hartmann)
      TVS_GR_PIXEL_SIZE(6).Y  = 0.17*AS2RAD  ! direct camera
                                                        !
      TVS_GL_FLIP(1)          = 1            ! RH coordinates
      TVS_GL_FLIP(2)          = 1            ! RH coordinates
      TVS_GL_FLIP(3)          = 1            ! RH coordinates
      TVS_GL_FLIP(4)          = 1            ! RH coordinates
      TVS_GL_FLIP(5)          = 1            ! RH coordinates
      TVS_GL_FLIP(6)          = -1           ! RH coordinates
      TVS_GD_WAVELENGTH       = 0.4D0        ! Microns
      TVS_GD_ROTATION(6)      = 3.14159 + 1.3589  ! PF direct camera
*
      END
