SkySolve
– All Sky Plate Solution Utility
SkySolve is a utility I've been developing in my spare time after a discussion with Bob Denny at AIC2008.
It is an application which
is supplied an image and with no prior knowledge of where in the sky it
was taken, it uses a star pattern matching algorithm and reference
database to locate the correct image coordinates.
This makes it especially useful for remote imaging observatories, where
the mount pointing may become incorrect.
The remote operator can simply take an image wherever the scope is
pointing, then use SkySolve to locate the actual current pointing and
then re-sync the scope to get the pointing back on track.
I read a couple of research
papers on
the topic, then extrapolated the processes into my own algorithm,
which I tuned over the course of a 6 month period.
The basic premise is that a reference
database is generated which uses the geometric relationship of sets
of 4 stars to define a “shape” which is then stored in
the database.
Once an image to be matched is fed into
SkySolve, it generates similar shapes from the stars detected in the
image and runs a matching algorithm against the shapes in the
reference database.
If a candidate match is found, the
resulting approximate image coordinates are fed into PinPoint (a
commercial tool from DC3 Dreams) to validate the candidate and to get
a high precision match.
A licensed full version of
PinPoint is
required to do this, since the automation interface is
only available
in the paid version.
The shape matching
algorithm
implemented in SkySolve does not require any initial knowledge of
where in the sky the image was taken, nor does the rotation of axes
inversion (flipping) if the image matter.
The only image parameter SkySolve
requires to be told is the plate scale. This is derived from the FITS
header of the image being processed, so you should ensure that your
image capture application has very accurate values entered for the
telescope focal length and camera pixel size.
An accurate value for the telescope
focal length can be easily determined by using PinPoint to solve an
image. Use the precise result from PinPoint to update the settings in
your capture application.
SkySolve is now ready for a
first
public release. This takes the form of a dual function application
plus a plugin for MaximDL.
The main application performs two
functions – generation of the reference shape databases and All
Sky plate solutions of image files.
The plugin for MaximDL
operates on the
currently selected image open in MaximDL and launches the main
SkySolve application to perform the All Sky plate solve.
The application is
distributed in a
self-extracting archive file. Once this is run, the application
installer will automatically launch, which installs the SkySolve
application and also the SQL server compact edition database engine
from Microsoft. You must accept the Microsoft EULA for the SQL-CE for
the install to proceed.
After the installation is complete, the
application will launch itself, showing the main screen as shown
below.
If it does not already exist, a program
group will be created entitled “John Winfield”, wherein
all my released applications will be found. This will also contain
links to this guide and the release website where updates will be
posted.
The SkySolve main
application screen is
split into two parts:
The right side panel is
used to create
the reference databases.
This uses a star catalog, the same as
is used by PinPoint for local plate solving.
Currently two databases are supported –
the GSC-ACT catalog and the USNO A2.0 catalog.
The GSC catalog is the same GSC1.1 as used by PinPoint. The ACT corrections are automatically applied internally.
Both are available for download from
the Internet, although if you are already using PinPoint you will
probably already have one of these.
The USNO A2.0 catalog is significantly
denser than the GSC-ACT catalog and so contains more stars for narrow
fields of view (fov), but this density also makes it far slower to
access while building up the reference databases.
I would strongly recommend using
the GSC-ACT
catalog.
In my
testing I found this to give good results down to the minimum
practical fov supported by the database generation application of 18
arcmins.
The left side panel is used to configure the tolerance parameters used for solving an image and to specify the path to the image to solve.
Before you can solve any
images, you
must generate corresponding reference databases.
The database generation is a one-off
operation for any given telescope+camera combination, the resulting
database will be used for solving all images of the corresponding
fov.
In order to generate a
reference
database, one must specify the field of view (fov) of the images
which will be solved. Typically a user will only have a few different
telescope+camera combinations, each combination will typically yield
a different fov and thus a database will need to be generated for
each.
The “Reference FOV” setting
is measured in arc-minutes (arcmins).
The value to be entered should be that
of the smallest dimension, e.g. for a setup which yields an image fov
of 28.3arcmins by 18.1arcmins, a value of 19 should be entered.
The value entered should be as accurate
as possible – do not “pad” it or round up or down,
but rather enter the next largest integer value than the smallest fov
dimension.
If desired, the area the
database is to
cover can be restricted to just the sky visible above your local
horizon. Restricting the are to just that which will be imaged speeds
up database generation and subsequent solutions.
The “Low Dec” and “High
Dec” values are the lower and upper bounds of Declination which
will be covered by the database. The values are in degrees, from -90
to +90.
For example, from my location in
California, I can't image below a Declination of -50 degrees, so I
can set my “Low Dec” to -50 and my “High Dec”
to 90.
The “Catalog Type”
drop-down allows the user to select either the GSC-ACT start catalog
or the USNO A2.0 star catalog. As mentioned above, I would recommend
currently using the GSC-ACT catalog for speed.
The “Catalog Path” must
point to the base folder containing the catalog – this is the
same path you would normally configure for PinPoint.
There is a browse button to allow you
to browse for the catalog base folder.
Once you have configured
the above
settings, press the “Create Database” button and the
reference database will be created.
N.B.
The database generation process is very computationally expensive.
Generating a reference database for the smallest
GSC-ACT
fov (18 arcmins) can take 4 days
and it generates a
database of approximately 3.5GB in size, containing over 28 million
reference shapes.
Larger fovs are much
faster to
generate – the database for a fov of 24arcmins takes
approximately 10 hours and is 740MB in size whereas the database for
a fov of 164arcmins only takes about 30 minutes and is 22MB in size.
A warning will be displayed
if you
already have a database for the specified fov you are trying to
generate.
Once a database generation
starts, the
main application window is replaced by a log window, showing
progress. The content of this log window is replicated in the log
file in the SkySolve folder under the user's Documents folder.
As the database grows, a percentage
complete is displayed along with an estimate of the time to complete
the initial shape generation.
Once the shape generation is complete,
there is some database housekeeping and index building to perform,
which can take up to an additional 10% of the shape generation time
again.
The reference databases,
along with
other config files and the log file are stored in the user's
Documents folder, in a sub folder entitled “SkySolve”.
Once you have generated the
reference
databases for the fov of the images you wish to solve, you can use
the left pane of the main application to perform All Sky plate solves
of images.
There are just three
configuration
settings for SkySolve:
“Solve Time Limit”
-
this is the time limit in seconds after which SkySolve will give up
if a solution has not been found. The default value is 600
seconds
(10 minutes).
“Plate Scale
precision”
- this is the level of precision to which the plate scale of the
image is known.
Since the pixel size of the camera is
typically exactly know, this value is typically a reflection of the
precision to which the telescope focal length is known. A very
accurate value can be obtained by using PinPoint to solve an image
taken with the telescope+camera combination.
This field also allows one to relax the
plate scale tolerance somewhat if the plate scale changes over the
surface of the image – typically as a result of image
distortion caused by the optics in the telescope or from things like
focal reducers.
The default value
is 0.01, i.e.
a precision of 1%.
Setting a higher value here will allow
a less stringent match to the reference shape's scale, which may aid
solving of somewhat distorted images, but may result in more false
candidate matches which must be rejected internally, increasing the
solution time.
Increasing this above 0.1 is not
recommended.
“Geometry Tolerance” - this is a factor used to scale up the allowed shape matching tolerances.
The default value
is 1. Using
the default setting of 1 uses the built-in shape matching parameters.
Increasing the value allows a greater
difference between shapes being matched. Use with care - it can
increase the number of false matches but is also useful with
distorted images.
One can increase this value in
fractional steps – try increasing by steps of 0.1 to see if
failed images can be solved.
A max setting of around 2 is
recommended.
Initially, I would
recommend using the
default values and only trying tuning of these values if you have
trouble solving images.
Finally, enter the path to
the image to
solve or use the Browse button to select an image, then press the
“Solve” button.
Once an image solving run
starts, the
main application window is replaced by a log window, showing
progress. The content of this log window is replicated in the log
file in the SkySolve folder under the user's Documents folder.
For convenient access to
the SkySolve
application, I have also created a plugin for MaximDL.
This plugin takes the form of a file
named “skysolve_plugin.dll” which will be found in the
SkySolve folder in the user's Documents folder.
To install this plugin into
MaximDL,
simply launch MaximDL and select the “Add/Remove plug-in...”
option from the Plugin menu.
In the window which opens, click the
Browse button, then navigate to the Documents\SkySolve directory and
select the “skysolve_plugin.dll” file and click OK. Then
click Close to close the plugin management window.
You will now have a new
option on the
MaximDL plugin menu entitled “SkySolve”.
Now, you can run SkySolve
against any
open MaximDL image by simply selecting “SkySolve” from
the plugin menu.
This will automatically
pass the open
image to SkySolve and display the standard log window while it
attempts to find an All Sky plate solution.
If it is unsuccessful, an
error message
will be displayed, but if it is successful it will set the “OBJCTRA”
and “OBJCTDEC” FITS keys in the image to the coordinates located by SkySolve and then automatically launch
PinPoint to update the image FITS header with the detailed PinPoint
plate solution based on the coordinates located by SkySolve.
Once the SkySolve plugin is
installed
into MaximDL, it presents an automation interface which makes
scripted All Sky plate solves possible.
The SkySolve plug can be
accesses by
the object name “SkySolve.PlugIn”
It provides two methods:
“Solve” - this takes a
MaximDL document as a parameter and performs a SkySolve solution on
it
“PlateSolveOK()” this
returns a boolean type – true if the previous solution attempt
was successful, false if not.
When
accessing the scripting interface
directly, all popup messages are suppressed, so it is safe to use in
a fully automated configuration.
An example of a vbs script
to perform a
SkySolve of files dragged onto the script is shown below:
'-----------------------------------------------
Dim
plugin
Dim
doc
Set
plugin = CreateObject("SkySolve.PlugIn")
Set
fso = CreateObject("Scripting.FileSystemObject")
Set
doc = CreateObject( "MaxIm.Document" )
If
wscript.Arguments.Count = 0 Then
MsgBox
"No argument filenames were provided"
wscript.Quit
End
If
If
wscript.Arguments.Count = 1 Then
'Assume
only one argument means it is a folder
If
fso.FolderExists(wscript.Arguments(0)) Then
Set
folder = fso.GetFolder(wscript.Arguments(0))
Set
fc = folder.Files
For
Each f1 in fc
ProcessIt(f1.path)
Next
Else
'Folder
does not exist, so process argument as a file
ProcessIt(wscript.Arguments(0))
End
If
Else
'Multiple
arguments = files
For
I = 1 To wscript.Arguments.Count
ProcessIt(wscript.Arguments(
I - 1 ))
Next
End
If
Function
ProcessIt(file)
doc.OpenFile
file
plugin.Solve
doc
if
plugin.PlateSolvedOK then
msgbox
"Solved OK :)"
else
msgbox
"Solve failed :("
end
if
'doc.SaveFile
file, 3, false, 1, 1
End
Function
'-----------------------------------------------
Known Issues:
None.Update procedure:
Before installing the update, close MaximDL to ensure the
Plugin file can be correctly overwritten.
If the plugin appears to fail to run after the upgrade, remove it from
MaximDL then re-add it.
Version history:
v1.1 - Initial public release.Feedback:
If you have any comments, questions or feedback about SkySolve, please feel free to contact me via email at: winfij_AT_gmail_DOT_com
Best Regards,
John