Mike --

Look in AutoFlat.vbs for the function NextDawnDusk(). That will give you the date/time of the upcoming dawn or dusk, given the sun elevation you want to define for "dawn" or "dusk" (e.g. -18 deg for astronomical twilight). It depends on ACP, however, for the Greenwich Mean Sidereal Time and conversion to/from Julian dates. So for Planalyzer, it wouldn't be good as is unless you only wanted to run it on a system that has ACP installed :-))

For info on getting GMST (and it does need to be the mean ST) see


Maybe you can adapt the code.

As for meridian crossings, that's simply the time at which the sidereal time is equal to the right ascension. No ephemeris needed once you can go from loca or julianl time to sidereal time, and the formula on the USNO site above is really simple and plenty accurate for what you're trying to do.

If you need info on Julian conversions I can give you that too.