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

Home » Public Forums » archive » vector subscripts not working
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
vector subscripts not working [message #88652] Sun, 25 May 2014 22:42 Go to next message
jiaxinxin is currently offline  jiaxinxin
Messages: 4
Registered: May 2014
Junior Member
Hi,Everyone
why the routine gives me an error message:
% Array subscript for X must have same size as source expression.
************************************************************ *

pro timestrap
set_plot,'win'
rawfile=file_search('D:\20130313\LuckImage_3\*.fits') & DEVICE,DECOMPOSED=0 & LOADCT,0
data=fltarr(400,300,242)
window,1,xs=350,ys=500
for i=0,242-1 do begin
a=readfits(rawfile[i],h) & a=a/mean(a)*500 & a1=readfits(rawfile[i+3],h) & a1=a1/mean(a1)*500
log=0
if (log eq 1) then begin
endif else begin
a=a1-a & jz=15
if(max(a)gt jz)then a(where(a gt jz))=jz
if(min(a)lt -jz)then a(where(a lt -jz))=-jz
endelse
a=a[524:*,30:530-1] & b=fltarr(750,750) & b [125:624,125:624]=a & b=rot(b,-30)
b=b[275:674,225:524]
data[*,*,i]=b
endfor
cc=fltarr(250,460) & for i=0,22 do cc[*,i*20+1:i*20+19]=data[150:*,120+7:138+7,i*4+10]& tvscl,cc
end


--
jiaxinxin
http://compgroups.net/comp.lang.idl-pvwave/
Re: vector subscripts not working [message #88653 is a reply to message #88652] Sun, 25 May 2014 23:57 Go to previous messageGo to next message
Mats Löfdahl is currently offline  Mats Löfdahl
Messages: 263
Registered: January 2012
Senior Member
Den måndagen den 26:e maj 2014 kl. 07:42:34 UTC+2 skrev jiaxinxin:
> Hi,Everyone
>
> why the routine gives me an error message:
>
> % Array subscript for X must have same size as source expression.

You could just do "help" for both the left hand side and the right hand side of the assignment that gives the error.

Like

IDL> help, b[125:624,125:624], a

or

IDL> help, cc[*,i*20+1:i*20+19], data[150:*,120+7:138+7,i*4+10]

depending on which line has the error.
Re: vector subscripts not working [message #88663 is a reply to message #88652] Wed, 28 May 2014 03:02 Go to previous messageGo to next message
jiaxinxin is currently offline  jiaxinxin
Messages: 4
Registered: May 2014
Junior Member
Thank you very much!

jiaxinxin
--
Re: vector subscripts not working [message #88664 is a reply to message #88652] Wed, 28 May 2014 03:02 Go to previous message
jiaxinxin is currently offline  jiaxinxin
Messages: 4
Registered: May 2014
Junior Member
Unfortunately, if i change the data used by the routine can run .
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: idl crashes
Next Topic: modifying hash/dict elements

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

Current Time: Wed Oct 08 15:14:31 PDT 2025

Total time taken to generate the page: 0.00685 seconds