Hello, I did a little experience using LOWESS (also called LOESS in some places) with success I think. In my experience it is the best method I tried over the years. This non parametric local smoothing exists for many lingages including Fortran (which I used...), C, Python, R etc. It use three parameters: a smoothing factor, adjusted between 0 and 1. You have to experiment to find the best according to your problem. In my case .03 was good.. the second is the number of iterations, 1 to...; I adopted 2, the doc says any larger number will not change antthing; the last one is a speed-up factor; I choose 0 (= No Speed-Up). With 3639 data points, the processing time is barely seen (10 years old Intel i3770 processor).
The upper pannel represent the original data in blue and the smoothed one on red. The lower pannel represent the difference between the original data and the smoothed one. The time (T) is given in days, starting at 0:00:00 UTC on January 15th. The last point is at 24:00:00 on January 18th. The vertical axis is in mbar. My altitude is 410 meters. The first and second pulses are very clearely visible. There are a few other signals needing interpretation... Also noticable is the smoother signal before the first spike compared to the rest of the data. Have a nice week-end, Paul Le Friday, January 21, 2022 à 4:38:59 PM UTC+1, [email protected] a écrit : > Thanks all, bad copy of weewx.sdb. All is well. > > On Thursday, January 20, 2022 at 5:25:50 PM UTC-5 [email protected] wrote: > >> It looks like you retrieved no data. It calculated decent looking arrival >> times, so no problem with the change you made? >> >> Try just a query for data spanning the first arrival. From a shell prompt: >> >> sqlite3 weewx.sdb "select datetime, barometer from archive where datetime >> > 1642258360-100000 and datetime < 1642258360+100000 order by dateTime;" >> >> >> On Thursday, January 20, 2022 at 1:29:36 p.m. UTC-4 [email protected] >> wrote: >> >>> I tried the code posted on github as well as the one by Cameron D. In >>> both cases I got the following error: >>> ``` >>> root@n4mrv:/home/bg/weewx_tonga_browse-main# python3 ./tonga.py [file >>> from Cameron D] >>> >>> distance to eruption 12056.6 km arrival at 1642258360 (2022-01-15 >>> 09:52:39) >>> opposite pulse arrival at 1642308921 (2022-01-15 23:55:21) >>> second time around pulse arrival at 1642385471 (2022-01-16 >>> 21:11:10) >>> Traceback (most recent call last): >>> File "./tonga.py", line 178, in <module> >>> plot_burst( cursor, arrival_time, hour_span, "primary" ) >>> File "./tonga.py", line 54, in plot_burst >>> coeff = np.polyfit(xdata, ydata, background_order ) >>> File "<__array_function__ internals>", line 180, in polyfit >>> File "/usr/local/lib/python3.8/dist-packages/numpy/lib/polynomial.py", >>> line 638, in polyfit >>> raise TypeError("expected non-empty vector for x") >>> TypeError: expected non-empty vector for x >>> ``` >>> I added my lat/lon information but may have missed something else I need >>> to change. Python modules were installed as directed. Copy of weewx.sdb is >>> in the same directory as the program. >>> Thanks. >>> Bob >>> On Wednesday, January 19, 2022 at 10:32:49 AM UTC-5 [email protected] >>> wrote: >>> >>>> On Wednesday, January 19, 2022 at 12:42:04 a.m. UTC-4 Cameron D wrote: >>>> >>>>> >>>>> - as you get closer to the equator, tidal changes dominate the >>>>> baseline in that timescale - I tried higher order polynomials, but >>>>> they are >>>>> next to useless. >>>>> >>>>> I also had little luck with higher order polynomials to remove the >>>> general trend. >>>> >>>> I've put the script here: >>>> https://github.com/morrowwm/weewx_tonga_browse >>>> >>> -- 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]. To view this discussion on the web visit https://groups.google.com/d/msgid/weewx-user/b0bbb6da-9267-4aa2-a6de-c3c089c2d5dan%40googlegroups.com.
Tonga-1.pdf
Description: Adobe PDF document
