Find X values at a given Y value
1. levelcrossing iy:=col(2) level:=2;
2. levelcrossing iy:=col(2) level:=500 direction:=<new> xindex:=<new> type:=left pts:=2;
Please refer to the page for additional option switches when accessing the x-function from script
Display Name |
Variable Name |
I/O and Type |
Default Value |
Description |
---|---|---|---|---|
Input | iy |
Input XYRange |
|
Specify the input dataset. |
Crossing Level | level |
Input double |
|
Specify the Y value for the level. Then the X-Function will detect the crossings for this level. |
ncrossing |
Output int |
|
Specify the output for the number of the crossing points. This variable is not shown in the dialog box, but you can get the value of this variable by running levelcrossing.ncrossing=; in the Command Window after executing this X-Function.
| |
X Values of Crossing | oy |
Output vector |
|
Specify the output for the X values of the crossing points, and designated as X column. |
Directions | direction |
Output vector |
|
Specify the output for the directions of the crossing behaviors, 1 for upward, -1 for downward, and 0 for differentiation is zero, and designated as Y column. |
X Indices | xindex |
Output vector |
|
Specify the output for the X indices of the crossing points, designated as Label column. |
Y Crossing Values | yval |
Output vector |
|
Specify the output for the Y values, which will all be the same as input level crossing value, designated as Y column. |
Nearest Type | type |
Input int |
|
Specify how to output the X index of the crossing point when the crossing point is interpolated but not the point of the original data.
Option list:
|
Duration Points | pts |
Input int |
|
This variable is used to control the output of a pair of level crossing points. The distance (indices) of the pair of points should not be less the specified duration, or both crossing points will be discarded. Only positive integer is acceptable. Duration should not be larger than Deadtime. |
Deadtime Points | deadtime |
Input int |
|
This variable determines how a level crossing point is treated as valid and output.
... and so forth Only positive integer is acceptable. |
This X-Function finds the locations (X values) where the input curve crosses a specified level. For example, if you set the level to be 0, the zero crossing points (where the curve passes 0) will be output. Such zero crossing points could be meaningful for some special curves. Outputs are selectable, including X values, X indices, crossing directions, and Y crossing values. Also, duration can be specified to get rid of some noise.
Note that linear interpolation could be used to get the locations.
In the following example, we will find the locations where the curve crosses 500.
levelcrossing -d;
in the Command Window.levelcrossing.ncrossing=;
in the Command Window, the number of intersection points will be shown as:LEVELCROSSING.NCROSSING=8
This example is to show you how the duration and deadtime effect the result you get.
levelcrossing -d;
in the Command Window.
Keywords:crossing, threshold