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

Home » Public Forums » archive » Re: 2 dimensional array from 3 x 1dimensional arrays
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: 2 dimensional array from 3 x 1dimensional arrays [message #45036 is a reply to message #45035] Thu, 04 August 2005 08:46 Go to previous messageGo to previous message
weitkamp is currently offline  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
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: hours since 1-1-1
Next Topic: Maximum value array resampling

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

Current Time: Fri Oct 10 14:14:25 PDT 2025

Total time taken to generate the page: 0.80093 seconds