I have timeseries with 15 minute time stepp. How can I screen one hour times series (cumulative) from 15 minues time series.

07/01/2012 00:00 0.00
07/01/2012 00:15 0.00
07/01/2012 00:30 0.00
07/01/2012 00:45 0.00
07/01/2012 01:00 0.00
07/01/2012 01:15 0.00
07/01/2012 01:30 0.00
07/01/2012 01:45 0.00
07/01/2012 02:00 0.00
07/01/2012 02:15 0.00
07/01/2012 02:30 0.00
07/01/2012 02:45 0.00
07/01/2012 03:00 0.00
07/01/2012 03:15 0.00
07/01/2012 03:30 0.00
07/01/2012 03:45 0.00
07/01/2012 04:00 0.00
07/01/2012 04:15 0.00
07/01/2012 04:30 0.00
07/01/2012 04:45 0.00
07/01/2012 05:00 0.00
07/01/2012 05:15 0.00
07/01/2012 05:30 0.00

4 Comments

I don't understand what "screen" one-hour timestep (cumulative) means, precisely? Illustrate what you wish to obtain from the input and are all 15 minute intervals present in the data file other than perhaps the last hour interval?
I have discontinuous time series precipitation data but some days, the time step is 15 minutes and for some days the time steps is 5 minutes. I need either 5 minute time step data or 15 minutes. I tried to use linear interpolation to generate 5 minute time step but results are not correct. Any idea to generate constant time step data? Doing it on excel is very time consuming. So i am trying to write a code that can either generate 5 minute time step or 15 minute time step time series but could not find a solution yet.
I don't think you can create data that doesn't exist here; if the recorded frequency is 15-min, the three 5-minute values for each fifteen minute interval would have to sum to that value. You could arbitrarily divide by three I suppose or use some other weight but it'd all be just pure guess-work and of little value in the end I'd think.
Sounds like the best plan would be to sum over the three consecutive five-minute intervals for those days' data to make them consistent with those already integrated/collected on that time span.
If the data are complete, then it's pretty easy to simply reshape by 3,[], sum and shape back to do the accumulation.
"I tried to use linear interpolation to generate 5 minute time step..."
That, indeed, doesn't work well; use the datetime or datenum methods instead over whatever number of N-minute time periods needed and let them do the internal rounding and rollover to actual dates. You start at any arbitrary date, of course, but unless the time periods are simply arbitrary intervals unless you do it this way you inevitably run into issues in comparing to calendar data owing to days/month, leap years, etc., etc., etc., ...
As per usual, w/o an actual data file or two with which to 'spearmint it's more difficult to write actual code than give general advice for a specific application.

Sign in to comment.

Answers (1)

since you stated that the time step is not fixed you cannot use reshape but you should use a combination of histc and accummarray

1 Comment

I'd build the full time array and populate as data exist, then do the agglomeration on that to get around that issue...

Sign in to comment.

Asked:

on 26 Nov 2015

Commented:

dpb
on 2 Dec 2015

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!