Menu

#784 QDataSet AVERAGE_TYPE metadata introduced

open
nobody
None
5
2022-06-11
2022-06-11
No

Bill and I had a bug where synchronize was used in a digitizer script to calculate ephemeris to accompany the digitized data. I'd forgotten that synchronize interpolates data, and longitude was interpolated across 0-360, resulting in strange horizontal lines in our plot. (The result data would be 358,180, 2 instead of 358,0,2.)

I've intended to model this in QDataSet for a while, and this has spurred me to add it. I could use the synchronizeNN routine, but often a group of data must be synchronized and different channels would have different algorithms. Also with longitude you don't want NN, because the minute differences might be important.

So I'm introducing the AVERAGE_TYPE property, and it initially has the values:

  • none no interpolation (or combining) of numbers is allowed, and NN should be used in the synchronize routine
  • linear this is the default linear interpolation--mean(A,B)=(A+B)/2
  • geometric averages are done on the exponents or mean(A,B)= sqrt(A*B)
  • mod360 the space is 360 units, so no two points are more than 180 apart
  • mod24 the space is 24 units, for example MLT is expressed in hours.
  • modpi the space is PI units
  • modtau the space is 2*PI units

The function interpolate now supports this, and synchronize uses this routine. This will also be useful for axes and other places where the space is divided into parts.

Discussion

MongoDB Logo MongoDB