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

Home » Public Forums » archive » Re: Really BASIC idl programming question
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
Re: Really BASIC idl programming question [message #37805] Sat, 24 January 2004 03:13
Chris Lee is currently offline  Chris Lee
Messages: 101
Registered: August 2003
Senior Member
In article <7d715aa0.0401231820.4a34c719@posting.google.com>, "BG"
<u2s5thmember@yahoo.com> wrote:

> I pick all the data 1) where the "num" array is
> between 0 and 1, and "temp" is between 195-200.
> 2) where "numb" is between 0.1 and 1, and "temp" is between 195 and 200.
> 3) "num": 0.2 through 1 and "temp": 195 to 200 4) .... and so on...
<....snip...>
> I know I should be using multidimensional arrays, but I always get stuck
> trying to define "new_array" without using all these repeated where
> statements.
> Thanks for suffering through this! I would Dearly appreciate ANY
> suggestions (other than quit programming!) ;) thanks again!

Hi,

The easiest method I can come up with is almost the
same as yours, except the WHERE statements involving temperature are
rolled into a histogram function...e.g

;find the 'num' ranges first
a=where(num gt 0,count_a)
b=where(num gt 0.1,count_b)
c=where(num gt 0.2,count_c)

;use each 'num' range in a histogram
if(count_a gt 0) then ha=histogram(temp[a], binsize=5, min=195, max=205)
if(count_b gt 0) then hb=histogram(temp[b], binsize=5, min=195, max=205)
if(count_c gt 0) then hc=histogram(temp[c], binsize=5, min=195, max=205)

new_array=[ha,hb,hc]

;
;
The only matrix method I can think of wouldn't be any quicker and would
probably use more memory.

Chris.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Object Graphics + Convolution with Point Spread Function
Next Topic: Extracting ROI without IDL objects is it possible

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

Current Time: Wed Oct 08 19:42:00 PDT 2025

Total time taken to generate the page: 0.00403 seconds