Re: [weewx-user] Moon phase & pyephem question

2019-02-28 Thread kutzenco
So the visible % is now 26% for both the new and old versions of 
almanac.py/Moon.py and the new version now lists the phase as Waning 
Crescent (as does the old version and WU). 

Phil

On Thursday, February 28, 2019 at 11:29:28 AM UTC-5, kutz...@gmail.com 
wrote:
>
> Here's an interesting piece of data. I'm using Tom's new almanac.py and 
> Moon.py on a testbed version of WeeWX. On my "production" instance of 
> WeeWX, I have the versions of those files originally installed with WeeWX 
> 3.9.1.
>
> On my production instance the moon is listed as 29% visible and is 
> described as "Waning Crescent" (which matches what WU says). On my testbed 
> instance, the moon is listed at 29% visible but is described as "Last 
> Quarter". 
>
> So it looks like the version that Tom updated hasn't yet updated the 
> description from Last Quarter to Waning Crescent. That should have occurred 
> as the visible amount decreased to 40%. I'm not sure if that's due to the 
> variability Tom mentioned or something in the new version that should be 
> changed.
>
> Phil
>
>
> On Wednesday, February 27, 2019 at 9:53:10 PM UTC-5, kutz...@gmail.com 
> wrote:
>>
>> Ah. Right you are. I had put it in the right place, but somehow, I ended 
>> up saving it as moon.py instead of Moon.py. I'm not sure how I did that, 
>> since I thought I copied it, name and all, from the GitHub repository. I 
>> renamed it (after removing the old Moon.py, which was still there) and all 
>> works fine now.
>>
>> Thanks for helping me out.
>>
>> Phil
>>
>> On Wednesday, February 27, 2019 at 8:13:23 PM UTC-5, Thomas Keffer wrote:
>>>
>>> You probably still have the old copy of weeutil/Moon.py. You need this 
>>> one 
>>> . 
>>> Or, you accidentally put it in the weewx directory, instead of the weeutil 
>>> directory.
>>>
>>> -tk
>>>
>>> On Wed, Feb 27, 2019 at 1:31 PM  wrote:
>>>
 Understood. In the meantime, I did try copying your new version of 
 almanac.py into the bin/weewx directory on my testbed weewx (I copied 
 moon.py into the bin/weeutil directory also, though I don't think that 
 matters). I got the attached errors complaining about moon_phase_ts. Did I 
 miss a file updated in an earlier commit?

 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 weewx-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Moon phase & pyephem question

2019-02-28 Thread kutzenco
Here's an interesting piece of data. I'm using Tom's new almanac.py and 
Moon.py on a testbed version of WeeWX. On my "production" instance of 
WeeWX, I have the versions of those files originally installed with WeeWX 
3.9.1.

On my production instance the moon is listed as 29% visible and is 
described as "Waning Crescent" (which matches what WU says). On my testbed 
instance, the moon is listed at 29% visible but is described as "Last 
Quarter". 

So it looks like the version that Tom updated hasn't yet updated the 
description from Last Quarter to Waning Crescent. That should have occurred 
as the visible amount decreased to 40%. I'm not sure if that's due to the 
variability Tom mentioned or something in the new version that should be 
changed.

Phil


On Wednesday, February 27, 2019 at 9:53:10 PM UTC-5, kutz...@gmail.com 
wrote:
>
> Ah. Right you are. I had put it in the right place, but somehow, I ended 
> up saving it as moon.py instead of Moon.py. I'm not sure how I did that, 
> since I thought I copied it, name and all, from the GitHub repository. I 
> renamed it (after removing the old Moon.py, which was still there) and all 
> works fine now.
>
> Thanks for helping me out.
>
> Phil
>
> On Wednesday, February 27, 2019 at 8:13:23 PM UTC-5, Thomas Keffer wrote:
>>
>> You probably still have the old copy of weeutil/Moon.py. You need this 
>> one 
>> . 
>> Or, you accidentally put it in the weewx directory, instead of the weeutil 
>> directory.
>>
>> -tk
>>
>> On Wed, Feb 27, 2019 at 1:31 PM  wrote:
>>
>>> Understood. In the meantime, I did try copying your new version of 
>>> almanac.py into the bin/weewx directory on my testbed weewx (I copied 
>>> moon.py into the bin/weeutil directory also, though I don't think that 
>>> matters). I got the attached errors complaining about moon_phase_ts. Did I 
>>> miss a file updated in an earlier commit?
>>>
>>> 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 weewx-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Moon phase & pyephem question

2019-02-27 Thread kutzenco
Ah. Right you are. I had put it in the right place, but somehow, I ended up 
saving it as moon.py instead of Moon.py. I'm not sure how I did that, since 
I thought I copied it, name and all, from the GitHub repository. I renamed 
it (after removing the old Moon.py, which was still there) and all works 
fine now.

Thanks for helping me out.

Phil

On Wednesday, February 27, 2019 at 8:13:23 PM UTC-5, Thomas Keffer wrote:
>
> You probably still have the old copy of weeutil/Moon.py. You need this one 
> . 
> Or, you accidentally put it in the weewx directory, instead of the weeutil 
> directory.
>
> -tk
>
> On Wed, Feb 27, 2019 at 1:31 PM > wrote:
>
>> Understood. In the meantime, I did try copying your new version of 
>> almanac.py into the bin/weewx directory on my testbed weewx (I copied 
>> moon.py into the bin/weeutil directory also, though I don't think that 
>> matters). I got the attached errors complaining about moon_phase_ts. Did I 
>> miss a file updated in an earlier commit?
>>
>> 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 weewx-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Moon phase & pyephem question

2019-02-27 Thread Thomas Keffer
You probably still have the old copy of weeutil/Moon.py. You need this one
.
Or, you accidentally put it in the weewx directory, instead of the weeutil
directory.

-tk

On Wed, Feb 27, 2019 at 1:31 PM  wrote:

> Understood. In the meantime, I did try copying your new version of
> almanac.py into the bin/weewx directory on my testbed weewx (I copied
> moon.py into the bin/weeutil directory also, though I don't think that
> matters). I got the attached errors complaining about moon_phase_ts. Did I
> miss a file updated in an earlier commit?
>
> Phil
>
> On Wednesday, February 27, 2019 at 4:01:29 PM UTC-5, Thomas Keffer wrote:
>>
>> The problem with skyfield is that it is dependent on numpy, a very large
>> package. I'm reluctant to introduce a new dependency, especially such a
>> large one, just to do almanac calculations.
>>
>> And, as awkward as the pyephem API is, skyfield's is even worse. It
>> requires loading multi-megabyte ephemeris tables before starting. This will
>> complicate the install.
>>
>> Haven't decided yet.
>>
>> -tk
>>
>> On Wed, Feb 27, 2019 at 12:41 PM  wrote:
>>
>>> Tom,
>>>
>>> My understanding is that pyephem is now deprecated (though it will
>>> continue to be available and receive critical bug fixes). See
>>> https://rhodesmill.org/pyephem/. The original developer has a
>>> replacement package called skyfield (https://rhodesmill.org/skyfield/. He
>>> says it is only missing Kelperian orbital elements for comets and
>>> asteroids currently and that he is working to add that. Since you are
>>> working on a Python3 compliant version of WeeWX, is that an opportunity to
>>> have WeeWX use skyfield instead of pyephem?
>>>
>>> phil
>>>
>>> On Wednesday, February 27, 2019 at 2:08:39 PM UTC-5, Thomas Keffer wrote:

 I looked into this and found a couple of small issues, which I've
 corrected in commit c696e4
 
 .

 Be aware that the function you are using does the calculation in local
 time. This has now been changed, and the almanac now uses UTC.

 Finally, it uses a very simple algorithm, which assumes a constant
 synodic month of 29.530588 days. In practice, it can vary by 1% or more
 over the years. So, all results will necessarily be approximate.

 -tk

 On Wed, Feb 27, 2019 at 6:26 AM HoracioDos  wrote:

> Hello.
> I have pyephem installed and Weewx shows "Last quarter" for today Feb
> 27, 2019 but it was yestarday (Feb 26, 2019). I guess it should be "Waning
> Crescent" for today.  When does moon phases change?
> if i run:
> python -c "import weeutil.Moon;print
> weeutil.Moon.moon_phase(2019,2,27)"
> I get this
> (6, 38)
> Thanks in advance!
>
> --
> 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 weewx-user+...@googlegroups.com.
> 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 weewx-user+...@googlegroups.com.
>>> 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 weewx-user+unsubscr...@googlegroups.com.
> 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 weewx-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Moon phase & pyephem question

2019-02-27 Thread kutzenco
Understood. In the meantime, I did try copying your new version of 
almanac.py into the bin/weewx directory on my testbed weewx (I copied 
moon.py into the bin/weeutil directory also, though I don't think that 
matters). I got the attached errors complaining about moon_phase_ts. Did I 
miss a file updated in an earlier commit?

Phil

On Wednesday, February 27, 2019 at 4:01:29 PM UTC-5, Thomas Keffer wrote:
>
> The problem with skyfield is that it is dependent on numpy, a very large 
> package. I'm reluctant to introduce a new dependency, especially such a 
> large one, just to do almanac calculations.
>
> And, as awkward as the pyephem API is, skyfield's is even worse. It 
> requires loading multi-megabyte ephemeris tables before starting. This will 
> complicate the install.
>
> Haven't decided yet.
>
> -tk
>
> On Wed, Feb 27, 2019 at 12:41 PM > wrote:
>
>> Tom,
>>
>> My understanding is that pyephem is now deprecated (though it will 
>> continue to be available and receive critical bug fixes). See 
>> https://rhodesmill.org/pyephem/. The original developer has a 
>> replacement package called skyfield (https://rhodesmill.org/skyfield/. He 
>> says it is only missing Kelperian orbital elements for comets and 
>> asteroids currently and that he is working to add that. Since you are 
>> working on a Python3 compliant version of WeeWX, is that an opportunity to 
>> have WeeWX use skyfield instead of pyephem?
>>
>> phil
>>
>> On Wednesday, February 27, 2019 at 2:08:39 PM UTC-5, Thomas Keffer wrote:
>>>
>>> I looked into this and found a couple of small issues, which I've 
>>> corrected in commit c696e4 
>>> 
>>> .
>>>
>>> Be aware that the function you are using does the calculation in local 
>>> time. This has now been changed, and the almanac now uses UTC.
>>>
>>> Finally, it uses a very simple algorithm, which assumes a constant 
>>> synodic month of 29.530588 days. In practice, it can vary by 1% or more 
>>> over the years. So, all results will necessarily be approximate.
>>>
>>> -tk
>>>
>>> On Wed, Feb 27, 2019 at 6:26 AM HoracioDos  wrote:
>>>
 Hello.
 I have pyephem installed and Weewx shows "Last quarter" for today Feb 
 27, 2019 but it was yestarday (Feb 26, 2019). I guess it should be "Waning 
 Crescent" for today.  When does moon phases change? 
 if i run: 
 python -c "import weeutil.Moon;print weeutil.Moon.moon_phase(2019,2,27)"
 I get this
 (6, 38)
 Thanks in advance!

 -- 
 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 weewx-user+...@googlegroups.com.
 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 weewx-user+...@googlegroups.com .
>> 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 weewx-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Feb 27 16:20:17 Lab-pi weewx[14777]: reportengine: Caught unrecoverable 
exceptio   n in generator 
'weewx.cheetahgenerator.CheetahGenerator'
Feb 27 16:20:17 Lab-pi weewx[14777]:   'module' object has no 
attrib   ute 'moon_phase_ts'
Feb 27 16:20:17 Lab-pi weewx[14777]: forecast: ZambrettiThread: Zambretti: 
saved1 forecast records
Feb 27 16:20:17 Lab-pi weewx[14777]: forecast: ZambrettiThread: Zambretti: 
delet   ed forecasts prior to 1550697617
Feb 27 16:20:17 Lab-pi weewx[14777]:   Traceback (most recent call 
l   ast):
Feb 27 16:20:17 Lab-pi weewx[14777]: File 
"/home/weewx/bin/weewx   /reportengine.py", line 204, in run
Feb 27 16:20:17 Lab-pi weewx[14777]:   obj.start()
Feb 27 16:20:17 Lab-pi weewx[14777]: File 
"/home/weewx/bin/weewx   /reportengine.py", line 300, in 
start
Feb 27 16:20:17 Lab-pi weewx[14777]:   self.run()
Feb 27 16:20:17 Lab-pi weewx[14777]: File 
"/home/weewx/bin/weewx   /cheetahgenerator.py", line 157, 
in run
Feb 27 16:20:17 Lab-pi weewx[14777]:   
self.initExtensions(gen_d   ict[section_name])
Feb 27 16:20:17 Lab-pi weewx[14777]: File 
"/home/weewx/bin/weewx   /cheetahgenerator.py", line 201, 
in initExtensions
Feb 27 16:20:17 Lab-pi weewx[14777]:   
self.se

Re: [weewx-user] Moon phase & pyephem question

2019-02-27 Thread Thomas Keffer
The problem with skyfield is that it is dependent on numpy, a very large
package. I'm reluctant to introduce a new dependency, especially such a
large one, just to do almanac calculations.

And, as awkward as the pyephem API is, skyfield's is even worse. It
requires loading multi-megabyte ephemeris tables before starting. This will
complicate the install.

Haven't decided yet.

-tk

On Wed, Feb 27, 2019 at 12:41 PM  wrote:

> Tom,
>
> My understanding is that pyephem is now deprecated (though it will
> continue to be available and receive critical bug fixes). See
> https://rhodesmill.org/pyephem/. The original developer has a replacement
> package called skyfield (https://rhodesmill.org/skyfield/. He says it is
> only missing Kelperian orbital elements for comets and asteroids
> currently and that he is working to add that. Since you are working on a
> Python3 compliant version of WeeWX, is that an opportunity to have WeeWX
> use skyfield instead of pyephem?
>
> phil
>
> On Wednesday, February 27, 2019 at 2:08:39 PM UTC-5, Thomas Keffer wrote:
>>
>> I looked into this and found a couple of small issues, which I've
>> corrected in commit c696e4
>> 
>> .
>>
>> Be aware that the function you are using does the calculation in local
>> time. This has now been changed, and the almanac now uses UTC.
>>
>> Finally, it uses a very simple algorithm, which assumes a constant
>> synodic month of 29.530588 days. In practice, it can vary by 1% or more
>> over the years. So, all results will necessarily be approximate.
>>
>> -tk
>>
>> On Wed, Feb 27, 2019 at 6:26 AM HoracioDos  wrote:
>>
>>> Hello.
>>> I have pyephem installed and Weewx shows "Last quarter" for today Feb
>>> 27, 2019 but it was yestarday (Feb 26, 2019). I guess it should be "Waning
>>> Crescent" for today.  When does moon phases change?
>>> if i run:
>>> python -c "import weeutil.Moon;print weeutil.Moon.moon_phase(2019,2,27)"
>>> I get this
>>> (6, 38)
>>> Thanks in advance!
>>>
>>> --
>>> 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 weewx-user+...@googlegroups.com.
>>> 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 weewx-user+unsubscr...@googlegroups.com.
> 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 weewx-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Moon phase & pyephem question

2019-02-27 Thread kutzenco
Tom,

My understanding is that pyephem is now deprecated (though it will continue 
to be available and receive critical bug fixes). See 
https://rhodesmill.org/pyephem/. The original developer has a replacement 
package called skyfield (https://rhodesmill.org/skyfield/. He says it is 
only missing Kelperian orbital elements for comets and asteroids currently 
and that he is working to add that. Since you are working on a Python3 
compliant version of WeeWX, is that an opportunity to have WeeWX use 
skyfield instead of pyephem?

phil

On Wednesday, February 27, 2019 at 2:08:39 PM UTC-5, Thomas Keffer wrote:
>
> I looked into this and found a couple of small issues, which I've 
> corrected in commit c696e4 
> 
> .
>
> Be aware that the function you are using does the calculation in local 
> time. This has now been changed, and the almanac now uses UTC.
>
> Finally, it uses a very simple algorithm, which assumes a constant synodic 
> month of 29.530588 days. In practice, it can vary by 1% or more over the 
> years. So, all results will necessarily be approximate.
>
> -tk
>
> On Wed, Feb 27, 2019 at 6:26 AM HoracioDos  > wrote:
>
>> Hello.
>> I have pyephem installed and Weewx shows "Last quarter" for today Feb 27, 
>> 2019 but it was yestarday (Feb 26, 2019). I guess it should be "Waning 
>> Crescent" for today.  When does moon phases change? 
>> if i run: 
>> python -c "import weeutil.Moon;print weeutil.Moon.moon_phase(2019,2,27)"
>> I get this
>> (6, 38)
>> Thanks in advance!
>>
>> -- 
>> 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 weewx-user+...@googlegroups.com .
>> 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 weewx-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Moon phase & pyephem question

2019-02-27 Thread HoracioDos
Thanks Thomas for your answer. I knew that local time is involved somehow 
but I wasn't sure. By the time I wrote this, it was 11:31AM (-0300 UTC) and 
I didn't know when pyephem will calculate the right moon phase for today.

On Wednesday, February 27, 2019 at 4:08:39 PM UTC-3, Thomas Keffer wrote:
>
> I looked into this and found a couple of small issues, which I've 
> corrected in commit c696e4 
> 
> .
>
> Be aware that the function you are using does the calculation in local 
> time. This has now been changed, and the almanac now uses UTC.
>
> Finally, it uses a very simple algorithm, which assumes a constant synodic 
> month of 29.530588 days. In practice, it can vary by 1% or more over the 
> years. So, all results will necessarily be approximate.
>
> -tk
>
> On Wed, Feb 27, 2019 at 6:26 AM HoracioDos  > wrote:
>
>> Hello.
>> I have pyephem installed and Weewx shows "Last quarter" for today Feb 27, 
>> 2019 but it was yestarday (Feb 26, 2019). I guess it should be "Waning 
>> Crescent" for today.  When does moon phases change? 
>> if i run: 
>> python -c "import weeutil.Moon;print weeutil.Moon.moon_phase(2019,2,27)"
>> I get this
>> (6, 38)
>> Thanks in advance!
>>
>> -- 
>> 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 weewx-user+...@googlegroups.com .
>> 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 weewx-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


Re: [weewx-user] Moon phase & pyephem question

2019-02-27 Thread Thomas Keffer
I looked into this and found a couple of small issues, which I've corrected
in commit c696e4

.

Be aware that the function you are using does the calculation in local
time. This has now been changed, and the almanac now uses UTC.

Finally, it uses a very simple algorithm, which assumes a constant synodic
month of 29.530588 days. In practice, it can vary by 1% or more over the
years. So, all results will necessarily be approximate.

-tk

On Wed, Feb 27, 2019 at 6:26 AM HoracioDos  wrote:

> Hello.
> I have pyephem installed and Weewx shows "Last quarter" for today Feb 27,
> 2019 but it was yestarday (Feb 26, 2019). I guess it should be "Waning
> Crescent" for today.  When does moon phases change?
> if i run:
> python -c "import weeutil.Moon;print weeutil.Moon.moon_phase(2019,2,27)"
> I get this
> (6, 38)
> Thanks in advance!
>
> --
> 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 weewx-user+unsubscr...@googlegroups.com.
> 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 weewx-user+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.