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

Home » Public Forums » archive » Re: Help with Histogram...
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 with Histogram... [message #45741 is a reply to message #45738] Wed, 28 September 2005 01:47 Go to previous messageGo to previous message
peter.albert@gmx.de is currently offline  peter.albert@gmx.de
Messages: 108
Registered: July 2005
Senior Member
Me again :-)

here is a solution for n_profiles at once, which at the end just needs
one loop over all profile levels, which is probably acceptible ...

; Let's try 10 profiles:
n = 10

; Arbitrary clouds
base = (findgen(8) * 1000.) ## (intarr(n) + 1)
top = base + 300.

; Let's make one different from the others:
base[5, *] = base[5, *] * .5
top[5, *] = top[5, *] * .5

; This is the same as above
profile = intarr(n, 60)
height_level = [0., exp((findgen(60)-30) / 15.)] * 1300.
x = indgen(61)
base_idx = ceil(interpol(x, height_level, base))
top_idx = floor(interpol(x, height_level, top))

; Now, this is the loop over the profile levels:
; For each level we check for all profiles at once
; whether level "i" is within the borders as given
; by base_idx and top_idx:

for i = 0, 59 do $
profile[*, i] = $
total($
base_idx le i and top_idx ge i $
, 2) $
gt 0


I gave it a quick check and the result looked right to me, but feel
free to tell me if it does not what you expect.

Best regards,

Peter
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: polyfill
Next Topic: Shapefile to ROI in script

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

Current Time: Fri Oct 10 06:53:58 PDT 2025

Total time taken to generate the page: 1.12263 seconds