Hmm, I'm also getting 24%:

cd /home/weewx/bin

python -c "import weeutil.Moon;print weeutil.Moon.moon_phase(2018,9,15)"

(1,24)


I've created issue #342 <https://github.com/weewx/weewx/issues/342>


-tk

On Sat, Sep 15, 2018 at 4:53 PM gjr80 <[email protected]> wrote:

> Likewise on the first part.
>
> Just now my pyephem enabled page shows 41%, a non-pyephem enabled VM shows
> 34%, timeanddate.com shows 40.5%, best I could get from USNO is 41% but I
> am not sure as of what time that is, it is just shown as a 'day' figure.
> Pyephem gives me 40.5641403198% but that is using:
>
> >>> import ephem
> >>> moon = ephem.Moon()
> >>> moon.compute()
> >>> print moon.phase
> 40.5641403198
>
> Your pyephem code gives me
>
> >>> import ephem
> >>> print(ephem.Moon(datetime.date.today()).moon_phase)
> 0.408785965463
> >>> datetime.date.today()
> datetime.date(2018, 9, 16)
>
> but I suspect the variance there is because datetime.date.today() returns
> a date with no time so I suspect that will mean pyephem returns the moon
> phase at midnight today whereas ephem.Moon()  will cause the current time
> to be used instead.
>
> Might need to look into the non-pyephem page 34% value but all the others
> seem completely consistent to me.
>
> Gary
>
> On Sunday, 16 September 2018 09:26:30 UTC+10, Thomas Keffer wrote:
>>
>> Can't help you with the first of your two questions.
>>
>> Regarding the second, when I look at my own skin
>> <http://www.threefools.org/weewx/>, it shows 41% for today. Are you sure
>> you're not looking at an old, perhaps cached, version?
>>
>> -tk
>>
>> On Sat, Sep 15, 2018 at 2:45 PM Philip Kutzenco <[email protected]>
>> wrote:
>>
>>> I've noticed that some information from the DarkSky API as well as
>>> calculated moon phase don't seem to be correct or consistent with other
>>> sources of data on WeeWX. Here's what I have seen:
>>>
>>> *DarkSky API* - I display a minimal 8 day forecast on the Belchertown
>>> Skin. When I pull down the values using the SPI directly with my lat and
>>> long, the values pulled down match what the skin shows. However, If I go to
>>> DarkSky.net using the same location, the values (like min & max temp,
>>> weather icon, precip probability etc.) are usually very different. I'm
>>> pretty tuned into the weather right now as I live in Western North Carolina
>>> and will be impacted by the remains of Florence over the next several days.
>>> What's going on with the DarkSky API?
>>>
>>> *Moon phase* - WeeWX shows the moon phase for today to be a waxing
>>> crescent - 24% (I think that means 24% visible or illuminated). When I do
>>> the calculation using python's ephem module -
>>> *print(ephem.Moon(datetime.date.today()).moon_phase)* - the answer I
>>> get for moon phase is 31.19%. I thought that WeeWX used ephem for that
>>> calculation. On timeanddate.com today's moon phase is 39.5%. At
>>> http://aa.usno.navy.mil, 37% of the moon is illuminated today. Why such
>>> a variation?
>>>
>>> These two items are vexing me. Can someone help explain these anomalies?
>>>
>>> Phil
>>>
>>> --
>>> You received this message because you are subscribed to the Google
>>> Groups "weewx-user" group.
>>> To unsubscribe from this group and stop receiving emails from it, send
>>> an email to [email protected].
>>> For more options, visit https://groups.google.com/d/optout.
>>>
>> --
> You received this message because you are subscribed to the Google Groups
> "weewx-user" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"weewx-user" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to