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

Home » Public Forums » archive » Re: Make_array() and using arrays as subscripts
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: Make_array() and using arrays as subscripts [message #46851 is a reply to message #46850] Tue, 10 January 2006 00:13 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
Hi Sheldon,

well, reading the title of this posting I don't see where Make_array()
comes into your question, but anyway ... :-)

Like said already, WEHRE always returns a 1-dimensional vector, so here
you loose your dimensions in my_array. If you can be sure that
good_indices always is a factor of 3 (i.e., if a line contains '9999',
all 3 elements are equal to ''9999'), then you can use a simple

my_array = reform(my_array, 3, n_elements(good_indices)/3)

to get things right again.

However, if this is not the case, I can suggest yet another approach
without loops:

good_indices = where(strpos(strjoin(my_array), '9999')) eq -1)

Mind that in this case good_indices is only "valid" on the second
dimension, so at maximum it can have 344 elements. I am just
concatenating each line into one string each and look for the occurence
of '9999' within the string. If this substring does not occur at all,
it's a good line.

Then you can use

my_array = my_array[*, good_indices]

to shrink your array to the good lines without the nodata value.

Cheers,

Peter
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: making multiple histogram plots
Next Topic: Re: Mac Version Structure

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

Current Time: Thu Oct 09 02:48:22 PDT 2025

Total time taken to generate the page: 0.64076 seconds