Re: [Numpy-discussion] Overlapping time series

2014-02-11 Thread Sturla Molden
Daniele Nicolodi wrote: > Sure, I realize that, thank for the clarification. The arrays are quite > small, then the three loops and the temporary take negligible time and > memory in the overall processing. If they are small, a Python loop would do the job as well. And if it doesn't, it is just

Re: [Numpy-discussion] Overlapping time series

2014-02-11 Thread Daniele Nicolodi
On 11/02/2014 18:18, Sturla Molden wrote: > Daniele Nicolodi wrote: > >> That's more or less my current approach (except that I use the fact that >> the data is evenly samples to use np.where(np.diff(t1) != dt) to detect >> the regions of continuous data, to avoid the loop. > > I hope you realiz

Re: [Numpy-discussion] Overlapping time series

2014-02-11 Thread Sturla Molden
Daniele Nicolodi wrote: > That's more or less my current approach (except that I use the fact that > the data is evenly samples to use np.where(np.diff(t1) != dt) to detect > the regions of continuous data, to avoid the loop. I hope you realize that np.where(np.diff(t1) != dt) generates three lo

Re: [Numpy-discussion] Overlapping time series

2014-02-11 Thread Daniele Nicolodi
On 11/02/2014 15:38, Sturla Molden wrote: > Daniele Nicolodi wrote: > >> I was probably not that clear: I have two 2xN arrays, one for each data >> recording, one column for time (taken from the same clock for both >> measurements) and one with data values. Each array has some gaps. > > If you

Re: [Numpy-discussion] Overlapping time series

2014-02-11 Thread Joris Van den Bossche
2014-02-11 14:55 GMT+01:00 Andreas Hilboll : > On 11.02.2014 14:47, Daniele Nicolodi wrote: > > On 11/02/2014 14:41, Andreas Hilboll wrote: > >> On 11.02.2014 14:22, Daniele Nicolodi wrote: > >>> On 11/02/2014 14:10, Andreas Hilboll wrote: > On 11.02.2014 14:08, Daniele Nicolodi wrote: >

Re: [Numpy-discussion] Overlapping time series

2014-02-11 Thread Sturla Molden
Daniele Nicolodi wrote: > I was probably not that clear: I have two 2xN arrays, one for each data > recording, one column for time (taken from the same clock for both > measurements) and one with data values. Each array has some gaps. If you want all subarrays where both timeseries are sampled,

Re: [Numpy-discussion] Overlapping time series

2014-02-11 Thread RayS
At 06:07 AM 2/11/2014, you wrote: >On 11/02/2014 14:56, Sturla Molden wrote: > > Daniele Nicolodi wrote: > > > >> Correct me if I'm wrong, but this assumes that missing data points are > >> represented with Nan. In my case missing data points are just missing. > > > > Then your data cannot be sto

Re: [Numpy-discussion] Overlapping time series

2014-02-11 Thread Daniele Nicolodi
On 11/02/2014 14:56, Sturla Molden wrote: > Daniele Nicolodi wrote: > >> Correct me if I'm wrong, but this assumes that missing data points are >> represented with Nan. In my case missing data points are just missing. > > Then your data cannot be stored in a 2 x N array as you indicated. I wa

Re: [Numpy-discussion] Overlapping time series

2014-02-11 Thread RayS
> On 11.02.2014 14:08, Daniele Nicolodi wrote: >> Hello, >> >> I have two time series (2xN dimensional arrays) recorded on the same >> time basis, but each with it's own dead times (and start and end >> recording times). I would like to obtain two time series containing >> only the time overlap

Re: [Numpy-discussion] Overlapping time series

2014-02-11 Thread Sturla Molden
Daniele Nicolodi wrote: > Correct me if I'm wrong, but this assumes that missing data points are > represented with Nan. In my case missing data points are just missing. Then your data cannot be stored in a 2 x N array as you indicated. Sturla ___

Re: [Numpy-discussion] Overlapping time series

2014-02-11 Thread RayS
> On 11.02.2014 14:08, Daniele Nicolodi wrote: >> Hello, >> >> I have two time series (2xN dimensional arrays) recorded on the same >> time basis, but each with it's own dead times (and start and end >> recording times). I would like to obtain two time series containing >> only the time overlap

Re: [Numpy-discussion] Overlapping time series

2014-02-11 Thread Andreas Hilboll
On 11.02.2014 14:47, Daniele Nicolodi wrote: > On 11/02/2014 14:41, Andreas Hilboll wrote: >> On 11.02.2014 14:22, Daniele Nicolodi wrote: >>> On 11/02/2014 14:10, Andreas Hilboll wrote: On 11.02.2014 14:08, Daniele Nicolodi wrote: > Hello, > > I have two time series (2xN dimension

Re: [Numpy-discussion] Overlapping time series

2014-02-11 Thread Sturla Molden
Daniele Nicolodi wrote: > I can imagine strategies about how to approach the problem, but none > that would be efficient. Ideas? I would just loop from the start and loop from the end and find out where to clip. Then slice in between. If Python loops take too much time, JIT compile them with

Re: [Numpy-discussion] Overlapping time series

2014-02-11 Thread Daniele Nicolodi
On 11/02/2014 14:41, Andreas Hilboll wrote: > On 11.02.2014 14:22, Daniele Nicolodi wrote: >> On 11/02/2014 14:10, Andreas Hilboll wrote: >>> On 11.02.2014 14:08, Daniele Nicolodi wrote: Hello, I have two time series (2xN dimensional arrays) recorded on the same time basis, but

Re: [Numpy-discussion] Overlapping time series

2014-02-11 Thread Andreas Hilboll
On 11.02.2014 14:22, Daniele Nicolodi wrote: > On 11/02/2014 14:10, Andreas Hilboll wrote: >> On 11.02.2014 14:08, Daniele Nicolodi wrote: >>> Hello, >>> >>> I have two time series (2xN dimensional arrays) recorded on the same >>> time basis, but each with it's own dead times (and start and end >>>

Re: [Numpy-discussion] Overlapping time series

2014-02-11 Thread Daniele Nicolodi
On 11/02/2014 14:10, Andreas Hilboll wrote: > On 11.02.2014 14:08, Daniele Nicolodi wrote: >> Hello, >> >> I have two time series (2xN dimensional arrays) recorded on the same >> time basis, but each with it's own dead times (and start and end >> recording times). I would like to obtain two time s

Re: [Numpy-discussion] Overlapping time series

2014-02-11 Thread Andreas Hilboll
On 11.02.2014 14:08, Daniele Nicolodi wrote: > Hello, > > I have two time series (2xN dimensional arrays) recorded on the same > time basis, but each with it's own dead times (and start and end > recording times). I would like to obtain two time series containing > only the time overlapping segme

[Numpy-discussion] Overlapping time series

2014-02-11 Thread Daniele Nicolodi
Hello, I have two time series (2xN dimensional arrays) recorded on the same time basis, but each with it's own dead times (and start and end recording times). I would like to obtain two time series containing only the time overlapping segments of the data. Does numpy or scipy offer something tha