Re: 2 dimensional array from 3 x 1dimensional arrays [message #45028] |
Fri, 05 August 2005 08:53 |
Timm Weitkamp
Messages: 66 Registered: August 2002
|
Member |
|
|
James Kuyper wrote:
> weitkamp@esrf.fr wrote:
> ...
>> And, by the way, would anyone know how to coax Google Groups into
>> putting a quote of the original posting into one's own message? ...
>
> For me, when I select "Show options" at the top of the message I want
> to reply to, and then select "Reply", the quoted text of the message
> I'm replying to appears automatically in my new message window.
Thank you, James. It hadn't occurred to me that the "Reply" link at the
top might not do the same thing as the "Reply" link at the bottom of
the message. How foolishly naive of me. Sorry for not trying before
posting.
Timm
Timm Weitkamp
ESRF, Grenoble, France
|
|
|
Re: 2 dimensional array from 3 x 1dimensional arrays [message #45034 is a reply to message #45028] |
Thu, 04 August 2005 09:39  |
James Kuyper
Messages: 425 Registered: March 2000
|
Senior Member |
|
|
weitkamp@esrf.fr wrote:
...
> And, by the way, would anyone know how to coax Google Groups into
> putting a quote of the original posting into one's own message? ...
For me, when I select "Show options" at the top of the message I want
to reply to, and then select "Reply", the quoted text of the message
I'm replying to appears automatically in my new message window.
> ... And
> putting my name instead of a mutilated version of my e-mail address?
Right now, as I type this, there's a section above my text window which
includes a line which says:
From: James Kuyper <kuyper@wizard.net> - change nickname
The "change nickname" is a link that leads to a window which I just
used to put in "James Kuyper". I didn't need to provide the
"<kuyper@wizard.net>"; Google adds that automatically. Note: if your
nickname is too long, you'll only be able to see the whole thing by
selecting the "show original" option (which will only appear after you
select "show options").
|
|
|
Re: 2 dimensional array from 3 x 1dimensional arrays [message #45035 is a reply to message #45034] |
Thu, 04 August 2005 08:58  |
weitkamp
Messages: 33 Registered: October 1998
|
Member |
|
|
Wait, wait, that was wrong. Oh darn. Make that:
ny = ... ; Number of rows in 2D array
nx = N_ELEMENTS(arr1) / ny ; Number of columns in 2D array
result = FLTARR(nx, ny) ; Make 2D array
result[*] = arr3 ; Fill 2D array
And then there's a chance it'll work. Sorry about that.
And, by the way, would anyone know how to coax Google Groups into
putting a quote of the original posting into one's own message? And
putting my name instead of a mutilated version of my e-mail address?
(sigh)
Timm
Timm Weitkamp, ESRF, Grenoble (where they don't have news server)
|
|
|
Re: 2 dimensional array from 3 x 1dimensional arrays [message #45036 is a reply to message #45035] |
Thu, 04 August 2005 08:46  |
weitkamp
Messages: 33 Registered: October 1998
|
Member |
|
|
Martin,
You're not very specific about your input data, but from what you write
it seems like
- your data are regularly gridded,
- you know beforehand how many rows and columns your 2D array will
have,
- the values in Arr1 are monotonically increasing or decreasing,
- the values in Arr2 are monotonically increasing or decreasing
for each set of triples with a given value of Arr1.
In that case, a solution of the problem might look like this:
nx = N_ELEMENTS(arr1) ; Number of columns in 2D array
ny = ... ; Number of rows in 2D array
result = FLTARR(nx, ny) ; Make 2D array
result[*] = arr3 ; Fill 2D array
Whether it is the shortest, fastest, most elegant, or whatever
solution, I don't know, but it should work.
Hope this helps,
Timm
--
Timm Weitkamp
ESRF, Grenoble, France
|
|
|
Re: 2 dimensional array from 3 x 1dimensional arrays [message #45037 is a reply to message #45036] |
Thu, 04 August 2005 07:22  |
peter.albert@gmx.de
Messages: 108 Registered: July 2005
|
Senior Member |
|
|
Hi Martin,
although the way how exactly you would like to redistribute the
vectors' contents is not fully clear to me, I'll just assume the simple
case that e.g. Arr2[3] will become A[2, 3] etc., i.e. the fourth
element of the third vector will become the fourth element in the third
line of the new array. If that's not what you want, please excuse. It
is surely not what you write above, but I just don't see the system
behind that ...
Well, anyway, in that simple case, something like
IDL> a = [[v1], [v2], [v3]]
does the trick in case that each vector vi is a row vector of exactly
one dimension, i.e., "help v1" should give "... INT = ARRAY[n]"
In case the vectors are column vectors of the type [1, n], the above
line becomes
IDL> a = [v1, v2, v3]
Best regards,
Peter
|
|
|