Re: newbie: subarray from array [message #31558] |
Mon, 15 July 2002 10:34 |
James Kuyper
Messages: 425 Registered: March 2000
|
Senior Member |
|
|
nando foppa wrote:
>
> Hello there,
>
> This is my first question in this discussion group - and a simple one:
>
> I have an array with different integer values
> e.g.[10,4,-9999,-9999,4,6,-9999,45,-9999]
> what I need is a new array without the (-9999) values. These values
> represent nodata in my dataset.
> -> [10,4,4,6,45] should be the result.
> I have already tried the function "arrdelete.pro" from Craig Markwardt
> which
> is a function to delete a section of an array. But in my case I have
> different subarray in my array and they are not alwalys at the same
> position.
> With WHERE I can define the position of the (-9999) values but how do
> I delete them automatically form many cases?
> I hope I expressed me correctly and that someone as an idea!
array = array[where(array NE -9999)]
You could put the where() directly inside the array[], but this approach
allows you to
--
James Kuyper
MODIS Level 1 Lead
Science Data Support Team
(301) 352-2150
|
|
|