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

Home » Public Forums » archive » 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
Help with Histogram... [message #45745] Tue, 27 September 2005 14:45
MA is currently offline  MA
Messages: 15
Registered: August 2005
Junior Member
Sorry, some people here are surely starting to get sick of Histogram by
now...
I've been reading the tutorial a couple of times in the last few weeks,
and I've actually managed to get rid of a lot of unneccessary loops and
stuff. I have a problem here, and I'm almost sure there must be a way
to do it with histogram, but can't figure out how.
I have an (as yet empty) array (profile=IntArr(60)), each index
corresponding to a height level (e.g. surface to 20km, unevenly
spaced), and two arrays (base, top, each FltArr(8)) containing the
height of eight cloud bases and cloud tops. I want to set the value of
the levels in 'profile' that fall between a cloud base and a cloud top
(i.e. are "inside" a cloud) with a 1. Here's an attempt at an
illustration:

profile value of
levels profile
.
.
.
- 0
- 0
- ------ top[1]=8000m 1
- 1
- 1
- ------base[1]=7300m 1
- 0
- 0
- 0
- ------top[0]=500m 1
- 1
- ------base[0]=370m 1
- 0
- 0
------------------------------
/////////surface/////////////////

How can I do that without looping? If I could specify the histogram
bins by hand, I'd set them to the cloud base and top levels, and let
histogram sort 'profile' into those bin. At fist I thought the keyword
'Locations' would let me do that, but I guess I got that wrong.
The only thing I can think of is something along the lines of

index=Where((profile GE base[0] AND profile LE top[0]) OR $
(profile GE base[1] AND profile LE top[1]) OR $
...
(profile GE base[7] AND profile LE top[7]))
profile[index]=1

Any ideas? As an aside, I got a couple of thousand profiles like that,
and 'profile' is really an array of (number_of_profiles x 60). If
there's any way to do this problem without looping over the individual
profiles, that would be even better.

Thanks!
[Message index]
 
Read Message
Previous Topic: How to disable "auto debug mode" in idlwave?
Next Topic: USERSYM filled AND outlined?

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

Current Time: Wed Oct 08 15:53:09 PDT 2025

Total time taken to generate the page: 0.00355 seconds