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

Home » Public Forums » archive » Re: Selecting data from two separate 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: Selecting data from two separate arrays [message #71512 is a reply to message #71511] Mon, 21 June 2010 13:33 Go to previous message
MarioIncandenza is currently offline  MarioIncandenza
Messages: 231
Registered: February 2005
Senior Member
On Jun 21, 12:57 pm, Fster <francis.colle...@live.co.uk> wrote:
> Would it be easier to combine them into one array? The issue is that
> one array is on the x and y axis, and the other is on x, y, z axis,
> BUT the x and y axis are the same for each of the arrays and equal
> number of grid points...

So, you want to select points from the XY array, and the extract the
corresponding data from the XYZ array, right?

There are quite a few ways to do this. Here's a simple one, not the
fastest, but the simplest code-wise:

DATA2 = <XY data>
DATA3= <XYZ data>
;Get size of Z dimension
NZ=(size(DATA3))[3]
; pick points from the XY data
F2 = WHERE(DATA2 ge VALUE,NF2)
; set up an array to hold the extracted 3D data
DATA3_EXTRACT = FLTARR(NF2,NZ)
; load the data into the array
for IZ=0l,NZ-1 do DATA3_EXTRACT[*,IZ]=(DATA3[*,*,IZ])[F2]
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: MPFIT Chance probability
Next Topic: I/O with file lists

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

Current Time: Wed Oct 08 19:25:55 PDT 2025

Total time taken to generate the page: 0.16153 seconds