The JETDSP toolkit
 
reducepolylinedata
isdefined
isdouble
isfloat
isint
islong
isnumeric
isstring

REDUCEPOLYLINEDATA

This function takes a pair of arrays of data - a horizontal axis vector and a vertical axis vector - and executes a pixel reduction algorithm on them based on the horizontal size (in pixels) of the device that you expect to plot them in.

For very large arrays, this can reduce the time taken to plot the data, with no loss of precision in the final plot. This is because high-frequency signals - when every data point is plotted - repeatedly plot the same pixel in the same colour for each data point.

Tests showed that Jetdsp was able to speed up the plotting of a signal with 107 samples by a factor of more than 4 using this function.

For each column of pixels in the plot, if the input arrays have any data in the relevant data range, this function returns two points. These are:

  • [mean X value, minimum Y value]
  • [mean X value, maximum Y value]

for the subset of data points which fall into the pixel column concerned.

Thus the function will return up to xsize*2 points in the return arrays xReduced and yReduced.

Syntax

Result = REDUCEPOLYLINEDATA(xInput, yInput, xReduced, yReduced, xsize [, DATAPIXELRATIO=dpr] [, ERROR=strError] )

Return Value

Returns 0B if the data reduction is successful.
Returns 1B if an error occurred, and sets strError with a text string describing the error if any information is available.

Arguments

XINPUT

A float or double 1D array holding the horizontal axis values of the raw data that you need to reduce.

YINPUT

A float or double 1D array holding the vertical axis values of the raw data that you need to reduce.

XREDUCED

A named variable that will receive the horizontal axis values of the reduced data.

YREDUCED

A named variable that will receive the vertical axis values of the reduced data.

XSIZE

Set this argument to the width, in pixels, of the window in which you intend to plot the data.

Keywords

DATAPIXELRATIO

Set this keyword to the multiple of xsize that must be exceeded by the size of the input arrays before any pixel reduction is executed. This is currently set to a relatively high default value of 1000 - so, for a plot that is expected to be 800 pixels wide, pixel reduction will only take place if the data vector has more than 800,000 points. This can be reduced - but be warned that high frequency 'spikey' signals can suffer with aliasing effects when used in line plots.

ERROR

Set this keyword to a variable that will be assigned information on errors if the function fails. The variable will be set to an empty string if reducepolylinedata is successful.

Example

jpfget, shot=62438, node='DA/C1M-H303',data=d, tvec=t
rVal = reducepolylinedata(t, d, treduced, dreduced, 640)
; the following plot is very fast:
plot, treduced, dreduced
; the following takes about 10s:
plot, t, d

Top  JETDSP Home Page  Manual  FAQ 
Please send comments to: dmsd-support@jet.efda.org