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

Home » Public Forums » archive » Summer "English" heat or just me: Array slicing
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: Summer "English" heat or just me: Array slicing [message #85314 is a reply to message #85313] Wed, 24 July 2013 06:57 Go to previous messageGo to previous message
Fabzi is currently offline  Fabzi
Messages: 305
Registered: July 2010
Senior Member
On 07/24/2013 03:46 PM, David Fanning wrote:
> I would if I understood it. :-(

This is what you said 14 years ago ;-)

I think I understood this part:

;-Quoting Henry Chapman----------------------------------------------

There are two behaviours you may want when you try result = array[x,
y,..., z], and x, y, ..., z are 1-d arrays:

1. return a 1-d array with result[i] = array[x[i], y[i],..., z[i]]
2. return a 2-d array with result[i, j,..., k] = array[x[i],
y[j],...,z[k]]

IDL does (1), which requires x, y,...,z all have the same length.
However, IDL does (2) if one of the dimensions is a subscript range.
Since a single number is a subscript range, it will do (2) in that
case. And since 0, written in as an extra dimension is also a subscript
range, IDL will use behaviour (2)
;----------------------------------------------------------- --------

I must admit that I am only really rarely confronted to cases where I
can use this, but it is good to know...
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Thickness of /box_axes?
Next Topic: Dashed linestyle in vectorized function graphics output, IDL 8.2.3

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

Current Time: Fri Oct 10 07:10:55 PDT 2025

Total time taken to generate the page: 1.43905 seconds