Results 1 to 4 of 4
  1. #1

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

    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
    Mesa, AZ


    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":

    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


    Thank you Bob! It works!

  4. #4
    Join Date
    Oct 2005
    Mesa, AZ


    You're welcome :-) :-)
    -- 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, 15:25
  2. Moon/Sun Coordinates
    By Dimitris Mislis in forum Add-Ons, Enhancements, and Helper Components
    Replies: 4
    Last Post: Nov 5, 2014, 00: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