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 #55260 is a reply to message #55061] Wed, 08 August 2007 21:43 Go to previous message
snudge42 is currently offline  snudge42
Messages: 4
Registered: July 2007
Junior Member
On Jul 31, 2:19 am, "Jean H." <jghas...@DELTHIS.ucalgary.ANDTHIS.ca>
wrote:
>> 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!

Lots to think about there, thanks everyone. =)
[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: Sat Nov 29 03:43:22 PST 2025

Total time taken to generate the page: 1.44051 seconds