The classic sequence sub-procedure

Scripts and programs to automate Astroart
Post Reply
Forum_2014
Posts: 253
Joined: 03 Dec 2018, 22:33

The classic sequence sub-procedure

Post by Forum_2014 »

Hello all,
very often I'm being asked how to emulate a sequence via scripts, here are some examples (CCD Interface 5.20 or newer).

1) Simple sequence. It takes three images with an exposure of 5 seconds. (Instead of Image.Close you may disable the option "New window" in the Image tab).

Code: Select all

dir = "C:\Temp\"

Sub Sequence(object,images,exposure)
  for i = 1 to images
     Camera.Start(exposure)
     Camera.Wait
     fileName = object + Format$(i,"000")+ ".fit"
     Image.Save(dir + fileName)
     Image.Close
  next i
End Sub 

Sequence("M42", 3, 5.0)
2) What about filter wheel control? Here's an example:

Code: Select all

Sub Sequence(filter,object,images,exposure)
  Wheel.Goto(filter)
  for i = 1 to images
     Camera.Start(exposure)
     Camera.Wait
     fileName = object + Format$(i,"000")+ ".fit"
     Image.Save(dir + fileName)
     Image.Close
  next i
End Sub 

Sequence("R", "M42", 3, 5.0)
3) Sometimes it's useful to control the index of the sequence, here's a solution:

Code: Select all

dir = "C:\Temp\"

Sub Sequence(object,images,exposure,index)
  for i = 1 to images
     Camera.Start(exposure)
     Camera.Wait
     fileName = object + Format$(i+index,"000")+ ".fit"
     Image.Save(dir + fileName)
     Image.Close
  next i
End Sub 

Sequence("M42", 3, 5.0, 0)
Pause(10)
Sequence("M42", 3, 5.0, 3)
Pause(10)
Sequence("M42", 3, 5.0, 6)

Post Reply