Script commands for sequences

Scripts and programs to automate Astroart
Post Reply
fabdev
Posts: 495
Joined: 03 Dec 2018, 21:43

Script commands for sequences

Post by fabdev » 18 May 2023, 15:15

Astroart 8 SP4 has some new script functions to create a sequence of images. Try the following example after having connected the Camera Simulator:

Code: Select all

if Sequencer.Active then
  print "Sequencer already running"
  Script.Stop
end if
Sequencer.Clear
Sequencer.Add("Light", 3, 10, 1)
Sequencer.Add("Dark", 2, 10, 1)
Sequencer.Autosave(false)
Sequencer.Start
Sequencer.WaitAll 
A real sequence will probably need to save its images, so for example the command "Autosave(false)" could be replaced with: (See below the command "Autosave")

Sequencer.Autosave("NGC_4564", "D:\AstroData\2023-05-11\")

In the example, the sequence is built at run-time with the commands "Add", but it's also possible to open it from the disk with the command "Open".

The command "WaitAll" could be replaced by a cycle with the command "WaitOne", for example:

Code: Select all

while Sequencer.Active
 Sequencer.WaitOne
 print "Image #" ; Sequencer.Index
end while
The list of functions is:

Sequencer.Clear

Resets the sequence and reset the "New window" option.

Sequencer.Add(filter, count, exposure, binning, [focuser])

Adds a row, to build a sequence at run-time, example: Sequencer.Add("R", 10, 60, 2, "AF")

Sequencer.Open(filename)

Opens a sequence from disk, by default from the Sequence Folder, example: Sequencer.Open("LRGB-10-60").

Sequencer.Start

Starts the sequence.

Sequencer.Active

Returns the status of the sequencer, as a boolean value.

Sequencer.WaitAll

Waits until the whole sequence is complete.

Sequencer.WaitOne

Waits for a single exposure.

Sequencer.Index

Returns the index of the current exposure.

Sequencer.Autosave(enable) , Sequencer.Autosave(filename, [folder])

Enables or disables the automatic saving of images and sets the filename and the folder.

Sequencer.Repeat(n)

Sets the "Repeat" option of the sequence.

Sequencer.NewWindow(enable)

Sets the "New Window" option of the sequence, which must NOT be enabled for long sequences. For this reason the option is automatically disabled by the commands "Clear" and "Open".

-------------------------------------------

Until now, sequences had to be coded explicitly, this is still more flexible if you are a programmer. For example:

Code: Select all

Sequ(10, 60.0, 2, "R")
Sequ(10, 60.0, 2, "G")
Sequ(10, 60.0, 2, "B")
Sequ(10, 60.0, 1, "L")

end

sub Sequ(images,exposure,binning,filter)
 Camera.Binning(binning)
 if filter <> "" then 
    Wheel.Goto(filter)
    Wheel.Wait
 end if
 for i = 1 to images
    Camera.Start(exposure)
    Camera.Wait
    fileName = object + filter + Format(i,"000") + ".fit"
    Image.Save(dir + fileName)
    Image.ClosePrevious
    print dir + fileName
 next i
end sub

Post Reply