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 <kutz...@gmail.com <javascript:>> 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 >>> <https://github.com/weewx/weewx/commit/c696e468efce806214cd560e1014cb50d382c68c> >>> . >>> >>> 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 <rose...@gmail.com> 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 <javascript:>. >> 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: saved 1 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.search_list_objs.app end(class_(self)) Feb 27 16:20:17 Lab-pi weewx[14777]: **** File "/home/weewx/bin/weewx /cheetahgenerator.py", line 518, in __init__ Feb 27 16:20:17 Lab-pi weewx[14777]: **** formatter=generator.forma tter) Feb 27 16:20:17 Lab-pi weewx[14777]: **** File "/home/weewx/bin/weewx /almanac.py", line 228, in __init__ Feb 27 16:20:17 Lab-pi weewx[14777]: **** self._precalc() Feb 27 16:20:17 Lab-pi weewx[14777]: **** File "/home/weewx/bin/weewx /almanac.py", line 232, in _precalc Feb 27 16:20:17 Lab-pi weewx[14777]: **** (self.moon_index, self._m oon_fullness) = weeutil.Moon.moon_phase_ts(self.time_ts) Feb 27 16:20:17 Lab-pi weewx[14777]: **** AttributeError: 'module' obje ct has no attribute 'moon_phase_ts' Feb 27 16:20:17 Lab-pi weewx[14777]: **** Generator terminated Feb 27 16:20:17 Lab-pi weewx[14777]: wxMesh: Connected with result code: 0 Feb 27 16:20:19 Lab-pi weewx[14777]: imagegenerator: Generated 11 images for Ste elSeries in 2.25 seconds Feb 27 16:20:19 Lab-pi weewx[14777]: reportengine: Caught unrecoverable exceptio n in generator 'weewx.cheetahgenerator.CheetahGenerator' Feb 27 16:20:19 Lab-pi weewx[14777]: **** 'module' object has no attrib ute 'moon_phase_ts' Feb 27 16:20:19 Lab-pi weewx[14777]: **** Traceback (most recent call l ast): Feb 27 16:20:19 Lab-pi weewx[14777]: **** File "/home/weewx/bin/weewx /reportengine.py", line 204, in run Feb 27 16:20:19 Lab-pi weewx[14777]: **** obj.start() Feb 27 16:20:19 Lab-pi weewx[14777]: **** File "/home/weewx/bin/weewx /reportengine.py", line 300, in start Feb 27 16:20:19 Lab-pi weewx[14777]: **** self.run() Feb 27 16:20:19 Lab-pi weewx[14777]: **** File "/home/weewx/bin/weewx /cheetahgenerator.py", line 157, in run Feb 27 16:20:19 Lab-pi weewx[14777]: **** self.initExtensions(gen_d ict[section_name]) Feb 27 16:20:19 Lab-pi weewx[14777]: **** File "/home/weewx/bin/weewx /cheetahgenerator.py", line 201, in initExtensions Feb 27 16:20:19 Lab-pi weewx[14777]: **** self.search_list_objs.app end(class_(self)) Feb 27 16:20:19 Lab-pi weewx[14777]: **** File "/home/weewx/bin/weewx /cheetahgenerator.py", line 518, in __init__ Feb 27 16:20:19 Lab-pi weewx[14777]: **** formatter=generator.forma tter) Feb 27 16:20:19 Lab-pi weewx[14777]: **** File "/home/weewx/bin/weewx /almanac.py", line 228, in __init__ Feb 27 16:20:19 Lab-pi weewx[14777]: **** self._precalc() Feb 27 16:20:19 Lab-pi weewx[14777]: **** File "/home/weewx/bin/weewx /almanac.py", line 232, in _precalc Feb 27 16:20:19 Lab-pi weewx[14777]: **** (self.moon_index, self._m oon_fullness) = weeutil.Moon.moon_phase_ts(self.time_ts) Feb 27 16:20:19 Lab-pi weewx[14777]: **** AttributeError: 'module' obje ct has no attribute 'moon_phase_ts' Feb 27 16:20:19 Lab-pi weewx[14777]: **** Generator terminated Feb 27 16:20:19 Lab-pi weewx[14777]: copygenerator: copied 0 files to /home/weew x/public_html/belchertown Feb 27 16:20:19 Lab-pi weewx[14777]: reportengine: Caught unrecoverable exceptio n in generator 'weewx.cheetahgenerator.CheetahGenerator' Feb 27 16:20:19 Lab-pi weewx[14777]: **** 'module' object has no attrib ute 'moon_phase_ts' Feb 27 16:20:19 Lab-pi weewx[14777]: **** Traceback (most recent call l ast): Feb 27 16:20:19 Lab-pi weewx[14777]: **** File "/home/weewx/bin/weewx /reportengine.py", line 204, in run Feb 27 16:20:19 Lab-pi weewx[14777]: **** obj.start() Feb 27 16:20:19 Lab-pi weewx[14777]: **** File "/home/weewx/bin/weewx /reportengine.py", line 300, in start Feb 27 16:20:19 Lab-pi weewx[14777]: **** self.run() Feb 27 16:20:19 Lab-pi weewx[14777]: **** File "/home/weewx/bin/weewx /cheetahgenerator.py", line 157, in run Feb 27 16:20:19 Lab-pi weewx[14777]: **** self.initExtensions(gen_d ict[section_name]) Feb 27 16:20:19 Lab-pi weewx[14777]: **** File "/home/weewx/bin/weewx /cheetahgenerator.py", line 201, in initExtensions Feb 27 16:20:19 Lab-pi weewx[14777]: **** self.search_list_objs.app end(class_(self)) Feb 27 16:20:19 Lab-pi weewx[14777]: **** File "/home/weewx/bin/weewx /cheetahgenerator.py", line 518, in __init__ Feb 27 16:20:19 Lab-pi weewx[14777]: **** formatter=generator.forma tter) Feb 27 16:20:19 Lab-pi weewx[14777]: **** File "/home/weewx/bin/weewx /almanac.py", line 228, in __init__ Feb 27 16:20:19 Lab-pi weewx[14777]: **** self._precalc() Feb 27 16:20:19 Lab-pi weewx[14777]: **** File "/home/weewx/bin/weewx /almanac.py", line 232, in _precalc Feb 27 16:20:19 Lab-pi weewx[14777]: **** (self.moon_index, self._m oon_fullness) = weeutil.Moon.moon_phase_ts(self.time_ts) Feb 27 16:20:19 Lab-pi weewx[14777]: **** AttributeError: 'module' obje ct has no attribute 'moon_phase_ts' Feb 27 16:20:19 Lab-pi weewx[14777]: **** Generator terminated Feb 27 16:20:19 Lab-pi weewx[14777]: copygenerator: copied 30 files to /home/wee wx/public_html/belchertown Feb 27 16:20:19 Lab-pi weewx[14777]: reportengine: Caught unrecoverable exceptio n in generator 'weewx.cheetahgenerator.CheetahGenerator' Feb 27 16:20:19 Lab-pi weewx[14777]: **** 'module' object has no attrib ute 'moon_phase_ts' Feb 27 16:20:19 Lab-pi weewx[14777]: **** Traceback (most recent call l ast): Feb 27 16:20:19 Lab-pi weewx[14777]: **** File "/home/weewx/bin/weewx /reportengine.py", line 204, in run Feb 27 16:20:19 Lab-pi weewx[14777]: **** obj.start() Feb 27 16:20:19 Lab-pi weewx[14777]: **** File "/home/weewx/bin/weewx /reportengine.py", line 300, in start Feb 27 16:20:19 Lab-pi weewx[14777]: **** self.run() Feb 27 16:20:19 Lab-pi weewx[14777]: **** File "/home/weewx/bin/weewx /cheetahgenerator.py", line 157, in run Feb 27 16:20:19 Lab-pi weewx[14777]: **** self.initExtensions(gen_d ict[section_name]) Feb 27 16:20:19 Lab-pi weewx[14777]: **** File "/home/weewx/bin/weewx /cheetahgenerator.py", line 201, in initExtensions Feb 27 16:20:19 Lab-pi weewx[14777]: **** self.search_list_objs.app end(class_(self)) Feb 27 16:20:19 Lab-pi weewx[14777]: **** File "/home/weewx/bin/weewx /cheetahgenerator.py", line 518, in __init__ Feb 27 16:20:19 Lab-pi weewx[14777]: **** formatter=generator.forma tter) Feb 27 16:20:19 Lab-pi weewx[14777]: **** File "/home/weewx/bin/weewx /almanac.py", line 228, in __init__ Feb 27 16:20:19 Lab-pi weewx[14777]: **** self._precalc() Feb 27 16:20:19 Lab-pi weewx[14777]: **** File "/home/weewx/bin/weewx /almanac.py", line 232, in _precalc Feb 27 16:20:19 Lab-pi weewx[14777]: **** (self.moon_index, self._m oon_fullness) = weeutil.Moon.moon_phase_ts(self.time_ts) Feb 27 16:20:19 Lab-pi weewx[14777]: **** AttributeError: 'module' obje ct has no attribute 'moon_phase_ts' Feb 27 16:20:19 Lab-pi weewx[14777]: **** Generator terminated Feb 27 16:20:22 Lab-pi weewx[14777]: imagegenerator: Generated 14 images for Sea sonsReport in 2.24 seconds Feb 27 16:20:22 Lab-pi weewx[14777]: copygenerator: copied 5 files to /home/weew x/public_html Feb 27 16:20:22 Lab-pi weewx[14777]: reportengine: Caught unrecoverable exceptio n in generator 'weewx.cheetahgenerator.CheetahGenerator' Feb 27 16:20:22 Lab-pi weewx[14777]: **** 'module' object has no attrib ute 'moon_phase_ts' Feb 27 16:20:22 Lab-pi weewx[14777]: **** Traceback (most recent call l ast): Feb 27 16:20:22 Lab-pi weewx[14777]: **** File "/home/weewx/bin/weewx /reportengine.py", line 204, in run Feb 27 16:20:22 Lab-pi weewx[14777]: **** obj.start() Feb 27 16:20:22 Lab-pi weewx[14777]: **** File "/home/weewx/bin/weewx /reportengine.py", line 300, in start Feb 27 16:20:22 Lab-pi weewx[14777]: **** self.run() Feb 27 16:20:22 Lab-pi weewx[14777]: **** File "/home/weewx/bin/weewx /cheetahgenerator.py", line 157, in run Feb 27 16:20:22 Lab-pi weewx[14777]: **** self.initExtensions(gen_d ict[section_name]) Feb 27 16:20:22 Lab-pi weewx[14777]: **** File "/home/weewx/bin/weewx /cheetahgenerator.py", line 201, in initExtensions Feb 27 16:20:22 Lab-pi weewx[14777]: **** self.search_list_objs.app end(class_(self)) Feb 27 16:20:22 Lab-pi weewx[14777]: **** File "/home/weewx/bin/weewx /cheetahgenerator.py", line 518, in __init__ Feb 27 16:20:22 Lab-pi weewx[14777]: **** formatter=generator.forma tter) Feb 27 16:20:22 Lab-pi weewx[14777]: **** File "/home/weewx/bin/weewx /almanac.py", line 228, in __init__ Feb 27 16:20:22 Lab-pi weewx[14777]: **** self._precalc() Feb 27 16:20:22 Lab-pi weewx[14777]: **** File "/home/weewx/bin/weewx /almanac.py", line 232, in _precalc Feb 27 16:20:22 Lab-pi weewx[14777]: **** (self.moon_index, self._m oon_fullness) = weeutil.Moon.moon_phase_ts(self.time_ts) Feb 27 16:20:22 Lab-pi weewx[14777]: **** AttributeError: 'module' obje ct has no attribute 'moon_phase_ts' Feb 27 16:20:22 Lab-pi weewx[14777]: **** Generator terminated Feb 27 16:20:23 Lab-pi weewx[14777]: imagegenerator: Generated 6 images for Smar tphoneReport in 0.77 seconds Feb 27 16:20:23 Lab-pi weewx[14777]: copygenerator: copied 6 files to /home/weew x/public_html/smartphone Feb 27 16:20:23 Lab-pi weewx[14777]: reportengine: Caught unrecoverable exceptio n in generator 'weewx.cheetahgenerator.CheetahGenerator' Feb 27 16:20:23 Lab-pi weewx[14777]: **** 'module' object has no attrib ute 'moon_phase_ts' Feb 27 16:20:23 Lab-pi weewx[14777]: **** Traceback (most recent call l ast): Feb 27 16:20:23 Lab-pi weewx[14777]: **** File "/home/weewx/bin/weewx /reportengine.py", line 204, in run Feb 27 16:20:23 Lab-pi weewx[14777]: **** obj.start() Feb 27 16:20:23 Lab-pi weewx[14777]: **** File "/home/weewx/bin/weewx /reportengine.py", line 300, in start Feb 27 16:20:23 Lab-pi weewx[14777]: **** self.run() Feb 27 16:20:23 Lab-pi weewx[14777]: **** File "/home/weewx/bin/weewx /cheetahgenerator.py", line 157, in run Feb 27 16:20:23 Lab-pi weewx[14777]: **** self.initExtensions(gen_d ict[section_name]) Feb 27 16:20:23 Lab-pi weewx[14777]: **** File "/home/weewx/bin/weewx /cheetahgenerator.py", line 201, in initExtensions Feb 27 16:20:23 Lab-pi weewx[14777]: **** self.search_list_objs.app end(class_(self)) Feb 27 16:20:23 Lab-pi weewx[14777]: **** File "/home/weewx/bin/weewx /cheetahgenerator.py", line 518, in __init__ Feb 27 16:20:23 Lab-pi weewx[14777]: **** formatter=generator.forma tter) Feb 27 16:20:23 Lab-pi weewx[14777]: **** File "/home/weewx/bin/weewx /almanac.py", line 228, in __init__ Feb 27 16:20:23 Lab-pi weewx[14777]: **** self._precalc() Feb 27 16:20:23 Lab-pi weewx[14777]: **** File "/home/weewx/bin/weewx /almanac.py", line 232, in _precalc Feb 27 16:20:23 Lab-pi weewx[14777]: **** (self.moon_index, self._m oon_fullness) = weeutil.Moon.moon_phase_ts(self.time_ts) Feb 27 16:20:23 Lab-pi weewx[14777]: **** AttributeError: 'module' obje ct has no attribute 'moon_phase_ts' Feb 27 16:20:23 Lab-pi weewx[14777]: **** Generator terminated