PinPoint Solve

Discussion in 'Scripting and Programming' started by Igor Bednarek, Jun 28, 2018.

  1. Igor Bednarek

    Igor Bednarek Cyanogen Customer

    Joined:
    Jul 23, 2015
    Messages:
    40
    Hello,

    Is it possible to process a PinPoint Solve of the current MaximDL image (which is not already saved in a FITS file) within a script ?

    I already write a script to PinPoint Solve an image and it works perfectly but I need to open an existing file such as :

    Document.OpenFile("FILEPATH")
    Document.PinPointSolve
    Do While Document.PinPointStatus = 3
    Wscript.sleep 1000
    Loop

    Is there any way to avoid this SaveFile and OpenFile and directly use the current MaximDL image shot by the camera ?

    Thanks

    Regards

    Igor
     
    Last edited: Jun 28, 2018
  2. Doug

    Doug Staff Member

    Joined:
    Sep 25, 2014
    Messages:
    6,860
    You need to save it in a temporary file and solve that.
     
  3. Igor Bednarek

    Igor Bednarek Cyanogen Customer

    Joined:
    Jul 23, 2015
    Messages:
    40
    Thanks Doug. This is what I did.

    Now I have another issue. Manually I can solve my current plate (using Search Outward Spiral). Witth script I have got the error "The time limit for plate solving has expired".

    How to fix this time limit please ? And how to set the parameter "Search Outward Spiral" in a script ?

    Thanks

    Regards

    Igor
     
  4. Doug

    Doug Staff Member

    Joined:
    Sep 25, 2014
    Messages:
    6,860
    The spiral feature just changes the starting point RA/Dec position in a growing spiral pattern. Basically if you're way off target you can use that to hopefully find the right location, but it can take a long time. There is no implementation for it in the scripting interface; however, you can do it "manually" from the script simply by revising the RA/Dec starting point. Every time it fails you start again with a different RA/Dec.
     
  5. Igor Bednarek

    Igor Bednarek Cyanogen Customer

    Joined:
    Jul 23, 2015
    Messages:
    40
    I can not do that manually by scripting because when I got this Windows Message "The time limit for plate solving has expired" the script quit without being able to inspect PinPointStatus...
     
  6. Doug

    Doug Staff Member

    Joined:
    Sep 25, 2014
    Messages:
    6,860
    Curious. Will have to investigate that.
     
  7. Igor Bednarek

    Igor Bednarek Cyanogen Customer

    Joined:
    Jul 23, 2015
    Messages:
    40
    Hi Doug,

    Yes I confirm this problem.

    Please try the follownig script (it works as well with Camera and ASCOM Telescope Simulator Drivers correctly configured), first near and then far pointed from the center plate. You will see that when you are too far and the time limit is reached, the script quits without terminating correclty.

    Thanks to let me know

    Regards

    Igor

    -----
    Dim Telescope
    Dim Util
    Dim Document

    Dim Object_RA
    Dim Object_DEC

    Set Telescope = wscript.CreateObject ("ScopeSim.Telescope")
    Set Util = CreateObject ("ASCOM.Utilities.Util")
    Set Document = CreateObject ("MaxIm.Document")
    Set Camera = CreateObject ("MaxIm.CCDCamera")

    Camera.LinkEnabled = True
    Telescope.Connected = True

    Object_RA = Telescope.RightAscension
    Object_DEC = Telescope.Declination

    if Not Camera.LinkEnabled Then
    wscript.echo "Failed to start camera."
    Quit
    End If

    Camera.Expose 1, 1

    Do
    wscript.Sleep 100
    Loop Until Camera.ImageReady

    Camera.SaveImage "c:\temp\Plate_to_Solve.fit"

    Document.OpenFile ("c:\temp\Plate_to_Solve.fit")

    Document.PinPointSolve Object_RA, Object_DEC

    Do While Document.PinPointStatus = 3
    Wscript.sleep 100
    Loop

    If Document.PinPointStatus = 2 Then
    wscript.echo "Center Plate J2000 Coordinates : " & Util.HoursToHMS (Document.CenterRA, "h ", "m ", "s ", 0)

    & " " & Util.DegreesToDMS (Document.CenterDEC, "° ", "' ", """ ", 0) & VbCrLf
    Else
    wscript.echo "No solving solution available"
    End If

    MsgBox "PinPointStatus : " & Document.PinPointStatus

    Document.close

    MsgBox "End of Script"
     
  8. Igor Bednarek

    Igor Bednarek Cyanogen Customer

    Joined:
    Jul 23, 2015
    Messages:
    40
    Hello,

    Using the PinPoint engine itself (instead of Maxim.Document) does the same.

    For example in the following script the "False" condition is never executed in the script because it quits out of the script without writing "No solving solution available" nor continuating normally the end of the script [​IMG]
    [...]

    Plate.Solve

    If Plate.Solved Then
    wscript.echo Plate.RightAscension & " " & Plate.Declination
    Else
    wscript.echo "No solving solution available"
    End If

    Plate.DetachFITS

    MsgBox "End of Script"

    Any idea to avoid this dirty quit ?

    I posted this issue as well on the DC-3 forum. Thanks for your support.

    Regards

    Igor
     
  9. Bob Denny

    Bob Denny Cyanogen Customer

    Joined:
    Oct 12, 2014
    Messages:
    796
    Location:
    DC-3 Dreams, SP, Mesa, Arizona +1 480 396 9700
    I answered this on the DC-3 Communication Center. The short answer is that PinPoint always raises an exception if it cannot complete a call. Use On Error Resume Next then when the call returns test Err.Number for 0 which means success. If non-zero, Err.Description will contain a detailed error message. See the Microsoft VBScript documentation.

    Note that JavaScript is a much better language to use, as is Python with the Windows package, or any of the .NET compiled languages like C#.
     
  10. Igor Bednarek

    Igor Bednarek Cyanogen Customer

    Joined:
    Jul 23, 2015
    Messages:
    40
    Thanks a lot Bob !

    Now it works fine even with Document.PinPointSolve of Maxim DL :)

    I agree regarding VBScript but my purpose 2 weeks ago was to write a very small script for a very simple purpose. 2 weeks ago I knew nothing about scripting and now my last script is more than 150 lines long... I will seriously think about JavaScript, Python or C if I continue to like writing scripts :)

    Regards

    Igor
     

Share This Page