[AstroPy] Intelligent averaging of time series data
peter at newton.cx
Sat Sep 29 15:04:46 EDT 2018
I have some code that does this sort of thing in my "pwkit" package of
astro-related Python utilities. The "documentation" is here but it's
I should really put together some examples, but unfortunately haven't
done so yet — and that's not something I expect to be able to spend
time on in the near future. Given that, it probably is not enough of a
turn-key solution for you, but I thought I'd at least mention its
existence. FWIW, here's the source:
On Sat, 2018-09-29 at 09:27 +0000, Nicholas Ross wrote:
> Hi Astropy,
> I have what seems a very easy problem, but I haven’t found an elegant solution yet.
> I have the following (time-series) data:
> t = [5.13, 5.27, 5.40, 5.46, 190.99, 191.13, 191.267, 368.70, 368.83, 368.90, 368.93]
> y = [17.17, 17.18, 17.014, 17.104, 16.981, 16.96, 16.85, 17.27, 17.66, 17.76, 18.01]
> so, groups of data in short (time) intervals then separated cleanly by a long time gap.
> I'm looking for a simple method that will intelligently average these together; sort of a 'Bayesian blocks’
> but for non-histogram data.
> The return of
> t_prime=[5.315, 191.129, 368.84],
> y_prime=[17.117, 16.930, 17.660]
> is the first-order result I'd be after, but with the option to include weights/weighted data in more sophisticated analyses.
> The suggested approaches to this problem are doing a simple moving average, or maybe a numpy convolution,
> but I'm looking for something a bit more elegant and that can generalize to larger, similar, but not identical datasets.
> AstroPy mailing list
> AstroPy at python.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the AstroPy