Rob wrote in message news:3992c13d@newsgroups.ni.com...
> oops forgot to include the picture
Quite a nasty peak. How are the lines defined at either side? The left is at
the baseline but the right is at the shoulder?
Kevin's method will give you the max of the peak, giving you the X
co-ordinate of the peak. You can then split the array at that point (split
1D array or array subset depending on dimensionality), and get all the data
to the left in one array, and all the data to the right in another. If my
assessment of where the lines are is valid, then to get the left hand side
of the array you could then use the "threshold 1D array" function to find
the point at which the value is, say, 1% or less of the peak value and split
the left array at that point.
To find the right hand boundary will be more difficult- perhaps you could
find the second differential of the line and find the X co-ord of the maxima
in that, which will give you the position of the sharp shoulder, then cut
the right hand array that point.
Join the two arrays and you get a single array containing one peak- do this
for all three and you get three arrays each containing a peak.
How you merge those three depends very much on what the three peaks are,
which is something you still haven't gone into much detail on- I assume
they're all the same physical peak but from different measurement ranges.
Therefore if you simply overlap the three arrays on one plot, you'll see
three different peaks due to measurement inaccuracy in both the X and Y
values. If this is fine, then you simply need to append the three sets of X
and Y arrays to get your final data array and then sort them- one option for
sorting would be to have your data stored as a 1D array of datapoints, where
each datapoint is a cluster of X and Y values- you can then use the "Sort 1D
array" function.
If the measurement inaccuracy is a problem, then you have to come up with a
normalisation scheme to scale the X and Y data in each set. Precisely how
this is done depends too much on the nature of the data to even consider
without knowing more.