vector subscripts not working [message #88652] |
Sun, 25 May 2014 22:42  |
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   |
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.
|
|
|
|
|