Skip to main content
1-Visitor
March 30, 2020
Question

Interpolate function not working as expected

  • March 30, 2020
  • 2 replies
  • 3712 views

Hi All,
I have an infotable that has missing values (interpolate_1),
I use the following code (interpolate_params) to try and fill the gaps by the last element.

 

 

 

	var params = {
		mode: "INTERVAL" /* STRING */ ,
		timeColumn: "timestamp" /* STRING */ ,
		t: loggedValues /* INFOTABLE */ ,
		ignoreMissingData: false /* BOOLEAN */ ,
		stats: "LAST" /* STRING */ ,
		endDate: endDate /* DATETIME */ ,
		columns: "p1_plasma__cooling_water__conductivity__actual;p1_plasma__cooling_water__conductivity__limit_high" /* STRING */ ,
		count: 1000 /* NUMBER */ ,
		startDate: startDate /* DATETIME */
	};

	// result: INFOTABLE
	var interpolatedLogged = Resources["InfoTableFunctions"].Interpolate(params);

 

 

 

 

For some reason, the gaps are not filled, and the timestamp is not stretched correctly.
Please let me know what am I doing wrong ?

Thanks

2 replies

18-Opal
March 30, 2020

Hello @ronyT,

 

I did some quick test and fwiw it seems to work as expected with mode: "ROWCOUNT" and stats: "SMOOTH". I know that SMOOTH != LAST, but that's all that worked for me.

 

/ Constantine

ronyT1-VisitorAuthor
1-Visitor
March 30, 2020

Hi Costantine,

 

Thank you for your answer.
You are correct, "SMOOTH" works fine and as expected. However, when I put mode to "LAST", it only takes the last value for one element and does not replicate that value if you have more than one consecutive empty value.

 

I am not sure if this is the real intention of the function or it is a bug in the function.

Thank you for your test

Community Manager
April 2, 2020

Hi @ronyT.

 

The screenshots are from different dates, so we can't really tell anything from them.  Using the LAST method, the value for the new data point should be the last value in that interval.  Did you validate that there are values in the intervals you are reviewing?

 

We may need to open a case for this to determine if there is actually an issue in the product.  If so, we would follow up to report it as a defect.

 

Please let me know if you would like me to open a case on your behalf.

 

Regards.

 

--Sharon

1-Visitor
April 7, 2020

There are ways to do this, but like all interpolation methods, you need to have data at a scale smaller than the spatial scale of variations in the true surface being estimated. This is generally assumed, but not always correct. A good example is the problem with interpolating rainfall data.