aendie / SkyAlmanac-Py3

Creates the daily pages of a Nautical Almanac using Skyfield (Python 3)
GNU General Public License v3.0
20 stars 3 forks source link

performance, unnecessary function calls #4

Closed quantenschaum closed 1 year ago

quantenschaum commented 1 year ago

I found this in several places

    ra = position.apparent().radec(epoch='date')[0]
    dec = position.apparent().radec(epoch='date')[1]

This performs the apparent and radec calculations twice. Better write

ra, dec, _ = position.apparent().radec('date')
aendie commented 1 year ago

Absolutely correct. Thanks for the tip - I'll correct it in the next update. I have my head deep into Planetary Phenomena currently ;-)

quantenschaum commented 1 year ago

Nice. I also had a take on generating a Nautical Almanac. You may want to have a look into https://github.com/quantenschaum/nautical_almanac

aendie commented 1 year ago

I have now published sfalmanac & skyalmanac 1.11.5. They're the same program now, by the way, so it doesn't matter which you use.

Your suggestion above is implemented. A few other fixes/enhancements are also included.

If you have no other problems, I'll close this issue after a few days.

quantenschaum commented 1 year ago

Nice, sure close it, it was more a remark than an actual bug.