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

Home » Public Forums » archive » Re: REFORM: new subscripts must not change the number elements in array
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: REFORM: new subscripts must not change the number elements in array [message #77951 is a reply to message #77949] Sat, 15 October 2011 06:38 Go to previous message
David Grier is currently offline  David Grier
Messages: 35
Registered: July 2010
Member
Hi Eva,

If ns and nl are "regular" integers, then ns * nl can overflow the
maximum integer, leading to the behavior you describe.

Casting ns and nl to long integers will fix this:

IDL> ns = 1194
IDL> nl = 686
IDL> print, ns * nl ; WRONG
32652

IDL> ns = 1194L
IDL> nl = 686L
IDL> print, ns * nl ; RIGHT
819084

TTFN,

David


On 10/15/11 7:34 AM, eva.ivits-wasser@ext.jrc.ec.europa.eu wrote:
> Good day,
>
> I have a 3D array of
> ts=Int[1194,12,686]
>
> It's an image with 1194 columns, 12 bands and 686 lines.
>
> I'm running REFORM on the transposed array but get the well known
> error message:
> "REFORM: New subscripts must not change the number elements in
> <INT Array[1194, 686, 12]>"
>
> This is what I'm doing:
> tr=reform(transpose(ts,[0,2,1]),ns*nl,nb)
>
> i.e. first I transpose the lines onto the second dimension and then
> create "tr" so that it is a 2D array of ns*nl (1194*686) and nb (12).
>
> Why isn't it working?
>
> I'm desparate....pls help!
>
> Thanks,
>
> Eva
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: compute quartiles of a distribution
Next Topic: Re: Matrix in IDL

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

Current Time: Thu Oct 09 21:43:31 PDT 2025

Total time taken to generate the page: 0.31934 seconds