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

Home » Public Forums » archive » Re: something (wrong?) with CONGRID?
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: something (wrong?) with CONGRID? [message #75806 is a reply to message #75805] Sun, 01 May 2011 20:35 Go to previous message
JP is currently offline  JP
Messages: 55
Registered: April 2008
Member
By the way, what I am trying to do is to create an array that groups pixels of my original array ARRAY of dims ns, nl in areas of size x, x.

For example, my array is of size (ns, nl) and x=10 I do:


x= 10
a = lindgen(ns/x, nl/x) ; makes array of dims / x
b = congrid(a, (ns/x)*x, (nl/x)*x) ; resizes a to original size
c = lonarr(ns, nl) ; new array the size I want
c[0:(ns/x)*x-1, 0:(nl/x)*x-1] = b ; fills the array I want with b (leaves 0 in the bottom and right borders which don't add to 10 pixels
undefine, a, b ; gets rid of a and b

histo_c = Histogram(c, BINSIZE=1, REVERSE_INDICES=ri)

then I use the array c (via reverse_indices) to do my processing of ARRAY in areas of 10x10 (in the example above).

If there is a simpler, better way to do that I'll be happy to know.

JP
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: something (wrong?) with CONGRID?
Next Topic: Re: Book Tour Report

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

Current Time: Thu Oct 09 23:07:53 PDT 2025

Total time taken to generate the page: 0.48648 seconds