gemini-hlsw / gem

prototype postgres back-end for ocs
Other
15 stars 5 forks source link

Sidereal time calculator #264

Closed swalker2m closed 6 years ago

swalker2m commented 6 years ago

This is work-in-progress on porting "skycalc" into Scala and the new codebase. It adds a basic sidereal time calculation that improves upon the API in the old skycalc lst method.

While researching sidereal time calculation, I learned we are using a really old algorithm that has been subsequently updated (see The International Celestial Reference System).

Greenwich sidereal time (GST), which is a complicated function of both Earth rotation (UT1) and time (not quite the same thing), was replaced by Earth rotation angle (ERA), ...

LST is used in a number of calculations in the old Skycalc code (such as the position of sun, which determines twilight boundaries). I'd like to revisit this issue and consider instead porting the relevant bits of the International Astronomical Union's "Standards of Fundamental Astronomy" library.

swalker2m commented 6 years ago

You'll see I added a gem-math-old.jar library to the coreJVM lib directory. This is just ImprovedSkyCalc and friends. I wanted to use it for comparison and originally placed the source in coreJVM test. Unfortunately that would inexplicably cause the compiler to throw an exception when used so I extracted it out into an unmanaged jar.

Ideally this would only be included on the test classpath but I think at the moment it is just available everywhere in coreJVM.

tpolecat commented 6 years ago

I think you can put the jarfile in modules/core/lib_test/ or something and then say unmanagedJars in (Test, compile) += baseDirectory.value / "lib_test" / "gem-math-old.jar". I think. It almost certainly won't work and you'll have to track down Eugene in Japan to get a real answer but it's worth a try I guess.

tpolecat commented 6 years ago

It's brave of you to reinvestigate SkyCalc, which has been blindly transcribed from language to language for the past 40 years. But I salute you.

swalker2m commented 6 years ago

I couldn't figure out how to do the old SkyCalc jar correctly and hope to take a stab at doing this in a different way anyway.