MPO Scripting - Multi-Target Tutorial
MPO Connections makes creating a script that covers several targets very easy by
allowing you to convert the results of a search into a default set of commands.
The Initial Script
The initial script in this example was created by using the feature on the Search page in MPO Connections that creates a script
from those objects found in the search. In short, the Search page uses a "script
template" that is defined in the configuration settings and associates one or more
commands with a Goto command. Each object selected when generating the script from the
search results becomes a Goto command.

The Final Script

The modifications from the initial to final script are not many but do allow the script
to force the camera to 2x2 binning, Dark Keep/Take Light frame mode, loop through the
several GoTo/TakeImage pairs three times, and after the first GoToAsteroid in each loop,
synchronize the scopes position. Again, here's a line by line break down.
Line 1 sets a loop to lines 2 (Arg1) through 13 (Arg2).
Line 2 moves the telescope to the asteroid numbered 895
(Arg1), uses the MPCORB file to generate the position (Arg3), and uses the default
altitude settings in the configuration.
Line 3 uses an AutoMatch to synchronize the scope's
pointing (Arg1 = 1). The script pauses 10 seconds (Arg2) before it takes the image. This
allows the mount to settle in after the previous GoTo command. Also, if the sync routine
needs to move the scope so that it's between the Sync Threshold and the maximum error
(Arg4) in arcminutes, the script pauses Arg2 seconds before going to the next step.
Line 4 forces the binning to 2x2. Remember that
SyncLastPos overwrites the default exposure parameters and so you need to include this
command to make sure the images to follow are at the correct binning.
Line 5 forces the frame mode to Dark, Light Keep. This
takes a single dark and saves it. This dark is then merged automatically with every light
frame taken in the loop. A "purer" approach would be to take light only images
and merge a master dark in your image processing software later. For now, this is
sufficient and certainly works for basic astrometry and photometry. Again, this step is
required after the SyncLastPos command to make sure the frame mode is what's wanted.
Line 6 uses TakeImage to create a 60s dark and then 60s
light, merging the two after the light is taken. The image is saved in the
C:\MPO\IMAGES\A895\20051022 directory with a base name of A895 (Arg2). See Automatic File
Naming for more on how Connections generates file names.
Line 7 moves the telescope to the second asteroid in the
series, 480 Hansa (Arg1). Again, the MPCORB file is used to compute the position (Arg3),
and the default altitude settings are used (Arg4 < 0).
Line 8 Waits 10 seconds (Arg1) before moving to the
TakeImage command.
Line 9 takes only a 60-second light image because the
dark was taken back Line 5 and because of the SetFrameMode command in Line 4. The image is
saved in C:\MPO\IMAGES\A480\20051022 with a base name of A480 (Arg2).
Line 10 moves to 132 Aethra.
Line 11 waits 10-seconds to allow the mount to settle in.
Line 12 takes a 60-second light only image, merging the
dark taken in Line 5. The image is saved in the C:\MPO\IMAGES\A132\20051022 directory with
a base name of A132.
Line 13 checks how many times the loop has been executed.
If this is the 1st through 9th pass through the loop (Arg1 = 10), then the script jumps
back to Line 2 (why? Because Line 1 set the loop to Lines 2 through 13). If this is the
10th pass through the loop, the script jumps to Line 14.
Line 14 shuts down the imaging camera (Arg1 = 1) and then
waits three minutes (Arg2 = 3) to allow the camera to warm up towards ambient temperature.
Line 15 sends the telescope to the home position as
determined by the configuration settings.
This script creates a total of 30 images, ten each of the three asteroids. Because you
were able to generate the bulk of the script commands from the search page, writing this
script required you to write only seven steps, not the 15 in the final script (ResetLoop,
SyncLastPos, SetResolution, SetFrameMode, JumpAfterCount, ShutdownCamera, SendToHome). If
you'd created a script that worked 30 asteroids, you'd have saved a considerable amount of
time.
Of course, as with the example under Working a Single Target, you can add additional
commands to give the script even more power. For example, say you wanted to shoot the
group of asteroids in Script 7 three times and then move to another group. The
JumpAfterCount command in the above script would jump to a ResetLoop that would be
followed by a similar set of commands to the one in the final script.
For a complete review of scripting and script commands in MPO Connections, download the MPO Connections manual.