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

Home » Public Forums » archive » Array juggling help needed
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: array juggling [message #51163 is a reply to message #45686] Wed, 08 November 2006 10:38 Go to previous messageGo to previous message
greg michael is currently offline  greg michael
Messages: 163
Registered: January 2006
Senior Member
I was going to suggest this, but I see JD's is way more concise!

Hi Maike,

If I understand what you've written, you have a mask of 6500 points
that you're interested in out of a grid of 360x181 (=65160), described
by your two vectors latindex, lonindex.

I would:

1. convert this to a 2-d mask:

mask=bytarr(360,181)
mask[lonindex,latindex]=1

2. and use this mask to extract the columns:

find the indices of the elements of the mask which you need:

q=where(mask eq 1)

rearrange the cube into 2d, so that you can use the indices to pick out
the columns:

temp2d=reform(temp3d,360*181,60)

and then extract the columns:

result=temp2d[q,*]

result should be an array of (6500,60)


regards,
Greg
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: Concatenate arrays of different dimensions
Next Topic: Aspect ratio(s) in iTools

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

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

Total time taken to generate the page: 0.00410 seconds