GetSolarCoords - correct results?
-
Looks like the GetSolarCoords() doesn't return the correct results. Right Ascension (RA) and
Declination (DEC) look OK. They presumably must be, as I have a light that goes on at sunset at the correct time for years.Altitude and Azimuth look incorrect. They both have the hour angle in common, so I'm wondering if it's incorrect and hence the sidereal time. Should be able to convert the angle to hours and check it against this clock:
The formula used looks like Compute sidereal time on this page. Might be some mix up between JD2000 that has a 12 hour offset. Could also be some issue with the hour angle.
I'm assuming all Right Ascension (RA) and
Declination (DEC) are degrees plus & minus from north.Likewise Altitude (ALT) and Azimuth (AZ) are in degrees?
Bit of caution: I haven't looked at this too closely, so may be barking up the wrong tree. It probably doesn't help living near Greenwich.
This site may also be helpful.
PS did you have a look at the link in my last PM?
-
Well, yes, in fact RA should usually be expressed in hours, minutes, and seconds.
Currently, my readings are:
solar_alt 23.461 solar_az -176.763 solar_dec -14.735 solar_ra -37.352
Whereas (with a small time difference) the planetarium software that I use for my astrophotography shows:
Az/Alt +183º 45' / 23º 26' RA/Dec 21:30:35 -14.44
So the only one in question is RA, but 21:30 (15 degrees per hour is) 322.5, or -37.5. So I don't see a problem with this.
Is your location correctly set in Lua_Startup ?
I can't read any of your PMs since the chat page is all screwed up and won't scroll.
Did you try the new Shelly plugin?
AK
-
Well, yes, in fact RA should usually be expressed in hours, minutes, and seconds.
Currently, my readings are:
solar_alt 23.461 solar_az -176.763 solar_dec -14.735 solar_ra -37.352
Whereas (with a small time difference) the planetarium software that I use for my astrophotography shows:
Az/Alt +183º 45' / 23º 26' RA/Dec 21:30:35 -14.44
So the only one in question is RA, but 21:30 (15 degrees per hour is) 322.5, or -37.5. So I don't see a problem with this.
Is your location correctly set in Lua_Startup ?
I can't read any of your PMs since the chat page is all screwed up and won't scroll.
Did you try the new Shelly plugin?
AK
-
Well yes, degrees, apart from the RA, as explained above. However, the coordinate reference for RA and DEC is not Earth-bound coordinates, but celestial ones..., hence don't correspond to N S E, or W, in any simple way. (Tilted coordinate system because of Earth's axis, etc.)
-
You can add a link if you like or you could take over the whole lot in GitHub. I'm still adding stuff from time to time. Main purpose is to advertise. It needs lots of screen captures including from AltUi. Color & movement!
I sorted out the GetSolarCoords() problem. Line 189 in timers.lua in the dev repo:
local J2000 = os.time {year = 2000, month=1, day=1, hour = 12} -- Julian 2000.0 epoch -- prints 946728000 in the Greenwich time zone print(J2000)
In the Greenwich time zone this equals 946728000 ie exactly thirty Julian years where a year is 365.25 Julian days.
Now in my timezone I don't get that value. I have to add (my_timezone_hours * 3600) to get the correct value. Consequently I get incorrect results from GetSolarCoords().
It's weird because I thought Epoch time is the same for every timezone. Maybe anyone reading this post could try this in their time zone.
Now the value is constant, so it's easier to say:
-- exactly thirty Julian years where a year is 365.25 Julian days local J2000 = 946728000
It would be good if the function returned both Greenwich & local Sidereal time in decimal hours (not degrees). Then it's easy to check against an online Sidereal time clock. Not so sure if access to the hour angle variable is of much use.
-- see: theta0 in local_sidereal_time() local GreenwichSiderealTimeHrs = (theta0 % 360)/15 local LocalSiderealTimeHrs = ((theta0 + lng) % 360)/15
Living in Greenwich makes it tricky to code!
-
There’s very little point in storing the history of a variable for which there is a specific formula??
An historian rule for variables of the solar service type, is easily added.