[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: "clamping" an array to a maximum value?
- Subject: Re: "clamping" an array to a maximum value?
- From: Kevin Ivory <Kevin(at)Ivory.de>
- Date: Wed, 23 Dec 1998 17:58:46 +0100
- Newsgroups: comp.lang.idl-pvwave
- Organization: Max-Planck-Institut fuer Aeronomie
- References: <75l3vi$nit$1@nnrp1.dejanews.com> <367E2717.F0FD5F90@Ivory.de> <367E6666.D52494DD@io.harvard.edu> <367E945C.A1959EB9@Ivory.de> <MPG.10e862e83fcba93a9896ba@news.frii.com> <367FC04A.2220FE@io.harvard.edu>
- Xref: news.doit.wisc.edu comp.lang.idl-pvwave:13220
Martin Schultz wrote:
> BTW: How about a "last element" operator? I very often need something like
> subdata = data[*,0:n_elements(data[0,*])-1]
Just for completeness: that's probably supposed to be
subdata = data[*,0:n_elements(data[0,*])-2]
Otherwise your problem is trivial and you might as well write
subdata = data
Sorry, no better idea for the original problem, though. Everything
I can think of at the moment is even more complicated. :-(
(Or equivalent:
n_elements(data[0,*]) is the same as (size(data))[2]
which admittedly is not much clearer.)
Happy holidays,
Kevin
--
Kevin Ivory Tel: +49 5556 979 434
Max-Planck-Institut fuer Aeronomie Fax: +49 5556 979 240
Max-Planck-Str. 2 mailto:Kevin@Ivory.de
D-37191 Katlenburg-Lindau, GERMANY http://ivory.de/