Scripting request

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

Scripting request

Post by Forum_2014 »

I really like the plate solve feature in AA5! Would it be possible to add a script command that could be used after a solve and sync to center the scope on a point selected in the solved image?

Forum_2014
Posts: 255
Joined: 03 Dec 2018, 22:33

Re: Scripting request

Post by Forum_2014 »

Using an automatic script this is possible yet, but maybe you need to do that after a manual plate solving and a manual placement of a point over the image.
In this case the functions Image.Ra and Image.Dec do not help since they return the RA and DEC of the center of image.
The functions Image.GetPointX and Y return instead the coordinates (in pixel) of the selected point.
So, something like Image.GetPointRA and DEC could do the job, but starting a script after some manual selection doesn't seem a good solution.
We will add a third autocenter mode (after "by goto" and "by pulse"), based on plate solving, maybe is this what you needed?

My best,
Fabio.

P.S.
The automatic script from the AA manual, for reference:

Code: Select all

....
....
Image.FindCoordinates(ra,de,nstars)
dist = Image.DistanceFrom(ra,de)
if dist > 0.1 then
  print "Centering telescope..."
  Telescope.SyncTo(Image.RA,Image.DEC)
  Telescope.Goto(ra,de)
  Telescope.Wait
endif
The autocenter script centers the object after a GOTO, using the “Find coordinate” (plate solving) feature of Astroart 5. There are two versions of the script, the first one uses the “resync” command of the telescope:

The function “Image.FindCoordinates()” calibrates the image via plate solving. The result is “1” on success or “0” for failure. In the example above we don’t check the return value since the check is performed by the next instruction:

The function “Image.DistanceFrom()” calculates the distance in degrees between the center plate and the given coordinates. If the image is not calibrated, it returns “0”. As you can see, if the distance is higher then 0.1 degrees (6 arcminutes) the telescope is synced to the corrected coordinates and a small GOTO is executed to the object.

This script is safe since a failure in FindCoordinates() does not move the telescope to a wrong position. Depending your system you may reduce the maximum distance to 0.05 degrees (3 arcminutes). Before using this command it’s mandatory to calibrate the Find Coordinates parameters, as explained in the Reference chapter.

Another script is the following one: it doesn’t need a centering GOTO, nor a resync, but the first displaced image is not corrected so the maximum “dist” must be smaller.

Code: Select all

raOff = 0
deOff = 0
...
' <start of cycle>
' <raObj,deObj = read from the object list>
ra = raObj - raOff
de = deObj - deOff
' <Telescope GOTO towards ra,de>
Image.FindCoordinates(ra,de,nstars)
dist = Image.DistanceFrom(ra,de)
if dist > 0.05 then
   raOff = Image.RA - raObj
   deOff = Image.DEC - deObj
endif
....
This script simply keeps track of the difference between the real coordinates (as measured by FindCoordinates) and the object coordinates. This difference is then stored in raOff and deOff to correct the next GOTO. This make since the error increases with time, so this script is useful on a list of many objects (e.g. supernova search).

Measuring the offset in RA and DEC can be used to also in the first example, if your telescope does not support the Resync() command then you may emulate it with the sequence:

Code: Select all

....
if dist > 0.05 then
   raOff = Image.RA - raObj
   deOff = Image.DEC - deObj
   Telescope.Goto(raObj - raOff, deObj - deOff)
   Telescope.Wait
endif
....

Post Reply