[Remind-Fans] PATCHES for moon illumination and moonrise/set times

Stephen Morgan morgan.stephen99 at gmail.com
Wed Feb 8 06:27:34 EST 2017


Here is a new patch (to replace the original moonrise.patch) which uses the
Stellarium implementation of ELP 2000-82b. As an added bonus, the final
size of the executable has dropped to 1.1MB.

The file elp82b.c can be found here:
https://github.com/Xitian9/Remind/blob/stellarium/src/elp82b.c
I've editted it slightly from the version in Stellarium to remove some
unneeded code and unit conversions.

Best,
Stephen

On 8 February 2017 at 15:12, Stephen Morgan <morgan.stephen99 at gmail.com>
wrote:

> Hello again,
>
> Actually, perhaps a better solution is as follows. Stellarium is a big,
> active, GPL planetarium software project, and their code includes an
> implementation of ELP 2000-82b. It wouldn't necessarily relieve you of any
> due diligence you feel necessary, but I would at least have more confidence
> in the code being well-maintained and free from bugs. I could rewrite the
> function to use their implementation instead; how does that sound?
>
> Their code can be downloaded from
> https://sourceforge.net/p/stellarium/news/2016/12/stellarium-0151/
> and is located in the archive at stellarium-0.15-1/src/core/
> planetsephems/elp82b.{c,h}.
>
> By the way, as a matter of etiquette, I didn't feel I should be spamming
> the list with 3.0MB files, but telling people to download a 150MB archive
> just to extract two files inside is also problematic. Let me know if I
> should send the file myself when I've finished.
>
> Best regards,
> Stephen Morgan
>
> On 7 February 2017 at 10:49, Stephen Morgan <morgan.stephen99 at gmail.com>
> wrote:
>
>> Hello everyone,
>>
>> I've written a couple of patches to add some moon-related functionality
>> to remind. The first is a simple patch to create the moonillum function,
>> which gets the percentage of the moon's surface which is illuminated at a
>> given time.
>>
>> The second patch, which is a bit more troublesome, allows remind to get
>> the times of moonrise and moonset on a given date, accurate to within 3
>> minutes of the United States Naval Observatory moonrise/set tables (RMS
>> variation 0.7 minutes, at least for the dates I've checked).
>>
>> The only problem is that the implementation I've used adds a significant
>> amount of code, mostly copied verbatim from this implementation of ELP
>> 2000-82B (https://github.com/variar/elp2000-82b). This adds 2.7MB of
>> code, and increases the size of the resulting binary from ~500kB to ~3.1MB.
>> This problem could be solved by using a less accurate algorithm which is
>> sufficient for these purposes (using ELP 2000-82B is rather like
>> sandblasting a soup cracker), but that would require a bit more effort to
>> find and code than I'm perhaps willing to put in.
>>
>> Alternately, a preprocessor flag could be added exclude the bulky code if
>> you don't care about the moonrise/set times.
>>
>> To save on space in this email I've omitted the ELP 2000-82B code from
>> the patch. Just copy it directly into a subdirectory elp2000-82b in the src
>> directory.
>>
>> I hope others find these useful!
>>
>> Best regards,
>> Stephen Morgan
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.roaringpenguin.com/pipermail/remind-fans/attachments/20170208/cf6bae8c/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: moonrise-stellarium.patch
Type: text/x-patch
Size: 15807 bytes
Desc: not available
URL: <http://lists.roaringpenguin.com/pipermail/remind-fans/attachments/20170208/cf6bae8c/attachment-0001.bin>


More information about the Remind-fans mailing list