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

Home » Public Forums » archive » Re: Help on comparing 2 arrays
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: Help on comparing 2 arrays [message #70635] Tue, 27 April 2010 02:13 Go to previous message
d.poreh is currently offline  d.poreh
Messages: 406
Registered: October 2007
Senior Member
On Apr 26, 7:48 pm, Aram Panasenco <panasencoa...@gmail.com> wrote:
> Dave Poreh wrote:
>> Folks
>> I am trying to compare on ground (on sea!) laser data with MERIS data
>> for chlorophyll. Actually I have 2 arrays L[lat1, long1, c1] for on
>> ground measurements (with 400 meters resolution) and C[lat2, long2,
>> c2] for satellite data. What I want is this: for each pixel of C
>> (satellite data) extract data from array L that dropped inside of this
>> pixel. For instance for some pixels I have 3 or 4 data from L or
>> whatever. Does anyone have some good idea how to do this?
>> Any help highly appreciated.
>> Cheers
>> Dave
>
> Hey Dave,
>
> Are the latitude-longitude arrays in integer or floating-point format?
> Either way, you might want to specify an extraction radius - how close
> to each other do two points have to be to count them as the same point?
> I would define DELTA_LAT and DELTA_LON constants for that at the start
> of the routine.
>
> Note: I see your arrays are in the format [latitude,longitude], so I
> will stick with that, but the normal convention is obviously
> [longitude,latitude]
>
> I would then sort the L array in ascending latitude and ascending
> longitude orders:
>
> sortL_Lat = sort(L[0,*])
> sortL_Lon = sort(L[1,*])
>
> Then run a for-loop for every point in C and determine the indices of L
> where the point falls within the latitude range AND the longitude range.
> That gives you the indices of where to extract your L data for each
> point and do whatever you want with it.
>
> If the radius calculations have to be a little more precise than that,
> you can use the MAP_2POINTS routine on the points obtained using
> delta-longitude and delta-latitude comparison, and throw away the ones
> that are farther than some radian value away. Don't forget that the
> MAP_2POINTS routine accepts data in the longitude,latitude format as
> opposed to your data format! ;)
>
> Good Luck!
>
> ~Aram Panasenco

Thanks Guys
I did apply both way and they are brilliant. Chris’s way is so fast
because there is no for loops. Actually what I have done until now is
extracting the satellite cells that ship went along (because my L
array in L[lat1, long1, c1] format), but sounds like it is better to
do comparison with the original scenes as Chris suggested. I give it a
try with that way also.
Cheers
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: How to convert text file to fits file
Next Topic: Re: Getting state of a non-exclusive button (checkbox) widget

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

Current Time: Wed Oct 08 15:54:18 PDT 2025

Total time taken to generate the page: 0.00378 seconds