[Kstars-devel] Prakash's KSalmanach

Akarsh Simha akarshsimha at gmail.com
Sat May 23 20:01:20 CEST 2009


> Hello
> 
> I've just checked out summer branch and looked through it. 
> 
> Begin/end time of twilight are calculated incorrectly. One cannot just use 
> linear interpolation to obtain this times. Code below. 
> 
> > double KSAlmanac::getCivilTwilight( bool begin ) {
> >    if(begin) return ( SunRise - 6 * riseRate ); 
> >    return ( SunSet + 6 * riseRate );
> > }
> 
> This way calculated twilights are longer than real. Moreover solution always 
> exist even if sun never goes below 6/12/18 degrees. 

That's right. I suggested the linear interpolation, figuring that the
error will be within 1 minute of time. I requested Prakash to indicate
that in the comments. I don't know if he's done that.

> Right way to do this is to find when Sun goes above/below -6/12/18 deg. as done 
> in SkyObject::riseSetTime. However it will require a lot of changes to that 
> function. 

Hmm... Maybe we should correct that and make it as accurate as KStars
claims to be. Prakash, would you want to do that? Some
code-duplication might be okay. If we really want to avoid code
duplication, I guess we should have a method to compute the fine
position given an approximate position.

Regards
Akarsh


More information about the Kstars-devel mailing list