It can be useful to use a script, for example, to take multiple nod sets with dithers in between or even take a nod set, change filter, take a nod set, dither, etc. Scripts for Clio are written in TCL.


Sample observing scripts are on clio1.lco.cl in the directory /home/obs/Programs/ObsScripts.


Script header

#!/usr/bin/wish
# Declare variables:
global calon coaddtext darkon datacubeon impernod_stored impernod inttext movestatus prefixtext queryaoon step timeout video xnodset ynodset
# Save TCS & AO header info? 0=no, 1=yes
set useTCSAO 1
if {$useTCSAO != $queryaoon} {QueryAO}

Change filter

##########################################################################
## 1. Select filter (choose one below)

######### Blocked ########
send CLIOMOTORS definepos 3 1
######### J + PK50 ########
send CLIOMOTORS definepos 3 2
######### H + PK50 ########
send CLIOMOTORS definepos 3 3
######### Ks + PK50 ########
send CLIOMOTORS definepos 3 4
######### 3.1 um ########
send CLIOMOTORS definepos 3 5
######### 3.3 um ########
send CLIOMOTORS definepos 3 6
######### 3.9 um ########
send CLIOMOTORS definepos 3 7
######### L' ########
send CLIOMOTORS definepos 3 8
######### M' ########
send CLIOMOTORS definepos 3 9
######### Lspec+Clear #######
send CLIOMOTORS definepos 3 10
######### Prism+Lspec #######
send CLIOMOTORS definepos 3 11
######### Br Gamma ########
send CLIOMOTORS definepos 3 12


##########################################################################
## 2. Move to selected filter
send CLIOMOTORS movemotors


##########################################################################
# 3. Focus in the selected filter
# Check the focus, and update if not in focus
exec echo all | nc magadsecsup.lco.cl 7102 | grep BAYSIDE_Z > /tmp/tmpfocus.txt
set fi [open "/tmp/tmpfocus.txt"]
set focusinfo [gets $fi]
set currentfocus [lindex $focusinfo 1]
set newfocus [send CLIOMOTORS checkfocus]
set focusdiff [expr {$currentfocus - $newfocus}]
if {$focusdiff != 0} {
send CLIOMOTORS dofocus
after 5000
}
##########################################################################


Select file name

##########################################################################
## FITS files named:
set prefixtext "Achernar"
UpdatePrefix


Select integration time, coadds, cubes, cal

##########################################################################
## Integration time, coadds, and cubes, and cal frames
set inttext 0
UpdateInt

set coaddtext 1
UpdateCoadd

## 0 = No Cube (Data Co-added like normal Coadds)
## 1 = Cube (Coadds saved as frames in 3-d cube)
set useCube 0
if {$useCube != $datacubeon} {CubeOn}
## (It's actually a toggle)


## 0 = No Cal frames (Just the integration times you asked for)
## 1 = Cal frames (Will save a 0-second 1-coadd file at each new Nod position)
set useCal 0
if {$useCal != $calon} {CalOn}


Choose how many images to take at each position

##########################################################################
## How many images do you want to take in each position?
set impernod 5
UpdateImperNod


Set up the nod/dither vector

##########################################################################
## Set up the nod vector
## Positive X makes the star move to the Left on the detector
## Positive Y makes the star move Down on the detector
## xy nod/dither sizes in arcseconds
set xsize -1.1
set ysize 0.4
set xnodset $xsize
set ynodset $ysize
UpdateNodVector


Send moves to the Bayside stages

##########################################################################
## set dither .5
## Left & right moves the Y stage
## right2 moves the star to the Right
#send MOVEBAYSIDES right2 $dither
#send MOVEBAYSIDES left2 $dither
## Up & down moves the X stage:
#send MOVEBAYSIDES up2 $dither
#send MOVEBAYSIDES down2 $dither


Take data

##########################################################################
## Take data
## NImg = Take data here without moving
#NImg
## NNod = AB
#NNod
## NNod_ABBA = ABBA
#NNod_abba






-Alycia Weinberger, 2014/04/13
-Katie Morzinski, 2014/10/31