Continue to Site

Eng-Tips is the largest engineering community on the Internet

Intelligent Work Forums for Engineering Professionals

  • Congratulations KootK on being selected by the Eng-Tips community for having the most helpful posts in the forums last week. Way to Go!

combining timeseries

Status
Not open for further replies.

KarlisBLT

Petroleum
Aug 1, 2007
2
I have two time series objects:

FLOW, with 8382 samples
Start time 8.890500e+002 minutes
End time 5.242600e+003 minutes

PRESSURE with 16256 samples
Start time 1.674965e+000 days
End time 3.556331e+000 days

The origo of both are the same (0 minutes in the first = 0 days in the second) I want to produce a matrix with three columns like this:

time1 FLOW-at-time1 PRESSURE-at-time1
time2 FLOW-at-time2 PRESSURE-at-time2
.....
.....

The start and ending time should be defined by the time period where FLOW and PRESSURE overlap, where they are both measured. (starting at 2411 minutes that is)
To do this seems to require a number of different operations in the tstool GUI or by direct commands, and I've been unable to accomplish it. Solutions or tips would be much appreciated.
 
Replies continue below

Recommended for you

Ok, I figured this one out myself. The problem was due to a possible bug or lack of feature in the resample function for timeseries.

When time in a timeseries object is numeric, that is not a datestring, it seems that resample ignores the time unit information in the timeseries object and assume all to be the same. The below code adjust from "days" to "minutes" manually

time = PRESSURE.Time;
Resampled_FLOW = resample(FLOW,time*24*60);

This way, FLOW is resampled to include measurements only at the times when measurements of PRESSURE existed.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor