Scripts

The DOT GUI allows you to write an observing program in a very simple language. First there will be some examples and explainations, at the end there is a short reference manual.

  1. My first script
  2. Cadence
  3. Filters
  4. More filters
  5. Relative filter positions
  6. Complex scripts
  7. Other posibilities
  8. Reference
    1. Camera commands
    2. Filter commands
    3. Bursts
    4. Blocks
    5. Miscellaneous commands

My first script

repeat 10
  burst 100
end

The first line, repeat 10, starts a block of commands which will be repeated 10 times. The second line, burst 100, will instruct all cameras which are marked “enabled” in the GUI to take a burst of 100 images. The cameras will all start at the same time. The last line, end, marks the end of the repeat block. Running this script will result in the recording of 10 bursts of 100 images each.

Cadence

repeat 10
  duration 15
    burst 100
  end
end

The second line, duration 15, starts a block of commands that will now take exactly 15 seconds to exectute. Although the burst command will probably only take in the order 10 seconds to finish, the duration block ensures that the start of the next burst will only happen exactly 15 seconds after the start of the previous burst. This ensures that, even if the time it takes to execute the commands within the duration block varies, the bursts will start at regular intervals, so that one can make movies with a fixed cadence. If the commands within the duration block take longer than 15 seconds to finish, the commands will continue to be executed as fast as possible, and a warning will be logged that the commands took longer than 15 seconds.

Filters

repeat 10
  duration 25
    filter HaFilterTune position 6562.3
    burst 100 
    filter HaFilterTune position 6563.3
    burst 100 
  end
end

The third line, filter HaFilterTune position 6562.3, ensures the Halpha filter tunes to 6562.3 Å. The burst in line 4 will only start when the Halpha filter has finished tuning. After the first burst is taken, the Halpha filter will tune to 6563.3 Å, and when it is finished tuning, the second burst will be taken. This type observation is usually called a “2-point Halpha dopplergram”, since it will take bursts in 2 wavelengths (in this case, -0.5 and +0.5 Å from the absolute line center of Halpha).

When running this script, the first time the duration block is run the time the first burst has started is recorded. After the second burst is finished, the GUI will not appear to wait for the 25 seconds to have elapsed, but will tune the Halpha filter immediately back to 6562.3 Å. However, after that it will wait, such that the first burst of the second time the duration block is run will be exactly 25 seconds after the first burst of the first duuration block.

More filters

repeat 10
  duration 25
    filter HaFilterTune position 6562.3
    filter BaFilterTune position 4553.5
    burst 100 
    filter HaFilterTune position 6563.3
    filter BaFilterTune position 4554.5
    burst 100 
  end
end

In this script both the Halpha and Barium filter are tuned. The GUI will start tuning both filters simultaneously, and will only start a burst when both filters have finished tuning. Of course, you can add even more filters and more bursts to the script.

Relative filter positions

filter HaFilterTune origin 6562.8
filter BaFilterTune origin 4554.0

repeat 10
  duration 25
    filter HaFilterTune relative -0.5
    filter BaFilterTune relative -0.5
    burst 100 
    filter HaFilterTune relative +0.5
    filter BaFilterTune relative +0.5
    burst 100 
  end
end

In the first two lines, the origin of relative filter positions is defined. The filters themselves are not tuned. Within the duration block, the filter commands now tune to positions relative to the origin. The above script will perform exactly the same actions as the previous script. However, since the line center will be different for different positions on the Sun due to its own rotation, it is easier and clearer to change just the origin positions in the script, and keep the relative positions unchanged.

Complex scripts

filter HaFilterTune origin 6562.3
filter BaFilterTune origin 4553.0

repeat 10
  duration 900
    repeat 10
      duration 15
        filter HaFilterTune relative -0.5
        filter BaFilterTune relative -0.5
        burst 50 
        filter HaFilterTune relative -0.25
        burst 50 
      end
      duration 15
        filter HaFilterTune relative +0.25
        filter BaFilterTune relative +0.5
        burst 50 
        filter HaFilterTune relative +0.5
        burst 50 
      end
    end
  end
end

The above script uses only commands that have already been introduced. However, it shows how you can have much deeper nesting and more variations. Here is an outline of what the script does:

There are three cadences in this script. The outer cadence is 900 seconds (15 minutes). Within it there is a cadence of 30 seconds, implicitly created by the innermost cadence of 15 seconds. To illustrate what happens, lets first name the bursts. There are four bursts in the script, we will name them “A”, “B”, “C” and “D”. There are two repetition loops in the script, the outer and inner loop. We will now write “3,5,B” to indicate that the outer loop is in its third iteration, the inner loop in its fifth iteration, and that the second burst command in the script is being executed. We will also write down the time as the number of seconds relative to the very first burst taken (1,1,A). We will also assume that 50 images take approximately 5 seconds and Halpha takes approximately 2 seconds to tune. Approximate times are marked with a ~ in front. The following table then illustrates at what times and with what filter settings bursts are taken:

Burst Time Halpha Barium
1,1,A 0 6562.30 4553.5
1,1,B ~7 6562.55 4553.5
1,1,C 15 6563.05 4554.5
1,1,D ~22 6563.30 4554.5
1,2,A 30 6562.30 4553.5
1,2,B ~37 6562.55 4553.5
1,2,C 45 6563.05 4554.5
1,2,D ~52 6563.30 4554.5
1,3,A 60 6562.30 4553.5
1,10,C 285 6563.05 4554.5
1,10,D ~292 6563.30 4554.5
2,1,A 900 6562.30 4553.5
2,1,B ~907 6562.55 4553.5

The innermost cadence of 15 seconds is not of importance when one would only be interested in Halpha and Barium images, but it will allow movies to be made with a strict 15 cadence for any of the other channels. The 30 second cadence just follows from having two 15 second duration blocks inside the inner repetition loop. Since the inner loop only repeats 10 times, it will only take 300 seconds to complete. After the inner loop is completed, the GUI will wait 600 seconds because the outer duration block is set to 900 seconds.

Other posibilities

The exec command can be used to start arbitrary programs. One use is for example to run guidercmd to control the guider from the script. This can be used to automate making mosaics with the DOT.

Reference

Camera commands

Ensures that a camera is enabled. If the camera is not online or if it is in a bad state, this will cause an error to be logged and the script will be aborted.

Ensures that a camera is disabled.

Changes the exposure time (in seconds) of a camera.

Filter commands

Tunes a filter to an absolute position (usually in Ångström).

Uses the given position as the origin for relative motions for this filter. The filter is not moved by this command.

Tunes a filter to a position relative to the recorded origin. If no origin command was used, the origin is the position the filter was on at the start of the script.

Switches the filter to a different preset. Usually this is only useful for prefilters which can switch between prominence and continuum modes.

Bursts

Waits for all filters to finish moving, waits until it is synchronised with the current cadence (if applicable), and then instructs all enabled cameras to simultaneously record a burst of count images. An optional numeric id (between 0 and 999) can be given which will be added to the filename of the burst, such that it can later easily be distinguised.

Blocks

Repeats all the commands within this block number times.

Ensures this block will take exactly time seconds. The start of the first burst within a duration block is used as the time reference.

Marks the end of a block.

Miscellaneous commands

Immediately sleeps time seconds.

Executes command as if it was entered in a terminal window. This can be useful to start external programs or scripts between bursts. The GUI waits until the command has finished before continuing with the script. To ensure commands are executed in the backgroun, append a &.