Here's another way to do spiral solving. This is a further adaptation of Bob Denny's spiral solve code from the Visual PinPoint source. We're not limited in size of checkerboard here, and this code fragment is meant to do spiral solving of a pointing exposure to re-sync a very confused telescope.
Function Arbitrary
' real code goes here, does whatever this
' function is supposed to do
' ok, now we're at the point where we need to
' solve an image, so we do so (however you
' want; this just happens to be from a script
' of mine):
Logtext "Plate-solving image."
plate.AttachFITS fn ' Attach the image
plate.RightAscension = ovec.RightAscension ' Set approx coordinates
plate.Declination = ovec.Declination
plate.ArcsecPerPixelHoriz = PointSolveScale ' Set scale factors
plate.ArcsecPerPixelVert = PointSolveScale
plate.UpdateFITS() ' Write this to headers
spiral = false
On Error Resume Next ' Failure here should not be fatal
If Not plate.Solve Then ' Get the real position
' ok, here we check whether the straight
' solve worked. If not, we go to a spiral solution:
If spiral then
' real code goes here, whatever
' else this function is supposed to do.
End Function
Function SpiralSolve (ra, dec, gridlimit)
' careful - don't make 'gridlimit' too high a number. If you
' use ten here, then 440 possible fields will be searched. It
' can get out of hand pretty quickly.
Log "Doing a spiral search to solve this pointing exposure."
dim RAstep
dim Decstep
dim top
dim x
dim y
' Here we calculate the size of the squares in
' the checkerboard we are going to search:
RAstep = ((PointSolveScale * plate.Columns) / (3600 * 15)) / Cos(dec * PI / 180)
Decstep = (PointSolveScale * plate.Rows) / 3600
plate.ArcsecPerPixelHoriz = PointSolveScale ' Set scale factors
plate.ArcsecPerPixelVert = PointSolveScale
' we assume plate is the PinPoint Plate object, and
' that you have already attached an image.
plate.FindImageStars ' Scan the image only once
' counts rows/columns outward from middle
For top = 1 to gridlimit
If abs(x) = top Or abs(y) = top then
plate.RightAscension = ra + (RAstep * x)
plate.Declination = dec + (Decstep * y)
plate.FindCatalogStars
On Error Resume Next
If Not plate.Solve Then
next 'y
SpiralSolve = false