shukob/CelestialUtil

Inaccurate elevations

begiljen opened this issue · 4 comments

Hi,

I'm trying to calculate a graph from Moon elevations, but when using CelestialUtil with for example 50 sample points from one day, I get a "jagged" graph. It looks like the time tolerance is too rough.

Here is a sample:

startOfDay = [self dateAtBeginningOfDayForDate:startOfDay];
int stepSize=(86400/kNROfSamples);
for(int i=0; i<kNROfSamples; i++)
{
    elev=[[CMMoon new] elevationAtDate:startOfDay inLocation:loc];
    NSLog(@"%f", elev);
    startOfDay = [startOfDay dateByAddingTimeInterval:stepSize];

}

This will create equal values of elevation from several steps in the for-loop.

Hi,
thanks for reporting!

It may because CMCelestialUtitlity#pastJulianYearOfDate do not use minutes/seconds to calculate JY. I'll check this by this weekend.

Hi,
it seems to become smoothed.
Please check it when you have time?

Thank you.

Working great now! Thanks :)

Good to here that ; )