Introduction

MaxIm DL, ACP, and PinPoint are a powerful suite of software tools for doing astronomical imaging. They each provide very powerful scripting tools which make just about anything possible!

Script for MaxIm Sequences

Recently I was doing time series on a variable, using the MaxIm sequence feature to take continuous 20-second images. What I needed was a way to add the altitude of the variable star to the FITS header for each image. Fortunately, MaxIm will optionally run a script after each image in the sequence. All I had to do was figure out how to write the script!

So here is what I came up with. It uses PinPoint's Plate Object and the ACP Telescope object (since I use ACP as a telescope hub).

Dim loscope, parm1, p

if WScript.Arguments.Count = 1 then
  parm1 = WScript.Arguments.Item(0)    ' MaxIm passes us the image filename.
else
  WScript.quit
end if

set loscope = CreateObject("ACP.Telescope")
Set p = CreateObject("PinPoint.Plate")

if loscope.Connected then
  p.AttachNoImage parm1
  p.WriteFITSDouble "OBJ-ALT", loscope.Altitude, 2
  p.UpdateFITS
  p.DetachFITS
end if

Set loscope = nothing
set p = nothing

Excel Macro For Star Altitude

Since I already had hundreds of variable star images before I got the script written for Maxim's sequence feature, I needed to write another script to calculate the altitude of the variable star for each image.

I wrote this script as an Excel macro since I had all the JD numbers in a worksheet. Using these along with the observatory's latitude and longitude, and the RA and Dec of the variable, the altitude of the star was easily calculated. This script uses ACP's Util object and Coordinate Transform object.

Sub CalcAlt()
'
' Calculate altitude of star.
'
    Set Util = CreateObject("ACP.Util")
    obylong = "-75:21:06"                   ' Observatory longitude.
    obylat = "+45:05:29"                    ' Observatory latitude.
    ra = Util.DMS_Degrees("08:53:44.20")    ' RA  of variable star.
    dec = Util.DMS_Degrees("+57:48:41.0")   ' Dec of variable star.
    For i = 6398 To 6679                                              ' Range of row numbers.
        jd = Sheets("CCD2008").Cells(i, 20).Value                     ' JD in column T.
        lst = Util.Julian_GMST(jd) + Util.DMS_Degrees(obylong) / 15   ' Convert GMST to LST.
        Set ct = Util.NewCT(Util.DMS_Degrees(obylat), lst)
        ct.RightAscension = ra
        ct.Declination = dec
        Sheets("CCD2008").Cells(i, 19).Value = Round(ct.Elevation, 2)
        Set ct = Nothing
    Next i
End Sub