Inserting pointer results in an array [message #49853] |
Tue, 22 August 2006 10:35  |
nolan.smith1
Messages: 12 Registered: June 2005
|
Junior Member |
|
|
Hello,
I was wondering if anyone has a suggestion about a problem that I have.
I have an array of star positions (ra,dec) that I want to know whether
they satisfy specific criteria. The number of specific criteria is 40.
I am using pointers to find which stars satisfy the criteria each time.
find=ptrarr(40)
FOR i=0,39 DO BEGIN
find(i)=ptr_new(where(CRITERIA))
ENDFOR
I want to store the results of all the different criteria in one array:
final_array=[*find[0],*find[1],*find[2],.......,*find[38],*f ind[39]]
Is there any other way to do that using a loop?
Thank you for the help,
NS
|
|
|
|
Re: Inserting pointer results in an array [message #49984 is a reply to message #49853] |
Wed, 23 August 2006 09:06  |
Nicolas Decoster
Messages: 34 Registered: March 2000
|
Member |
|
|
nolan.smith1@gmail.com a �crit :
> Hello,
>
> I was wondering if anyone has a suggestion about a problem that I have.
> I have an array of star positions (ra,dec) that I want to know whether
> they satisfy specific criteria. The number of specific criteria is 40.
> I am using pointers to find which stars satisfy the criteria each time.
>
> find=ptrarr(40)
> FOR i=0,39 DO BEGIN
> find(i)=ptr_new(where(CRITERIA))
> ENDFOR
>
> I want to store the results of all the different criteria in one array:
> final_array=[*find[0],*find[1],*find[2],.......,*find[38],*f ind[39]]
>
> Is there any other way to do that using a loop?
>
> Thank you for the help,
> NS
>
try something like:
final_array = *(find[0])
FOR i=1,39 DO BEGIN
final_array = [final_array, *(find[i])]
ENDFOR
|
|
|