comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: Matching elements in two arrays of different sizes
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Matching elements in two arrays of different sizes [message #80649 is a reply to message #80645] Wed, 27 June 2012 09:38 Go to previous messageGo to previous message
Meredith Pind is currently offline  Meredith Pind
Messages: 13
Registered: February 2011
Junior Member
Awesome, thanks!

Here's a dumb question. What do I use as the variable that holds all the matching data to call the associated data in the data set to those dates?

On Tuesday, June 26, 2012 3:28:20 PM UTC-5, (unknown) wrote:
> On Tuesday, June 26, 2012 12:07:29 PM UTC-4, pindsy wrote:
>> Hi everyone,
>>
>> I am having trouble figuring out how to search through an array of size [1,17824] and match it to the points in another array of size [1,70].
>>
>> What I am trying to use to match the two arrays are the month, day, year, hour, and minute within each dataset. I have made two arrays using julday and have been trying to go through each of those arrays to find matches. However, it only searches up to the 70 first lines of the larger array and dosen't give all the possible matches.
>>
>> Any ideas on how to fix this would be helpful.
>>
>> Cheers,
>>
>> Meredith
>
>
>
> On Tuesday, June 26, 2012 12:07:29 PM UTC-4, pindsy wrote:
>> Hi everyone,
>>
>> I am having trouble figuring out how to search through an array of size [1,17824] and match it to the points in another array of size [1,70].
>>
>> What I am trying to use to match the two arrays are the month, day, year, hour, and minute within each dataset. I have made two arrays using julday and have been trying to go through each of those arrays to find matches. However, it only searches up to the 70 first lines of the larger array and dosen't give all the possible matches.
>>
>> Any ideas on how to fix this would be helpful.
>>
>> Cheers,
>>
>> Meredith
>
> There are probably cleverer ways to do this, but the problem seems simple enough that a simple tool may be the best. Suppose the dates are d1 and d2 (d1 is the shorter vector)
>
> maxmintime=0.01
> n1=n_elements(d1)
>
> mintime=fltarr(n1)
> minid=lonarr(n1)
> for i=0,n-1 do begin
> dt=abs(d1(i)-d2)
> mintime(i)=min(dt,loc)
> minid(i)=loc
> endfor
>
> g=where(mintime lt maxmintime)
> if g(0) ne -1 then begin
> d1=d1(g)
> d2=d2(minid(g))
> endif else print,'No matches!'



On Tuesday, June 26, 2012 3:28:20 PM UTC-5, (unknown) wrote:
> On Tuesday, June 26, 2012 12:07:29 PM UTC-4, pindsy wrote:
>> Hi everyone,
>>
>> I am having trouble figuring out how to search through an array of size [1,17824] and match it to the points in another array of size [1,70].
>>
>> What I am trying to use to match the two arrays are the month, day, year, hour, and minute within each dataset. I have made two arrays using julday and have been trying to go through each of those arrays to find matches. However, it only searches up to the 70 first lines of the larger array and dosen't give all the possible matches.
>>
>> Any ideas on how to fix this would be helpful.
>>
>> Cheers,
>>
>> Meredith
>
>
>
> On Tuesday, June 26, 2012 12:07:29 PM UTC-4, pindsy wrote:
>> Hi everyone,
>>
>> I am having trouble figuring out how to search through an array of size [1,17824] and match it to the points in another array of size [1,70].
>>
>> What I am trying to use to match the two arrays are the month, day, year, hour, and minute within each dataset. I have made two arrays using julday and have been trying to go through each of those arrays to find matches. However, it only searches up to the 70 first lines of the larger array and dosen't give all the possible matches.
>>
>> Any ideas on how to fix this would be helpful.
>>
>> Cheers,
>>
>> Meredith
>
> There are probably cleverer ways to do this, but the problem seems simple enough that a simple tool may be the best. Suppose the dates are d1 and d2 (d1 is the shorter vector)
>
> maxmintime=0.01
> n1=n_elements(d1)
>
> mintime=fltarr(n1)
> minid=lonarr(n1)
> for i=0,n-1 do begin
> dt=abs(d1(i)-d2)
> mintime(i)=min(dt,loc)
> minid(i)=loc
> endfor
>
> g=where(mintime lt maxmintime)
> if g(0) ne -1 then begin
> d1=d1(g)
> d2=d2(minid(g))
> endif else print,'No matches!'
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: problem in the path
Next Topic: Parallel Processing in IDL

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Thu Oct 09 20:26:49 PDT 2025

Total time taken to generate the page: 0.87941 seconds