Script for fast moving objects

Scripts and programs to automate Astroart
Post Reply
Forum_2016
Posts: 220
Joined: 08 Dec 2018, 13:30

Script for fast moving objects

Post by Forum_2016 »

Hello, here is a script for taking several images of moving objects, where the telescope must be moved every N images to recenter the object.

-- TUTORIAL --
(you can test it indoor using the camera and telescope simulator).

1) Go to an ephemeris service web site, for example the MPC:
http://www.minorplanetcenter.net/iau/MPEph/MPEph.html

2) Fill the data as written in the image below, remember to change the option about "Display RA/Dec" and Coordinate format.
Here we will use the asteroid 2015 XD130 at 2016/6/23 02:00 UT. This should be the approximate date/time when you'll actually take the sequence.
3) Get the ephemeris from the web site:
Select a suitable time (for example 02:00) and copy that date/time to the script:

YearInit = 2016
MonthInit = 6
DayInit = 23
HourInit = 02
MinuteInit = 00

Copy the ra/dec data into the script:

RaInit = 21.4718
DeInit = 37.623
RaMotion = -1.40
DeMotion = 1.44

4) That's all, when you launch the script it will take:

NumExposures = 10
ExposureTime = 5.0
TelescopeCenter = 3
Folder = "C:\Temp\"
ObjectName = "2015XD130"

10 exposures, with an exposure time of 5 seconds, with a telescope recenter every 3 images. You may verify that with the simulators.

Code: Select all

' Ephemeris in Universal Time
' example: www.minorplanetcenter.net/iau/MPEph/MPEph.html
' Change these Options:
' 1) "Display R.A./Decl" = decimal units
' 2) "Separate R.A. and Decl. coordinate motion"

YearInit = 2016
MonthInit = 6
DayInit = 23
HourInit = 02
MinuteInit = 00

RaInit = 21.4718
DeInit = 37.623
RaMotion = -1.40
DeMotion = 1.44

NumExposures = 10
ExposureTime = 5.0
TelescopeCenter = 3
Folder = "C:\Temp\"
ObjectName = "2015XD130"

DayInit = DayInit + HourInit/24 + MinuteInit/60/24 
JDInit = DateToJd(YearInit, MonthInit, DayInit)
RaMotion = RaMotion*60*24 / 3600  'Degrees per day 
DeMotion = DeMotion*60*24 / 3600  'Degrees per day

For i = 1 to NumExposures
  ra,de = CalcCoords(JDInit,RaInit,DeInit,RaMotion,DeMotion)
  If Round(i mod TelescopeCenter) = 1 then
     Print "Moving telescope: " ; ra ; " " ; de
     Telescope.Goto(ra,de)
     Telescope.Wait
  End If
  Print "Exposure #" ; i
  TakeImage(i)
Next i

'--------------- Subrotines ---------------

Sub TakeImage(index)
  Camera.Start(ExposureTime)
  Camera.Wait
  fileName = ObjectName + "_" + Format(index,"000")+ ".fit"
  Image.Save(Folder + fileName)
  Image.Close
End Sub

Sub CalcCoords(JDIn,RaIn,DeIn,RaMot,DeMot)
  dJ = JD() - JDIn
  CRa = RaIn + RaMot*dJ / 15
  if CRa >= 24 then CRa = CRa - 24
  if CRa < 0 then CRa = Cra + 24
  CDe = DeIn + DeMot*dJ
  Return CRa,CDe
End Sub

Sub DateToJd(dYear,dMonth,dDay)
  if dMonth <= 2 then
     dYear = dYear - 1
     dMonth = dMonth + 12
  End If
  a = Int(dYear / 100)
  b = 2 - a + Int(a / 4) - 1524.5 + dDay
  r = b + Int(30.6001 * (dMonth+1)) + Int(365.25 * (dYear+4716))
  return r
End Sub

Post Reply