INS-DAS-27

Command-and-status interface to DRAMA clients for UltraDAS

Issue 2.2, written on 8th March 2000


Guy Rixon, gtr@mrao.cam.ac.uk

Introduction

Purpose of this document

The interface to the DRAMA client-programmes of UltraDAS is defined formally. The correctness of the client programmes may be judged against this description.

Scope of the interface

Two interfaces are described here. Both are concerned with the client programmes from the software package udas_clients.

The first interface is between UI programmes of UltraDAS and the command-translator polymorph. This is both an internal interface, between UltraDAS' GUI programmes and polymorph, and a user interface, since UI may be a standard shell and the user may give these user commands directly or from a script.

The second interface is between polymorph and the client programmes themselves.  This is an internal interface of UltraDAS and users are not expected to type these client commands at the terminal.

There are a few clients whose client commands are issued directly by the UI programmes without translation by polymorph.

The context of client operations is described in more detail in the architecture document for UltraDAS [1].
 

Revisions to the document

Issue 2.1, written on 1999-04-27:
The section on names and environment variables was re-written to take account of configurations with more than one instrument. Udas_run now takes three extra arguments to free it from the need to translate environment variables. Obsdata is removed from the lists as UltraDAS will never need such a command.

Issue 2.2, written on 2000-03-08:
The links to other documents were updated.

 

References

  1. Architecture for UltraDAS

  2. ING document INS-DAS-23 by Guy Rixon.
  3. Server interface for shutter control

  4. ING document INS-DAS-21 by Guy Rixon.
  5. Client-server interface for control of cameras

  6. ING document INS-DAS-24 by Guy Rixon.
     

Camera names, instrument names, and the CIA's environment variables

When an observing system with UltraDAS is started up, the system configuration must be written into the following list of environment variables for the benefit of the command translator polymorph. A camera's formal name is the name under which its server programme logs onto the DRAMA message net.  Typical names are "WFC", "TEK3" and "EEV13"; the names tend to be in upper case. Case is significant in these names.

An instrument's formal name is a name known to both the DAS and the CIA. In UltraDAS, the CIA passes the instrument's
formal name to the DAS as an argument when asking for a run to be archived: this allows the DAS to determine which FITS-header packets to include.  Typical names are IDS, WFC, Musicos, blue and red: the last two refer to the arms of ISIS.  The formal name of the instrument is often the name by which the instrument's server programme logged into the DRAMA message-net, but this is not always the case.  For example, ISIS needs a separate formal name for the blue and red arms, but only has one name in the message net. Case is significant in these names.

Formal names appear both in UltraDAS' configuration files and in the observing-system's start-up scripts and configuration menus. The names must be agreed between the parties maintaining these packages.

The user commands described below each have a camera-choice argument. This indicates which camera and instrument are involved with the command where more than one camera is configured. The camera-choice must match the formal name of the camera or the formal name of the corresponding instrument, but case is not significant in this matching. That is, for a configuration of

INSTRUMENT = "blue red"
CAMERA     = "TEK2 EEV13"
these are all valid run-commands:
run blue 10
run BLUE 10
run tek2 10
run TEK2 10
but
run 10
without the camera-choice argument is too ambiguous to be valid. If only one camera is configured in CAMERA, then the camera-choice argument is optional.

The environment variables are used by polymorph to convert the user commands to client commands according to the list of translations below. The transient-client programmes that implement the client commands do not need to see the environment variables; instead, polymorph feeds the configuration data to the clients on their commands lines.

The datum in TELESCOPE defines the directory in which UltraDAS programmes look for configuration files. The datum in OBSSYS is copied by udas_run into the FITS-header packet observation.
 

User commands, grouped by function

Common features

Data-disposal commands

keep [camera-choice] [title]
translates to
udas_keep camera-name  [title]
and makes an archiveable run from a glance run.

promote [camera-choice] scratch-file-no
translates to
udas_promote camera-name scratch-file-no
and promotes a scratch run to an archivable run.

Readout-format commands

These adjust the format for subsequent readouts.

bin [camera-choice] bin-factor bin-factor
translates to
udas_format camera-name "bin" bin-factor bin-factor
and sets the binning factors in x and y.

rspeed [camera-choice] ro-speed
translates to
udas_format camera-name "rspeed" ro-speed
and selects a readout speed.

window [camera-choice] win-no image-section [frame-no]
translates to
udas_format camera-name  "win-set" win-no image-section [frame-no]
and sets one window.

enable_win [camera-choice]
translates to
udas_format camera-name "win-enable"
and enables previously-set windows.

disable_win [camera-choice]
translates to
udas_format camera-name "win-enable"
and disables previously-set windows.

Run commands

These are command to start one observation and archive it when finished:

arc [camera-choice] exp-time [title]
translates to
udas_run camera-name instrument telescope obssys "1" "arc"  "0" exp-time [title]

bias [camera-choice] [title]
translates to
udas_run camera-name instrument telescope obssys "1" "bias" "0" "0.0" [title]

dark [camera-choice] exp-time [title]
translates to
udas_run camera-name instrument telescope obssys "1" "dark"  "0" exp-time [title]

flash [camera-choice] exp-time [title]
translates to
udas_run camera-name instrument telescope obssys "1" "flash" "0" exp-time [title]

flat [camera-choice] exp-time [title]
translates to
udas_run camera-name instrument telescope obssys "1" "flat" "0" exp-time [title]

run [camera-choice] exp-time [title]
translates to
udas_run camera-name instrument telescope obssys "1" "run"  "0" exp-time [title]

sky [camera-choice] exp-time [title]
translates to
udas_run camera-name instrument telescope obssys "1" "sky" "0" exp-time [title]
 

This is the command to take one observation and save it to a scratch file:

scratch [camera-choice] scratch-file-no exp-time [title]
translates to
udas_run camera-name instrument telescope obssys "1" "scratch" scratch-file-no exp-time [title]
 

This is the command to take and display a glance observation without saving it:

glance [camera-choice] exp-time
translates to
udas_run camera-name instrument telescope obssys "1" "glance"  "0" exp-time
 

These commands do sequences of the basic observation types above:

multarc [camera-choice] n-obs exp-time [title]
translates to
udas_run camera-name instrument telescope obssys n-obs "arc" "0" exp-time [title]

multbias [camera-choice] n-obs [title]
translates to
udas_run camera-name instrument telescope obssys n-obs "bias" "0" "0.0" [title]

multdark [camera-choice] n-obs exp-time [title]
translates to
udas_run camera-name instrument telescope obssys n-obs "dark" "0" "exp-time [title]

multflash [camera-name] n-obs exp-time [title]
translates to
udas_run camera-name instrument telescope obssys n-obs "flash" "0" exp-time [title]

multflat [camera-choice] n-obs exp-time [title]
translates to
udas_run camera-name instrument telescope obssys n-obs "flat" "0" exp-time [title]

multrun [camera-choice] n-obs exp-time [title]
translates to
udas_run camera-name instrument telescope obssys n-obs "run" "0" exp-time [title]

multsky [camera-choice] n-obs exp-time [title]
translates to
udas_run camera-name instrument telescope obssys n-obs "sky" "0" exp-time [title]

multscratch [camera-choice] n-obs scratch-file-no exp-time [title]
translates to
udas_run camera-name instrument telescope obssys n-obs "scratch" scratch-file-no exp-time [title]

multglance [camera-choice] n-obs exp-time [title]
translates to
udas_run camera-name instrument telescope obssys n-obs "glance" "0" exp-time [title]

See the description of udas_run, below, to find the effect of the commands.

Please note that the prefix for the multiple-exposure commands is "mult" with no "i".

Intervention commands

These alter the course of the current observation or sequence of observations.

abort [camera-choice]
translates to
udas_intervene camera-name "abort"
and ends the current observation, discarding the data.

finish [camera-choice]
translates to
udas_intervene camera-name "finish"
and ends the current integration, saving the data.

newtime [camera-choice] exp-time
translates to
udas_intervene  camera-choice  "newtime" exp-time
and changes the length of the current integration.

killmult [camera-choice]
translates to
udas_intervene camera-name  "killmult"
and cancels observations in a sequence that have not yet started.

Shutter commands

This moves the shutter between observations.

shutter  [camera-choice] shutter-pos
translates to
udas_shutter camera-name shutter-pos

Monitoring commands

The clients that monitor the state of cameras are not user commands in the conventional sense: observers don't have to type these commands so there are no short forms and there is no translation stage. See the clients section below for details of the monitoring clients.
 

Data definitions

These are the types of arguments for user commands and client commands.
bin-factor
a binning factor in either the x or y direction: an integer from 1 to 10 inclusive.
camera-choice
The name of a camera, or the name of the corresponding instrument in any mix of case.  See the section on names, above, for details.
camera-name
The formal  name of a camera.
exp-time
integration time in seconds: any non-negative number.
frame-no
the co-ordinate frame for an image section: a non-zero integer. Frame number 0 is the overall detector frame covering the entire camera. Frames with positive numbers are the amplifier frames for particular readout amplifiers.
image-section
a window on the image given in IRAF's image-section notation: [x1:x2,y1:y2] is the window running from x1 to x2 inclusive and from y1 to y2 inclusive. The pixel numbers start at (1,1), not from (0,0).
instrument
the formal name of an instrument.
n-obs
number of observations in a sequence: any positive number.
obssys
the path to the observing system, as extracted from the environment variable OBSSYS.
parameter-name
the formal name of a DRAMA parameter. See the client-server ICDs [2] [3] for lists of parameters.
partition-name
the path-name of a data partition in which UltraDAS creates its data directories. The path-name does not include the final directory name: put  /obsdata/inta rather than /obsdata/inta/19981112.
ro-speed
the name of a readout speed (names are TBD at the time of writing).
scratch-file-no
the number of a scratch file: a positive integer.
shutter-pos
a keyword for shutter position: "open", "shut" or "park". The park position varies from camera to camera.
telescope
the name of the telescope.
title
the title of an exposure given as a string of up to 18 characters (excess characters will be discarded silently). If there is white space in the title, then the title must be passed as a single argument (double quotes are required on the command line).
win-no
number of a readout window: a positive integer with an upper limit that varies from camera to camera.

Client commands

udas_detect_obs

Syntax:
udas_detect_obs camera-name

Semantics:
Every time the camera releases a FITS file, the client writes the name of the file to standard output. The client does not write out the names of files already released when it starts up.

This client is intended to be run as a sub-process of a data-consuming programme such as a logger or the head of data-reduction pipeline. The output from the client would be piped into the parent programme.

The file-names are those seen by the server programme on the DAS computer. If the computer where the client programme is running has different mount-points for the data disc then the names may not be intelligable.

Output syntax:
For each FITS file released, the client writes one line of output containing only the fully-qualified name of the file.

udas_format

Syntax:
udas_format camera-name "bin" bin-factor bin-factor
or
udas_format camera-name "rspeed" ro-speed
or
udas_format camera-name "win-enable"
or
udas_format camera-name "win-disable"
or
udas_format camera-name "win-set" image-section [frame-no]

Semantics:
All forms of the command adjust the current readout format on the named camera.

If frame-no is not given in the "win-set" command, frame 0 (the detector frame) is used.

The command only works when the camera is idle. If the camera is doing a run, format commands are rejected without prejudicing that run. When a format command is accepted, it completes "immediately" and the new format applies to all subsequent observations.
 

udas_intervene

Syntax:
udas_intervene camera-name "abort"
or
udas_intervene camera-name "finish"
or
udas_intervene camera-name "killmult"
or
udas_intervene camera-name "newtime" exp-time

Semantics:
All forms of the command affect the course of the current observation or sequence of observations.

The command fails if no run is in progress. If the command succeeds, it returns immediately; "finish" does not wait for the observation to read out.

udas_monitor

Command syntax:
udas_monitor camera-name parameter-name [parameter-name...]

Semantics:
This command sets up a monitor on one or more DRAMA parameters of a camera server. The current values of the parameters, and the new value each time a parameter changes, are written to standard output. If the parameter is an array or structure, each scalar element of the array is written out as one line of output. If the array or structure members are not scalars, they are decomposed in the same way.

The command is normally run as a sub-process of a mimic programme with the mimic reading the client's output through a pipe.

Output syntax:
Each line has the format:
set parameter-name parameter-value

That is, udas_monitor writes out Tcl! The parameter name for a structure element is the structure name and the element name joined by an underscore. For example: Filter_details_waveband. The parameter name for an array element is the array name and the indices joined by underscores. For example: Transformation_matrix_0_1.
 

udas_keep

Syntax:
udas_keep camera-name  [title]

Semantics:
The command promotes the last observation from a glance to an archived run and saves it to disc with the given title. If the scratch-file number is positive, the command promotes the scratch file to an archived run; in this case the title is not used because the scratch run already has a title.

Keeping a glance fails if the camera is not idle at the time of the command. Keeping an observation that was not a glance saves an extra copy of the observation to disc as an archivable run. The command completes when the data have been sent to disc, which make take up to 30 seconds for a large camera.

udas_promote

Syntax:
udas_promote camera-name scratch-file-number

Semantics:
The command promotes the scratch file with the given number to an archived run.

Scratch files can be promoted while the camera is busy with another run. Promotion should complete within one second.

Promoting a scratch file is allowed while another observation is in progress. This form of the command completes immdiately.

udas_run

Syntax:
udas_run camera-name instrument telescope obssys  n-obs {"arc"|"bias"|"dark"|"flash"|"flat"|"run"|"sky"|"scratch"|"glance"} scratch-file-no exp-time [title]

Semantics:
N-obs observations are made in sequence with the same parameters.

The handling of the integration varies according to the observation type and the demanded integration-time.

If the observation type is "scratch", the camera puts the observation in the scratch file whose number is scratch-file-no. If n-obs is greater than one, a sequence of scratch-file numbers is used, starting at the given number.

If the observation type is "glance", the camera reads the observation into memory but does not release it in a FITS file. Otherwise, the camera releases the observation in an archiveable FITS file.

The command fails if it is given when the camera is not idle.

For most cameras, the run commands complete only after the data have been saved to disk (excepting glance runs). For some very large cameras, the data-saving time would be excessive: for these cameras, the data are saved to disk as a background process in parallel with the next observation.
 

udas_shutter

Syntax:
udas_shutter camera-name shutter-pos

Semantics:
The shutter is moved to the named position and left there.

This command fails if given when the camera is not idle. In particular, it cannot be used during an run. If the command is accepted, it returns when the shutter has completed its movement.