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

Home » Public Forums » archive » Inserting pointer results in an array
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Inserting pointer results in an array [message #49853] Tue, 22 August 2006 10:35 Go to next message
nolan.smith1 is currently offline  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 #49963 is a reply to message #49853] Thu, 24 August 2006 12:14 Go to previous message
nolan.smith1 is currently offline  nolan.smith1
Messages: 12
Registered: June 2005
Junior Member
Thank you. That worked perfectly!

NS
Re: Inserting pointer results in an array [message #49984 is a reply to message #49853] Wed, 23 August 2006 09:06 Go to previous message
Nicolas Decoster is currently offline  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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Adding shapefiles to globe model
Next Topic: Re: Reading HDF5 signed bytes gives strange results [resolved]

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

Current Time: Sat Oct 11 07:08:36 PDT 2025

Total time taken to generate the page: 0.08005 seconds