Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations cowski 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
Joined
Aug 1, 2007
Messages
2
Location
NO
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.
 
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.

Similar threads

Part and Inventory Search

Sponsor

Back
Top