comp.lang.idl-pvwave archive - RDF feed
type: channel
description: Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
items: find missing elements in an array
items: Re: find missing elements in an array

find missing elements in an array
type: item
description: I have a peak-finding routine that finds, well...peaks, in a larger array. I know how many peaks there are suppose to be, and I know the way they should be arranged, e.g. 1 set of 5 peaks, a gap, then a set of 10 peaks, a gap, then a set of 7 peaks etc.... and I know how many sets of peaks there are as well. But sometimes these peaks could be missing and I'm trying to find a way to locate them based on nothing more than the input data, and the expected values. so with the above example, I know there should be 22 peaks total in an array of data of say 30 elements, grouped in 3 sets of [5,10,7] peaks. I don't know where the peaks are apriori in the large array of 30 elements or where they should be. If I find 20 peaks, I know there are 2 missing but I would like to find out which peaks they are, in what sets, and where in the data array of 30 elements they are. Any ideas? I have a current method in place involving using the separations between found peaks but it is bulky, and inconsistent. I am looking for alternative methods or help in making the method I do have implemented more efficient. Below I will describe my currently attempted method. If all peaks were found then the separations (element+1 - element) should be something like seps = [5,4,5,6,15,11,10,11,12,12,12,11,11,10,14,4,4,5,6,4,5,4] 22 elements and I know there should be 2 gaps that separate the 3 bundles ; the 15 and the 14 indicate gap locations. if some are missing it might look like seps = [5,4,5,6,15,11,10,11,16,12,11,11,10,12,4,4,10,4,5,4] 20 elements ; here a missing peak is in the 2nd and 3rd sets. I do have an array of expected separation between peaks in the sets, so [5,11,4] would be the expected (or lets say median) separations in the above example. So I basically loop over each set and look for regions in the seps array where the value is greater than the expected value; basically looking for the gaps. If all the peaks are there I only find 2 gaps. In the above example of 2 missing peaks, I …
creator: havok2063
date: 2012-12-27T18:37:48-00:00

Re: find missing elements in an array
type: item
description: On Wednesday, January 9, 2013 3:56:47 PM UTC-5, Brian Cherinka wrote: > On Monday, January 7, 2013 3:02:22 PM UTC-5, Craig Markwardt wrote: > >> On Monday, January 7, 2013 10:37:44 AM UTC-5, Brian Cherinka wrote: > >> > >>> On Thursday, December 27, 2012 1:37:48 PM UTC-5, Brian Cherinka wrote: > >> > >>> > >> > >>>> I have a peak-finding routine that finds, well...peaks, in a larger array. I know how many peaks there are suppose to be, and I know the way they should be arranged, e.g. > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> 1 set of 5 peaks, a gap, then a set of 10 peaks, a gap, then a set of 7 peaks etc.... > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> and I know how many sets of peaks there are as well. But sometimes these peaks could be missing and I'm trying to find a way to locate them based on nothing more than the input data, and the expected values. > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> so with the above example, I know there should be 22 peaks total in an array of data of say 30 elements, grouped in 3 sets of [5,10,7] peaks. I don't know where the peaks are apriori in the large array of 30 elements or where they should be. > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> If I find 20 peaks, I know there are 2 missing but I would like to find out which peaks they are, in what sets, and where in the data array of 30 elements they are. Any ideas? > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> I have a current method in place involving using the separations between found peaks but it is bulky, and inconsistent. I am looking for alternative methods or help in making the method I do have implemented more efficient. Below I will describe my currently attempted method. > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > >> > >>> > >> …
creator: Craig Markwardt
date: 2013-01-09T22:08:55-00:00

Re: find missing elements in an array
type: item
description: On Wednesday, January 9, 2013 11:08:55 PM UTC+1, Craig Markwardt wrote: > On Wednesday, January 9, 2013 3:56:47 PM UTC-5, Brian Cherinka wrote: > >> On Monday, January 7, 2013 3:02:22 PM UTC-5, Craig Markwardt wrote: > >> > >>> On Monday, January 7, 2013 10:37:44 AM UTC-5, Brian Cherinka wrote: > >> > >>> > >> > >>>> On Thursday, December 27, 2012 1:37:48 PM UTC-5, Brian Cherinka wrote: > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > I have a peak-finding routine that finds, well...peaks, in a larger array. I know how many peaks there are suppose to be, and I know the way they should be arranged, e.g. > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > 1 set of 5 peaks, a gap, then a set of 10 peaks, a gap, then a set of 7 peaks etc.... > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > and I know how many sets of peaks there are as well. But sometimes these peaks could be missing and I'm trying to find a way to locate them based on nothing more than the input data, and the expected values. > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > so with the above example, I know there should be 22 peaks total in an array of data of say 30 elements, grouped in 3 sets of [5,10,7] peaks. I don't know where the peaks are apriori in the large array of 30 elements or where they should be. > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > If I find 20 peaks, I know there are 2 missing but I would like to find out which peaks…
creator: Helder Marchetto
date: 2013-01-09T22:44:48-00:00

Re: find missing elements in an array
type: item
description: Yeah I guess I do know the relative positions of the peaks. The knowns are the expected total number of peaks, their expected separations, how they are grouped together (e.g. 150 total in 10 groups of 15 peaks each). The realities of the peaks, their locations, and spacings will change from image to image. I'll give the cross-correlation a try. I was trying to come up with an alternative method to cross-correlating. And right now the code works reasonably well but it's a little buggy from image to image and a little unsightly as well. On Wednesday, January 9, 2013 5:44:48 PM UTC-5, Helder wrote: > On Wednesday, January 9, 2013 11:08:55 PM UTC+1, Craig Markwardt wrote: > >> On Wednesday, January 9, 2013 3:56:47 PM UTC-5, Brian Cherinka wrote: > >> > >>> On Monday, January 7, 2013 3:02:22 PM UTC-5, Craig Markwardt wrote: > >> > >>> > >> > >>>> On Monday, January 7, 2013 10:37:44 AM UTC-5, Brian Cherinka wrote: > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > On Thursday, December 27, 2012 1:37:48 PM UTC-5, Brian Cherinka wrote: > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > > I have a peak-finding routine that finds, well...peaks, in a larger array. I know how many peaks there are suppose to be, and I know the way they should be arranged, e.g. > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > > > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > > > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > > > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > > 1 set of 5 peaks, a gap, then a set of 10 peaks, a gap, then a set of 7 peaks etc.... > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > > > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > > > >> > >>> > >> …
creator: havok2063
date: 2013-01-10T01:30:17-00:00