PAKO preparation for 2012
-------------------------
; v9 is at the start of 2012 (copy of v8)
!! preliminary: if you want to use xephem with the position of the telescope displayed in real time
! run the following sequence from the command prompt 
slogin mrt-lx3
ps xa |grep azElToXephem.py & ! check if the script is already running, if not do the following
useNCS
azElToXephem.py &
! once the script is running type:
/vis/xephem/xephem


!!!! 
Interface to NCS
Summary of PAKO user's manual


!   starts a comment line
-   command is continued
@ filename   to execute the script filename

; Telescope fits are in mrt-lx1
/ncsServer/mrt/ncs/data/imbfits/
het or bol

; To start pako
ssh t21@mrt-
gopako
pakodisplay
pako

!!! Check that the NCS knows the current project is t21
!!! otherwise the telescope will not obey you pako commands !
!!! --> look at the OperatorControl screen and/or ask the operator

set project t21
set pi "Alain"
set observer "Xavier"

! If not sending commands (outside normal run) do:
SET DOSUBMIT NO

SET LEVEL 0 0   ! very verbose
SET LEVEL 1 1   ! chatty
SET LEVEL 3 3   ! less
SET LEVEL 5 5   ! none

! Choose one of the 2 azimuth topology possibilities to decide on which end of the 
! azimuth overlap you want to set the origin of the 360 degrees azimuth circle
! May be usefull to avoid a complete turn (>8min) to go from one source ot another
SET TOPOLOGY LOW ! selects to use the azimuth range 60 to 420 degrees 
SET TOPOLOGY HIGH ! selects to use the azimuth range 100 to 460 degrees 

SET ANGLEUNIT arcsec   ! make sure angle units are arcsec.

! Remember to reset offsets!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
OFFSETS /Clear

! total power (no secondary wobbler)
SWTOTAL

! Choose a well known heterodyne instrument or bolometer for pointing purpose
! ASK Samuel
RECEIVER /CLEAR 
! 
! RECEIVER BOLO ! set pointing mobel of MAMBO2
!! Normaly the default backend for bolo is ABBA (MAMBO2 backend) but thide doesn't exist anymore
!! As a consequence NCS does not record FITS files !!! 
!
! Attention if there's an incompatibility between RECEIVER and BACKEND IMBFITS are not created either !!!
! So do can't choose a heterodyne backend with bolo. 
! To do for Oct 2011 (will be different in the future when NIKA will be integrated to Pako):
RECEIVER E090 /Default   
BACKEND /Clear
BACKEND BBC /Default
!
! prepare a catalog
! NIKA.sou (see wiki web) to put in the directory : 
!   t21/pako

! Choose a catalog with a .sou extension
CATALOG SOURCE NIKA.sou
HELP source

! select a source
! No case matching, but name must be full
SOURCE W3OH

! or a planet
SOURCE Mars

! to check the catalog
HELP SOURCE

! Once you have entered an observing mode (See below)
! if you want that the telescope executes your commands do no forget
SET DOSUBMIT YES

! start an observation (MAKE SURE you want that)
START 
! (if you still have DOSUBMIT NO, nothing happens, but the commands 
! are in the queue and they will be executed when SET DOSUBMIT YES)

!!!!!!!!! Observing modes !!!!!!!

! procedure to focus
! to set focus
SET FOCUS 0

! On the fly mode (cover all array pixels) for pointing and alignment. Expensive.
OTFMAP -180 -180 180 -180  - ! offsets at start and end of first otf subscan
  /notf 61 ! number of subscans
  /step 0 6  ! steps between subscans in arcsecond
  /system truehorizon ! projection AzEl is used to define the map
  /totf 36 ! time of a subscan
  /zigzag  ! go back and forth
  /reference no ! not necessary except if there's a conflict with /system

!! Attention to the tracking speed (= subscan length / totf) if you choos >10"/s keep an eye
!! on the tracking errors trackAz and trackEl in real time on the telescope control screen
!! this information is also stored in the FITs files

! Correct pointing to center on the array by giving a and b
OFFSET a b /SYSTEM Nasmyth

! correct the focus
SET FOCUS -1

! Small map to check the focus quickly
OTFMAP -48 -48 48 -48  - ! offsets at start and end of first otf subscan
  /notf 17 ! number of subscans
  /step 0 6  ! steps between subscans in arcsecond
  /system truehorizon ! projection AzEl is used to define the map
  /totf 10 ! time of a subscan
  /zigzag  ! go back and forth

! 4 switching modes (3 useful for bolometers)
! total power
SWTOTAL
! Beam switching
SWBEAM
! wobbler switching negAmplitude posAmplitude  0.6 seconds per phase!
SWWOBBLER -30 +30 /TPHASE 0.6

! Observing modes
CALIBRATE

! pointing cross of given length (in trueHorizon system)
POINTING 120

! skydip
! stop wobbler
SWTOTAL /tphase 0.6
! tip at azimuth 180, scan airmass from 1.1 to 4.1 by steps of 0.6
TIP  180 /airmass 1.1 4.1 0.6 /tsubscan 12.0

! position switching
ONOFF   !
! example (give ON offsets and OFF offsets, 2 positions each, 2 systems)
ONOFF 30 40 /reference -600 -700 projection /SYSTEM projection
! other options (30 seconds per subscan):
/nsubscans 12 /symmetric /tsubscan 30

! projection is RADEC system here
! can use /SYSTEM trueHorizon too

! if wobbler on use the following special mode
! in that case the off position is automatically on the off wobbler position
ONOFF /swwobbler /nsubscans 12 /symmetric /tsubscan 30

! not used by bolometers
TRACK

! everything in J2000
! x=(l-lsource)*cos(b)
! y=b-bsource
! to define the source
SOURCE
! if needs to offset from source use
OFFSET a b /SYSTEM projection
! then it is in x and y as above

! or

OFFSET a b /SYSTEM trueHorizon
! then Delta az= (az-azsource)*cos(elev)
! and  Delta el= elev-elevsource

! or 
OFFSET a b /SYSTEM Nasmyth

! Remember to reset offsets!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
OFFSETS /Clear

!options
/t... refers to time
/n... refers to number
/f... refers to frequency
/temp... refers to temperature

! See example of startup p21

! Pointing
SWBEAM
POINTING /default
START

! Set the corrections
SET POINTING 3.4 -1.2

! Focus (length in mm)
FOCUS 2  /nsubscans 6 /tsubscans 12
START

! enter the correction
SET FOCUS -2.1

! Useful in a script
PAUSE "Sequence Something OK to start ? [c/q]"  ! a chance to check

! and also
SAY " blabla "

! save last command
SAVE name
! retrieve a command
@ command_name