Results 1 to 7 of 7

Hybrid View

  1. #1

    Default How can I get Sun altitude in the Java Script?

    Hi!
    I am creating my own script for taking dark frames. I need to be sure the shooting is at dusk. How can I get the altitude of the sun in a java script? Or perhaps there are other ways to determine that the shooting o is at dusk?

  2. #2
    Join Date
    Oct 2005
    Location
    Mesa, AZ
    Posts
    34,002

    Default

    Assuming you have the ASCOM NOVAS COM Positional Astronomy engine, and Kepler Orbit Engine installed (API Docs Included), this should work for you, given the current full Julian Date "JD":

    Code:
    var KT = new ActiveXObject("Kepler.Ephemeris");
    KT.BodyType = 0;                                            // Planet
    KT.Number = 3;                                              // EARTH
    var KA = KT.GetPositionAndVelocity(JD);
    var tvec = new ActiveXObject("NOVAS.PositionVector")
    tvec.x = -KA(0)                                             // Reverse Cartesian vector for Sun from Earth
    tvec.y = -KA(1)
    tvec.z = -KA(2)
    var RA = tvec.RightAscension                                // J2000 Equatorial, convert to alt-az
    var Dec = tvec.Declination
    If you have ACP available you can use its CoordinateTransform to go from RA/Dec to Alt/Az.
    -- Bob

  3. #3

    Default

    Thank you Bob! It works!

  4. #4
    Join Date
    Oct 2005
    Location
    Mesa, AZ
    Posts
    34,002

    Default

    You're welcome :-) :-)
    -- Bob

  5. #5

    Default

    Does anybody know, how to calculate Moon Alt/Az?

  6. #6
    Join Date
    Oct 2005
    Location
    Mesa, AZ
    Posts
    34,002

    Default

    Hi Ivan -- This is a package I put together that permits "Moon" to be a target in an ACP Plan. It uses a modified version of Stephen Moshier's 'aa' program and ACP UserActions. Read the readme's in the zip file and also the info in ACP Help about UserActions.
    Attached Files Attached Files
    -- Bob

  7. #7

    Default

    Thanks, Bob!

 

 

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Scheduler not respecting sun down fires tasks with sun up
    By Yves Van den Broek in forum Help Using the Comunication Center
    Replies: 5
    Last Post: May 31, 2017, 14:25
  2. Moon/Sun Coordinates
    By Dimitris Mislis in forum Add-Ons, Enhancements, and Helper Components
    Replies: 4
    Last Post: Nov 4, 2014, 23:08

Posting Permissions

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