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

Home » Public Forums » archive » 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 #90415 is a reply to message #90413] Mon, 02 March 2015 07:31 Go to previous messageGo to previous message
Helder Marchetto is currently offline  Helder Marchetto
Messages: 520
Registered: November 2011
Senior Member
On Monday, March 2, 2015 at 4:19:32 PM UTC+1, g.na...@gmail.com wrote:
> I have a 2D array of A=[200,200]
>
> I am running REFORM but get the following error
> "REFORM: New subscripts must not change the number elements in A"
>
> This is what I am doing
> A = reform(A, 100L, 200L*200L, /overwrite)
>
> Why isn't it working?

Because 4000 is not 4000000.
Let me show:
IDL> A=randomu(s,200,200)
IDL> print, product(size(a, /dimensions), /preserve_type)
40000
IDL> print, product([100L, 200L*200L], /preserve_type)
4000000

If your array is has 200 x 200 elements, the total is 40000.
Now with reform you want to make it 100 x (200x200)... this is 4000000.
Maybe (maybe!) what you want is:
a = reform(a, 100l, 200l*2l, /overwrite)

Cheers,
Helder
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: function graphics event handling
Next Topic: Image in color scale and gray level scale.

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

Current Time: Wed Oct 08 17:34:06 PDT 2025

Total time taken to generate the page: 0.00467 seconds