Page 1 of 2 12 LastLast
Results 1 to 10 of 14
  1. #1
    Join Date
    Nov 2005
    Location
    Virgil, NY
    Posts
    5,990

    Default Question about ASP

    Bob,

    In an ASP script that is called from a tiddler, I need to convert from JNow to J2000. Using AcquireSupport's LocalTopocentricToJ2000() comes to mind.

    The (VBS) call would be

    LocalTopocentricToJ2000 Util.ScriptTelescope.RightAscension, Util.ScriptTelescope.Declination OR
    Call LocalTopocentricToJ2000 (Util.ScriptTelescope.RightAscension, Util.ScriptTelescope.Declination)

    but execution stops with a "block variable" error (or a type error if I just use Telescope.xxx).

    When I've learned how that call finally works, how do I then reach into AcquireSupport to retrieve the calculated J2000 coordinates that are stored there as c_J2000RA and c_J2000Dec?
    Dick
    www.VirgilObservatory.us
    Pier-mounted Meade 12-inch SCT "classic"
    Optec TCF-S focuser
    SBIG CFW-8A and ST7-XMEv
    H-alpha, BVRI, RGB & Clear filters
    FOV ~15’ x 10’



  2. #2
    Join Date
    Oct 2005
    Location
    Mesa, AZ
    Posts
    33,216

    Default

    AcquireSupport is an object, so you have to create it. Do not initialize it, I think you can get away with calling LocalTopocentricToJ2000() with an uninitialized AcquireSupport. Initializing is really heavyweight and requires a lot of stuff to be running,etc.

    Code:
    Set SUP = CreateObject("ACP.AcquireSupport")
    SUP.LocalTopocentricToJ2000 Util.ScriptTelescope.RightAscension, Util.ScriptTelescope.Declination
    YourRA = SUP.J2000RA
    YourDec = SUP.J200Dec
    Set SUP = Nothing  ' Releases it right away
    -- Bob

  3. #3
    Join Date
    Nov 2005
    Location
    Virgil, NY
    Posts
    5,990

    Default

    Bob,
    Thanks for taking the time to look at this. I put in the code you suggested, but still no cigar. Here's a screen dump. The SUP object is created, as you can see from some of the SUP methods that are listed, but the execution does not jump into LocalTopocentricToJ2000() -- I put "stop" in AcquireSupport inside that Sub and it didn't even make it that far. Repeating the Break/Continue stops in the same place.

    The code works like this: If the telescope operates in JNow, go through the "Then" part to convert JNow back to J2000. Otherwise, the "Else" statements work fine for telescopes operating in J2000 already.
    Attached Images Attached Images
    Dick
    www.VirgilObservatory.us
    Pier-mounted Meade 12-inch SCT "classic"
    Optec TCF-S focuser
    SBIG CFW-8A and ST7-XMEv
    H-alpha, BVRI, RGB & Clear filters
    FOV ~15’ x 10’



  4. #4
    Join Date
    Oct 2005
    Location
    Mesa, AZ
    Posts
    33,216

    Default

    Ah... there is no ScriptTelescope for ASP pages!! Change Util.ScriptTelescope to just plain Telescope and tell me what happens.
    -- Bob

  5. #5
    Join Date
    Nov 2005
    Location
    Virgil, NY
    Posts
    5,990

    Default

    I think I already tried this, and got a "type" error. But I don't know whether the script actually jumped into the AcquireSupport code to produce that error. I'll respond later this afternoon when I get home from work.
    Dick
    www.VirgilObservatory.us
    Pier-mounted Meade 12-inch SCT "classic"
    Optec TCF-S focuser
    SBIG CFW-8A and ST7-XMEv
    H-alpha, BVRI, RGB & Clear filters
    FOV ~15’ x 10’



  6. #6
    Join Date
    Nov 2005
    Location
    Virgil, NY
    Posts
    5,990

    Default

    I got the same failed result. I checked all the debug checkboxes in the ACP Preferences, and I see now that the script actually stopped here (error3 - right-hand image), in the conversion routine in AcquireSupport. Then I added a SUP.Initialize statement in my ASP script just after creating the SUP object, and the program stopped earlier in a different place (error4 - left-hand image). I need a little more advice, please.
    Attached Images Attached Images
    Dick
    www.VirgilObservatory.us
    Pier-mounted Meade 12-inch SCT "classic"
    Optec TCF-S focuser
    SBIG CFW-8A and ST7-XMEv
    H-alpha, BVRI, RGB & Clear filters
    FOV ~15’ x 10’



  7. #7
    Join Date
    Oct 2005
    Location
    Mesa, AZ
    Posts
    33,216

    Default

    Oops, yeah AcquireSupport uses the ScriptTelescope object too. You're gonna have to lift the code out of AcquireSupport and tweak it for the ASP environment. CvtJ2000 calls EquDist2 and you'll have to lift that out as well. Actually I suggest you lift Eqdist() and use it, since it is in VBS and has no dependencies on the rectangular coordinate library. EQDist() acts the same as EQDist2()
    -- Bob

  8. #8
    Join Date
    Nov 2005
    Location
    Virgil, NY
    Posts
    5,990

    Default

    Okay. Thanks again. I'll see how this goes.
    Dick
    www.VirgilObservatory.us
    Pier-mounted Meade 12-inch SCT "classic"
    Optec TCF-S focuser
    SBIG CFW-8A and ST7-XMEv
    H-alpha, BVRI, RGB & Clear filters
    FOV ~15’ x 10’



  9. #9
    Join Date
    Nov 2005
    Location
    Virgil, NY
    Posts
    5,990

    Default

    Good suggestions! Works perfectly now. Thank you for your help. I had to convert JScript to VBS (even EquDist() was JScript) and build (er, steal) an ArcCosine function.

    In another message I'll post this ACP Add-on that draws a 30' x 30' map of the sky where the telescope is pointing, using the reference catalog set up in ACP/Preferences for the stars. The Add-on has an .asp file that goes in the .../ac folder, and two new tiddlers - one to call the .asp file and also a "slider" for a brief information pop-up.

    Thanks again.
    Dick
    www.VirgilObservatory.us
    Pier-mounted Meade 12-inch SCT "classic"
    Optec TCF-S focuser
    SBIG CFW-8A and ST7-XMEv
    H-alpha, BVRI, RGB & Clear filters
    FOV ~15’ x 10’



  10. #10
    Join Date
    Oct 2005
    Location
    Mesa, AZ
    Posts
    33,216

    Default

    WOW!!! That sounds way cool Dick!!!
    -- Bob

 

 

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Scripting in ASP
    By Dick Berg in forum Off-Topic Discussions
    Replies: 4
    Last Post: Oct 31, 2012, 00:48
  2. ASP Access Control
    By Michael Cook in forum Add-Ons, Enhancements, and Helper Components
    Replies: 2
    Last Post: Aug 12, 2011, 12:55

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •