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

Home » Public Forums » archive » Minimum between two arrays; no, not just Min(A-B)
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Minimum between two arrays; no, not just Min(A-B) [message #55870] Tue, 18 September 2007 07:19
leatherback is currently offline  leatherback
Messages: 15
Registered: November 2005
Junior Member
Hi All,

I am working with time series data, and image scenes. For each point
in my time series I try to find the correct satellite scene to use. So
I have two arrays, one with dates of observations, one with image
scene dates.

These dates are in long integer (Unix timestamps).

I *could* of course replicate my image scenes array to the length of
the timeseries array, calculate the difference for each date, and find
out where it is, something along these lines:

datelist = rebin(dates, n_elements(dates),
n_elements( fixes.timestamp))

for j=0, n_elements(dates)-1 do begin
  datelist[j,*] = datelist[j,*]-fixes.timestamp
endfor

Or even rebin both arrays, and substract them. En then loop through
them using the MIN / WHERE functions to find out where the minimum
diferences are.

However, this does not feel right. Besides that.. the timeseries is
potentially 100,000+ observations. Add to that a few hundred image
dates, and you are filling your memory for something quite simple.
Anybody here have a good idea how to vectorize this problem?

Cheers,

Jelle.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: source_href in IDLdoc?
Next Topic: Scaling multiple plots

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

Current Time: Mon Dec 01 12:54:46 PST 2025

Total time taken to generate the page: 0.48383 seconds