Macro Commands

The following commands and syntax should be used in MAGIC macro files. These commands can also be typed directly into the command window.

This page is also available as a Postscript file (13 kBytes).


abort

syntax: abort
Aborts 'read' and/or 'macro'-execution

aperture

syntax: aperture name
Move the aperture wheel to position 'name'. The named positions are defined in the file $HOME/info/wheel2

syntax: aperture ?
Prints all possible aperture-position names and the actual one.

syntax: aperture fine steps
Moves the aperture wheel 'steps' motor steps. The sign of 'steps' may be positive or negative. 1 degree is about 40 steps. ATTENTION: !!! backlash !!!

area

syntax: area x1 y1 x2 y2
Sets the area of the image that is used for all 'save' operations.
x1/y1: lower left corner
x2/y2: upper right corner

autosave

syntax: autosave {yes,on} [-f n] [-l n] [-r n1 n2] [-1] [-i] [-d]
Enables automatic 'save'-operation after a 'read'. The switches are explained with the save-command.

syntax: autosave {no,off}
Disables automatic 'save'-operation after a 'read'.

syntax: autosave ?
Prints the status of the autosave-flag.

backup

syntax: backup path
Copies all files in the directory 'path' to /dev/ndat (DAT). You must enter the full path (beginning with '/'). You have to set the actual save-path (MAGICPATH) to a different directory than the one to be copied.
The DAT-Tape is NOT rewinded at the beginning or the end of the backup, so you can copy more than one directory to the tape.

syntax: backup -abort
Aborts a running backup.

cassoff

syntax: cassoff angle
Sets 'angle' as the cassegrain-angle for the NSEW orientation.

syntax: cassoff ?
Prints the cassegrain-angle at the NSEW orientation.

casspos

syntax: casspos angle
Sets 'angle' as the actual cassegrain angle.

syntax: casspos ?
Prints the cassegrain-angle realative to NSEW. This is 'actual cass.angle' - 'cassoff'. This value is written into the FITS-headers as CASSPOS.

cd

syntax: cd [directory]
Changes directory for 'save' operations (UNIX style).

charm

syntax: charm position {number,in,out,?}
The parameters 'in' and 'out' move the mirror to the defined in/out position. '?' returns the actual position. 'number' moves it to the absolute position.

syntax: charm move steps
Moves the mirror 'steps' times 20 nanometers.

syntax: charm define {in,out}
Defines the actual mirror position as the in/out position. Recommended values are '0' for the 'out' position and '-5780000' for the 'in' position.

syntax: charm init
Initializes the CHARM mirror position. This procedure may take up to 2 minutes. While initializing you cannot talk to CHARM.

syntax: charm mode {sky,centroid,peak,?}
Defines the CHARM mode.
'sky': Take sky for later subtraction. The mirror is not tip-tilted.
'centroid': Tip-tilt correction using the centroid of the subarray.
'peak': Tip-Tilt correction using the peak-pixel in the subarray.
'cpeak box': Tip-tilt correction unsing the centroid around a box of size 'box'.
'?': returns the actual CHARM mode.

syntax: charm xgain {value,?}
Defines or prints the gain of the piezo-controller in x-direction. Recommended value is -0.84.

syntax: charm ygain {value,?}
Defines or prints the gain of the piezo-controller in y-direction. Recommended value is -0.84.

syntax: charm rotangle {value,?}
Defines or prints the rotation angle for the piezo-controller. Recommended value is 50.

clobber

syntax: clobber {yes,no,on,off}
Enables/disables overwriting existing files. Default is 'no'.

continue

syntax: continue
Continues a paused macro.

crep

syntax: crep n
Sets the cycle repeat count. When starting a measurement with 'read', 'n' images are taken.

ctype

syntax: ctype readmode [parameters]
Sets the cycle-type. Valid cycle-types 'readmode' are:
'rr': reset.read mode (no paramters)
'rrr': reset.read.read mode (no parameters)
'multi': mulitple.endpoint mode (parameter=number of endpoints)
'ramp': ramp mode (parameter=number of ramp points)
'speckle': speckle mode (parameter=number of speckle frames)
'subarray': subarray readouts only parameters: center-x center-y size
'crrr': CHARM-reset.read.read mode parameters: center-x center-y size itime(ms)

syntax: ctype ?
Prints actual cycle-type.

dir

syntax: dir [filenames]
Executes 'ls -l' in current directory. The output stops after 1 page, to proceed with the next page, enter: to abort the output, enter: q

display

syntax: display [-c numcols] [-l colormap]
syntax: ddisplay [-c numcols] [-l colormap]

Starts display-module.
'display' uses 1x1 dots per pixel.
'ddisplay' uses 2x2 dots per pixel.
'tdisply' uses 3x3 dots per pixel.
'numcols' must be in the range 4..240 (default ist 64).
'colormap' must be one of {gray,temp,heat} (default is 'gray').

eng_status

syntax: eng_status
Resquests the engineering status from the camera and prints it on the screen.
After an 'init parameters' command the returned values of 'eng_status' should be like this:
Integration time 0 = 100
Time 0 granularity = 1
Integration time 1 = 500
Time 1 granularity = 1
Cycle type = 3
Cycle type memloc = e49
Cycle repeat count = 1
Pixel time [100 ns] = 15

exit

syntax: exit
Leave the MAGIC-shell. Subprocesses are not killed.

filter

syntax: filter position
Where 'position' is a filter-macro defined in $HOME/info/fmacros. These macros imply the positions of the 2 filter wheels and the lyot-stop position. The aperture wheel is not effected.

syntax: filter ?
Prints list of avaliable filter-macros and the actual one.

fits

syntax: fits
Prints the actual FITS-header. The output stops after 1 page, to proceed with the next page, enter: to abort the output, enter: q

syntax: fits comment text
Sets 'text' in the FITS-header as COMMENT.

syntax: fits mosstep text
Sets 'text' in the FITS-header as MOS-STEP.

help

syntax: help
prints the list of commands

syntax: help command
prints information about command 'command'

history

syntax: history
Prints the command history.

syntax: !!
Repeats the last command.

syntax: !xxx
Repeats the last command that starts with 'xxx'.

infowin

syntax: infowin
Opens a window with system/camera informations.

init

syntax: init system
Initialize wheels, parameters, shared memory data base (executes 'init parametes' and 'init wheels'). Use 'init system' afer a power-on of the camera.

syntax: init wheels
Read filter/aperture - wheel database and move wheels to the ZERO-position. (detent-position). Use 'init wheels' after manual a movement of the wheels.

syntax: init parameters
Ask for username, telescope and camera parameters. Initialize shared memory. Read filter/aperture - wheel database. Set camera parameters to the values in the shared memory. Use 'init parameters' after a change of the optics (e.g. secondary mirror).

interactive

syntax: interactive {on,off,yes,no}
If you use the interactive-mode, the outputs are blocked after 19 lines, until you enter .

syntax: interactive ?
Prints status of the interactive-flag.

itime

syntax: itime time
Set the integration-time 'time' in seconds.

syntax: itime ?
Prints the actual integration-time

kill

syntax: kill process
Sends a 'terminate' to the following subprocesses:
'process' =
- display -> disp,ddisp,tdisp
- infowin -> sawin,sewin
- satcheck -> satcheck

load

syntax: load filename [n]
Loads 'n' FITS-files into the shared memory. Since the shared memory frame-buffers are unsigned short integers, the displayed values may be not correct. You also have to swtich the cycle-type to reset.read (rr).

logfile

syntax: logfile filename
Sets 'filename' as logfile name

syntax: logfile ?
Prints name of logfile.

ls

syntax: ls [switches] [filename]
Executes 'ls' (UNIX style)

lyot

syntax: lyot name
Move the lyot-stop wheel to position 'name'. The named positions are defined in the file $HOME/info/wheel2.

syntax: lyot ?
Prints all possible aperture-position names and the actual one.

macro

syntax: macro filename
Executes the macro 'filename'
This macro-file contains commands like you use with the shell. Be carful when invoking commands like 'read', 'telescope' or 'filter' that run in the background. Make sure that the next command does not conflict with the previous or use the 'sync' command. The default-drectory for the macros is $HOME. If you want to start the macro test.mac in $HOME/macros then enter 'macro macros/test.mac'.
!!! You MUST NOT invoke a macro in a macro !!!

msio

syntax: msio drive command
Sends 'command' to motor-drive 'drive'. (prvileged command)
This command is used for test with the filter-, lyot- and aperture wheels. 'command' uses the syntax of the motor drives: e.g.:
'move 10' moves the motor +10 steps
'move -20' moves the motor -20 steps
'pos 9000' moves the motor to the absolute position 9000
'ver p' returns the absolute position in motor steps
drive = 1: lower filter
2: lyot stop
3: upper filter
4: aperture

next

syntax: next filename
Sets 'filename' as the default-filename. This filename is used, when no filename is given with the 'save' command.

object

syntax: object text
Sets 'text' as object in the FITS-header.

syntax: object ?
Prints the actual object.

observer

syntax: observer name
Sets 'name' as observer in the FITS-header. This name is used as password for the privileged commands.

syntax: observer ?
Prints the actual observer's name.

pause

syntax: pause
Stops macro execution. The macro will be continued by entering the 'continue' command or may be aborted by 'abort'.

polpos

syntax: polpos value
Writes 'value' at keyword POLPOS into the FITS-header.

pwd

syntax: pwd
Shwos actual directory for the 'save' operation. (UNIX style).

quit

syntax: quit
Leaves the MAGIC-shell and kills all subprocesses. (e.g. display,infowin,satcheck ...)

read

syntax: read [n] [-c]
Read 'n' images according to the actual cycle type. Default is the 'crep' parameter.
-c: continous read until 'abort'.

satcheck

syntax: satcheck on [limit]
Switches the saturation check on. The optional limit uses absolute counts of the A/D converter. These counts range from about 10000 - 55000. The non-linearity starts at about 40000 counts, which is the default limit. If 'sound' is on, you get a accoustic warning.

syntax: satcheck off
Switches the saturation check off. This is recomended at intgration times smaller than about 150 ms.

save

syntax: save [-f n] [-l n] [-r n1 n2] [-i] [-1] [-d] [-c] [filename]
Save frames in the shared mamory according to the actual cycle type (ctype).
-f: save from frame 'n' (= 'first frame is')
-l: save upto frame 'n' (= 'last frame is')
-r: save only frames from 'n1' through 'n2'. Default is all.
-i: save the integral of the selected frames.
-1: write all images into one FITS-file (cube).
-d: do not create FITS-files. Just dump the filled shared-memory-framebuffer.
-c: overwrite existing files (for this save-opereation only).
If no filename is given, the default filename is used.

sky

syntax: sky filename
Use 'filename' for sky-subtraction in the display and use this file as SKYFRAME in the FITS-header.

sound

syntax: sound {on,off}
Enables/disables sound after some operations like 'read', 'filter', 'aperture', 'lyot', 'telescope', 'macro', or as a warning if the saturation check is on. Default is 'off'.

syntax: sound ?
Prints the sound status.

sync

syntax: sync [read] [tele] [wheel]
Waits for termination of the read, telescope, filter, lyot-stop and aperture moving process.

telescope

syntax: telescope absolute hr min sec dg min sec [equinox]
Moves the telescope to the absolute position
alpha: 'hr' 'min' sec'
delta: 'dg' 'min 'sec'
Be carefull with negative declinations. If 'dg' = 0 'min' has to have the minus (`-`).

syntax: telescope relative dx dy
Moves the telescope 'dx' 'dy' arc-seconds.

syntax: telescope position
Returns the telescope position.

verbose

syntax: verbose {on,off,yes,no}
If you set 'verbose yes', you will get more output to the screen. e.g. while executing a macro the system will print every command (and the line number), so you always know which macro-line is executed. Default is 'yes'.

syntax: verbose ?
Prints status of the verbose-flag.