[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

More fun





Here's one I just came up against.  Suppose you want to rebin a vector
to some smaller size, an integer factor smaller.  E.g. 100 elements to
20 elements.  Now, rather than the average of those elements in each
interval, etc., you want merely the average of the first and last member
of that interval.  E.g., you want:

[(v[0]+v[4])/2, (v[5]+v[9])/2, (v[10]+v[14])/2, ...]

Rebin by itself can't work, I don't think.

Takers?   

JD

P.S. No for loops please.  Bonus points if you don't build an explicit
index list.

-- 
 J.D. Smith                  |   WORK: (607) 255-6263
 Cornell Dept. of Astronomy  |         (607) 255-5842
 304 Space Sciences Bldg.    |    FAX: (607) 255-5875  
 Ithaca, NY 14853            |