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

Home » Public Forums » archive » Re: Another simple one
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: Another simple one [message #55061] Mon, 30 July 2007 09:19 Go to previous message
Jean H. is currently offline  Jean H.
Messages: 472
Registered: July 2006
Senior Member
> Is that possible? Or does my array have to be square so have to
> truncate the whole thing at element 4 for example?
>
> Cheers,
>
> Snudge42
>

Hi,

You can also use a 1D array containing all of your data... then you
should know which entries correspond to which line...

ex: a = [1,2,3,4,5,6]

you can think of A as
1,2,3
,4,5
, ,6

So, but this starts to be useful with big arrays, you can have a 2D
array that indexes the 1D array...

ex:
indices2Dto1D = [[0,1,2],[-1,3,4],[-1,-1,5]]
print, "value of 2,2 = ", a[indices2Dto1D[2,2]] ==> 6
and
indices1Dto2D = [0,1,2,4,5,8]
print, "2D coords of the value 6 = ", indices1Dto2D[where(a eq 6)] ==>
8 (this is the 1D coordinate in the 2D array... you can transform it
back to 2,2)

Jean
PS: I use this all the time to keep satellite images covering a study
area having a crazy shape... I save about 75% of the otherwise required
memory! ... I have to keep only 1 array covering the entire area, and
all the other arrays cover only the study area!
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Question regarding HDF file
Next Topic: Assimilating three files considering their DOY and overpassing time

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

Current Time: Wed Oct 08 15:52:25 PDT 2025

Total time taken to generate the page: 0.00394 seconds