OK, I've put the fix up on github. Thanks for finding this bug. On Sunday, January 23, 2022 at 5:26:46 p.m. UTC-4 bgra...@umw.edu wrote:
> Bingo! Many thanks! Bob > > bg@n4mrv:~/weewx_tonga_browse-main$ sudo python3 ./tonga_barometer.py > distance to eruption 12056.6 km > arrival at 1642257762 (2022-01-15 09:42:41) > opposite pulse arrival at 1642307533 (2022-01-15 23:32:13) > second time around pulse arrival at 1642382887 (2022-01-16 20:28:06) > select datetime, barometer from archive where datetime > 1642240800 and > datetime > < 1642395600 and barometer is not null order by dateTime; > query returned 171 data points > Fitting between 1642240800.0 and 1642395600.0 with 10 knots > > [image: Figure_1.png] > > On Sunday, January 23, 2022 at 11:56:22 AM UTC-5 bgra...@umw.edu wrote: > >> Hi morrowwm, >> I have tried your latest github post and am getting the following error: >> ``` >> root@n4mrv:/home/bg/weewx_tonga_browse-main# ./tonga_barometer.py >> >> distance to eruption 12056.6 km >> arrival at 1642257762 (2022-01-15 09:42:41) >> opposite pulse arrival at 1642307533 (2022-01-15 23:32:13) >> second time around pulse arrival at 1642382887 (2022-01-16 20:28:06) >> select datetime, barometer from archive where datetime > 1642240800 and >> datetime < 1642395600 and barometer is not null order by dateTime; >> query returned 171 data points >> >> Traceback (most recent call last): >> File "./tonga_barometer.py", line 96, in <module> >> knots = np.linspace(np.min(tdata), np.max(tdata), >> (stop_time-start_time)/(3600*smoothing_hours), endpoint=True) # spline >> knot every N hours >> File "<__array_function__ internals>", line 180, in linspace >> File >> "/usr/local/lib/python3.8/dist-packages/numpy/core/function_base.py", line >> 120, in linspace >> num = operator.index(num) >> TypeError: 'float' object cannot be interpreted as an integer >> ``` >> The earlier version worked correctly and I don't think I have changed >> anything. I am using the same copy of weewx.sdb and only changed my >> lat/lon. >> Much appreciated for your work on this software. >> Cheers, >> Bob >> On Saturday, January 22, 2022 at 4:14:51 PM UTC-5 morr...@gmail.com >> wrote: >> >>> Also, I found a bug in calculating the smooth (spline fit) curve which >>> is removed to highlight the eruption events. Added display of the points >>> used to calculate the fitted curve. >>> >>> On Saturday, January 22, 2022 at 4:32:47 p.m. UTC-4 morr...@gmail.com >>> wrote: >>> >>>> Forgot that, thanks for the reminder. Added now. >>>> >>>> On Saturday, January 22, 2022 at 4:22:51 p.m. UTC-4 storm...@gmail.com >>>> wrote: >>>> >>>>> Nice work (Morrowwn thanks!). If you have any nulls in the data >>>>> during the selected timeframe, change the query to read: (Cameron D >>>>> thanks!) >>>>> >>>>> *query = "select datetime, barometer from archive where datetime > >>>>> %.0f and datetime < %.0f and barometer is not null order by dateTime;" % >>>>> (start_time, stop_time)* >>>>> >>>>> >>>>> >>>>> >>>>> [image: hunga_tonga.png] >>>>> >>>>> If you want the bars closer to the rise and falls of the events, need >>>>> to adjust the speed of sound slightly. >>>>> On Saturday, January 22, 2022 at 2:37:09 PM UTC-5 pmcg...@gmail.com >>>>> wrote: >>>>> >>>>>> WOW! This is some interesting data, here is my location in Northern >>>>>> Utah. Looks like the reverse may be a little off in calculation but >>>>>> this >>>>>> made it easy to find instead of hunting through the data. >>>>>> >>>>>> Great Work! >>>>>> [image: hunga_tonga.png] >>>>>> On Saturday, January 22, 2022 at 12:16:45 PM UTC-7 morr...@gmail.com >>>>>> wrote: >>>>>> >>>>>>> Did an update to my script at: >>>>>>> https://github.com/morrowwm/weewx_tonga_browse >>>>>>> >>>>>>> Mostly incorporating additions from Cameron (thanks!) >>>>>>> >>>>>>> All parameters you likely want to set are near the top of the script. >>>>>>> >>>>>>> 1. support for mysql (untested, I don't have a mysql based weewx >>>>>>> installation) >>>>>>> 2. calculation and display of all three initial arrival, arrival >>>>>>> from opposite direction, and second arrival after one trip around >>>>>>> the globe >>>>>>> 3. highlighting of the three events with grey bars >>>>>>> 4. cubic spline curve fit of raw data and use of that fit to >>>>>>> remove the base pressure variations. The new smoothing_hours >>>>>>> parameter can >>>>>>> be used to control how close the fit is. >>>>>>> 5. changed the display of data to highlight the extracted events >>>>>>> and subdue the original data, other cosmetic changes >>>>>>> >>>>>>> I had a data outage about 26 hours after the event, we're quite a >>>>>>> distance from Tonga, plus a major storm was clearing out in our area. >>>>>>> So >>>>>>> not obviously anything unusual happened. >>>>>>> >>>>>>> Some scientist might be interested in the arrival times of all this >>>>>>> data, though. >>>>>>> [image: hunga_tonga.png] >>>>>>> >>>>>>> -- 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. To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/5ee8f798-5ce1-4f1c-b51b-db3c4d4aaeb3n%40googlegroups.com.