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

Home » Public Forums » archive » HASH question
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: HASH question [message #75449 is a reply to message #75367] Tue, 08 March 2011 07:05 Go to previous messageGo to previous message
pgrigis is currently offline  pgrigis
Messages: 436
Registered: September 2007
Senior Member
On Mar 7, 4:02 pm, Paulo Penteado <pp.pente...@gmail.com> wrote:
> On Mar 7, 5:32 pm, Paolo <pgri...@gmail.com> wrote:
>
>> Single stars can easily be located with where:
>
>> ind=where(allstars.starID EQ 'Delta Pavonis',count)
>> if count EQ 1 then print,'The magnitude of '+allstars[ind].starID+' is
>> '+strtrim(allstars[ind].magnitude,2)
>
> I would not call that "easily". The two problems are mentioned in the
> first question: "but I don't a priori know how many stars I have, and
> to find a particular star I'd have to search on the ID element."
>
> The search is awkward and not efficient,
well i never thought of "where" as being particularly awkward
inefficient, yes if used a lot
alternatively the stars could be sorted alphabetically by ID
to allow for fast search

> the arrays cannot have elements dynamically added or removed,

you can do concatenatation to add, say, another bunch of 100 stars
stars can be removed by setting the ID to the empty string or
using array concatenation yet again
not extremly efficient but works

> and they would not avoid
> repetitions (elements with the same key).
stars are unique - so why would he have duplicates?

Ciao,
Paolo
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL 8.0 image() scaling
Next Topic: Floating illegal operand error when reach end of for loop

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

Current Time: Wed Oct 08 13:37:46 PDT 2025

Total time taken to generate the page: 0.00416 seconds