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

Home » Public Forums » archive » Re: how to preserve trailing Shallow dimensions!
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: how to preserve trailing Shallow dimensions! [message #61933] Thu, 14 August 2008 06:39 Go to previous message
vino is currently offline  vino
Messages: 36
Registered: March 2008
Member
Hi!
Thank you very much for the reply. As you said, my problem is with the
size function. I am doing stellar photometry. I store star position
in an array and most of the time, i am tracking more than 1 star but
the problem arose when i had only star in my image. But i think the
problem might be solved if i follow your example...
Thanks again,
Vino





On Aug 14, 2:28 pm, Vince Hradil <hrad...@yahoo.com> wrote:
> On Aug 14, 6:33 am, vino <astrocr...@gmail.com> wrote:
>
>> Hello Everyone,
>> I was wondering whether there is any way i can preserve a trailing
>> shallow dimension in array?
>
>> eg:
>> IDL> ab=make_array(2,1,1)
>> IDL> print,size(ab,/dimensions)
>> 2
>> How can i make it preserve it as 2 1 1?
>
>> Thanks and regards,
>> Vino
>
> Perhaps you should tell us why... The answer may be different than
> you expect...
>
> So, anyways, the trailing dims are "still there" as 1's:
>
> IDL> f = findgen(3,1,1)
> IDL> help, f
> F FLOAT = Array[3]
> IDL> help, f[*,0]
> <Expression> FLOAT = Array[3]
> IDL> help, f[*,0,0]
> <Expression> FLOAT = Array[3]
> IDL> print, f
> 0.000000 1.00000 2.00000
> IDL> print, f[*,*]
> 0.000000 1.00000 2.00000
> IDL> print, f[*,0]
> 0.000000 1.00000 2.00000
> IDL> print, f[*,0,0]
> 0.000000 1.00000 2.00000
> IDL> print, f[*,*,*]
> 0.000000 1.00000 2.00000
>
> If you are worried about the SIZE function:
> IDL> fsize = size(f,/dimensions)
> IDL> nx = fsize[0]
> IDL> if n_elements(fsize) gt 1 then ny = fsize[1] else ny = 1L
> IDL> if n_elements(fsize) gt 2 then nz = fsize[2] else nz = 1L
> etc...
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: LaTex?
Next Topic: A question about map projection

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

Current Time: Sat Oct 11 11:01:15 PDT 2025

Total time taken to generate the page: 0.87960 seconds