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

Home » Public Forums » archive » HISTOGRAM and string data
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
HISTOGRAM and string data [message #53810] Wed, 02 May 2007 17:55
MarioIncandenza is currently offline  MarioIncandenza
Messages: 231
Registered: February 2005
Senior Member
Hello IDL Wizards,

I did a search on the group for this, and found a post whose _subject_
was my problem exactly, but the poster actually wanted something
completely different (and was instantly satisfied).

I have an application where I have an array of STRING_DATA, and I need
to calculate stats of FLOAT_DATA based on the value of STRING_DATA. If
HISTOGRAM worked on strings, this would be as simple as:

hstr=histogram(STRING_DATA,reverse_indices=ristr)
answer=hstr * 0.0
for i=0l,n_elements(hstr) do if(hstr[i] gt 0) then answer[i] =
f(FLOAT_DATA[ristr[ristr[i]:(ristr[i+1]-1)]])

I thought UNIQ might help me, but it depends on doing a SORT, and
sorting DATA is something I'd like to avoid if possible.

One approach is to convert the STRING_DATA into some form of number,
like longword integers. Any suggestions on how to do that without
creating a very sparse field (if the resulting histogram has 1e8
elements, that isn't necessarily going to work)?

Oh, and feel free to bring on the slow solutions, this is not a time-
dependent problem ;)

--Edward H.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: 3d displaying with x=longitude, y=latitude, z=altitude, but not yet working (T_T)
Next Topic: Re: structures, arrays of pointers and assignment

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

Current Time: Wed Oct 08 17:08:55 PDT 2025

Total time taken to generate the page: 0.00498 seconds