next up previous contents
Next: Describing a source Up: Script language Previous: Special sections   Contents

Control structures

As mentioned above, it seems desirable to give the astronomer the capability of organizing subarrays of his own. A subarray is defined as a collection of antennas (note: not baselines) whose data is output together. (That is, baselines between antennas in different subarrays are not processed.) Not all of the data may be meaningingful, for instance if some antennas are missing their full complement of baseband digitizers, but the data are output together, and the validity of that data is handled elsewhere.

Each subarray is conceived as being an entity, with the entity scanning the script until it encounters its own description of the sequence of observations, and then proceeding to execute that sequence with the time steps described therein. A facility is provided to move antennas from one subarray to another, here conceived as having the subarray to which the antenna belongs yield it to another.

Each description of the sequence of observations would look something like this:

$OBSERVE [<subarray name>]
    {
    description of observations, with time steps delimited by '/'
    }

It seems worthwhile to provide looping at the script level, to keep the size of the script small and readability good. The minimum construct for looping would be to provide two qualifiers, which could be applied either to simple observations (delimited by '/') or blocks (here shown delimited by ...):

    REPEAT(<integer number of repeats>)

    UNTIL(<time (either constant or relative)>)

In addition, it is occasionally necessary to specify some parameters differently for some antennas. So we have a block of text ignored by or read only by a specified antenna list.

    { text not containing '/' } [NOT]FOR ( <list of antennas> )

To transfer antennas from one subarray to another we have the special function

    TRANSFER (<subarray name>, <list of antennas>)

An example of the simplest form of $OBSERVE block is below. We presume that setup1 is a macro which organizes frontend switches, LOs, and the correlator, and sgra*, nrao530 and 1749-28 are the names of $SOURCE blocks.

$OBSERVE
    {
    &setup1
    source = nrao530 / UNTIL (15:30:00)
	{
	source = sgra* / UNTIL (.+1:20)
	source = 1749-28 / UNTIL (.+40)
	} REPEAT (60) 
    }

This runs to source nrao530, observes it until 15:30 LST, then starts a set of two minute cycles, with 80 seconds on sgra* and 40 on 1749-28, which continue for the next two hours.

For a more complicated example, suppose the observer wants to assign a few antennas to do a tipping curve for four minutes every 30 minutes. There is a $SOURCE block with name tipcurve.

$MACRO sgracycle 
    {
    source = sgra* / UNTIL (.+1:20)
    source = 1749-28 / UNTIL (.+40)
    }
$MACRO mytipsubarray {2 7 9 17 23}
$OBSERVE main
    {
    &setup1
    source = nrao530 / UNTIL (15:30:00)
	{
	{&sgracycle} REPEAT(13)
	TRANSFER (tipping, &mytipsubarray)
	{&sgracycle} REPEAT(2)
	} REPEAT(4)
    }

$OBSERVE tipping
    {
    &setup1
    source = tipcurve / UNTIL(.+4:00)
    TRANSFER(main, &mytipsubarray)
    }

The first subarray is activated, and does its 13 cycles of source switching. At this point the tipping subarray antennas are transfered to the other subarray, which has been inactive to this point. After the tipping curve is completed, the antennas are transfered back, and the subarray again becomes inactive.


next up previous contents
Next: Describing a source Up: Script language Previous: Special sections   Contents
Kate Weatherall
2000-03-08