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

Home » Public Forums » archive » Re: drop array elements
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: drop array elements [message #21461] Fri, 25 August 2000 00:00 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
Matthew Kay <mwk@crml.uab.edu> writes:
> Hi,
>
> Would anyone have any suggestions for an easy way
> to drop elements in an array? For example, say 'a'
> is a 14x1024 array and 'b' is a 1x25 array of row
> indicies in 'a' that should be dropped. Is there
> a simple command for re-assigning 'a', without the
> 25 rows indicated in 'b'?

The best way to go after this is to rephrase the question so that BP
(b-primed) is the list of rows to *keep*. Then it's easy:

a = a(*,bp)

This, in the end, is what JD was getting after. A way to see this
more clearly might be to do it in steps like this:

tmp = intarr(1024) + 1 ;; Create a mask with all 1's by default
tmp(b) = 0 ;; Zero out the discarded rows
bp = where(tmp EQ 1, ct) ;; Find the kept rows - compute BP
if ct GT 0 then a = a(*,bp) ;; Extract those rows

Good luck,
Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: PV-WAVE Runtime Mode Balks
Next Topic: PV-WAVE Runtime Mode Balks

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

Current Time: Fri Oct 10 12:40:47 PDT 2025

Total time taken to generate the page: 1.12264 seconds