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

Home » Public Forums » archive » Issue with long integer 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: Issue with long integer arrays [message #86967 is a reply to message #86966] Tue, 17 December 2013 12:12 Go to previous messageGo to previous message
Daniel Otis is currently offline  Daniel Otis
Messages: 5
Registered: January 2012
Junior Member
On Tuesday, December 17, 2013 2:42:49 PM UTC-5, Helder wrote:
> On Tuesday, December 17, 2013 8:20:38 PM UTC+1, do...@mail.usf.edu wrote:
>
>> I should know this, but am having trouble with the following:
>
>>
>
>>
>
>>
>
>> I have several long integer(long) arrays that are restored into the workspace.
>
>>
>
>>
>
>>
>
>> I want to define an array so that my long arrays can be used in a loop later in my program.
>
>>
>
>>
>
>>
>
>> array1=long[25248]
>
>>
>
>> array1=long[2905]
>
>>
>
>> array1=long[4651]
>
>>
>
>> array1=long[4988]
>
>>
>
>>
>
>>
>
>> These are masks used to extract different regions of an image.
>
>>
>
>>
>
>>
>
>> How can I put the arrays into one variable that can be called in a loop?
>
>>
>
>>
>
>>
>
>> It should be simple, but I'm stumped. Thanks,
>
>>
>
>>
>
>>
>
>> Dan
>
>
>
> There are more ways of doing this and depend on thing such as if you know the sizes before hand and so on. So I'll offer one and might not just be the best for your case, but I hope it helps.
>
>
>
> pa = ptrarr(4,/allocate_heap)
>
> *pa[0]=long[25248]
>
> *pa[1]=long[2905]
>
> *pa[2]=long[4651]
>
> *pa[3]=long[4988]
>
>
>
> For i=0,3 do begin
>
> ;your work
>
> print, mean(*pa[i])
>
> endfor
>
>
>
> If you know the sizes before hand, one other solution would be to make one array long as the 4 together and then subscript the array.
>
>
>
> Cheers,
>
> Helder

Thanks. Works great. Never used ptrarr.
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Error opening netCDF file
Next Topic: IDL code for finding solar zenith angle, solar azimuth angle and sun-earth distance basing on lat, lon, julian day number, utc_hours, utc_minutes and utc_seconds information

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

Current Time: Fri Oct 10 10:10:30 PDT 2025

Total time taken to generate the page: 0.80053 seconds