The code below is a diluted version of the one that I am working on. Basically i would like to divide each element of a 40 element floating array by n.
n refers 512 single arrays. I would like all this done within a for loop of 0, 511 so that the 40 element array would be divided by one n per increment in the loop.
In the end I would like each of the 512 40 element arrays to be plotted against 512 arrays of 40 elements each. However I seemed to be stuck.....any ideas?
thanks
terry
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
pro cal
image=mrdfits('/home/terry/jtse2-1.fts')
gen=indgen(131)
tb= gen[90:130] * (0.048/210.)
XX=ATAN(tb) ;angle at every point ; 512 fltarr of 41 elements
help,COS(XX)
x0=346.5
y0=38.
x2=511.
for y2=0,512 do begin
prof_right=profile_ni(image,[[x0,y0],[x2,y2]]);generates multiple profiles of image
max_dist=lclxtrem(prof_right[90:130],40,/MAXIMA);finds the maximum of each profile and returns position along profile
max_dist=max_dist+90 ;find the distance of the maximum point from 90
fringe_1=prof_right[90:130]
mf1=max(fringe_1)-fringe_1 ; find the maximum value of each profile and subtract all other values from this max.
;print,y2,mf1
;ta=Tan (A)
ta = max_dist * (0.048/210.)
A=ATAN(ta);angle at maxima;512 fltarrs of 1 element each
n = (2.*296.*COS(A))/(0.5303) ; 512 single arrays
;print,y2,n
ll=(2.*296.*COS(XX)) ; 512 identical arrays of 40 elements each
print,ll,y2
ll=ll/n ; I would like to divide each 40 element of each array ll by n with +1 increments in n.
;ll comes out as an array of 1 element!
llo=(2.*296.*COS(A))/(n)
wavelength=(ll-llo)*10000 ; microns to angstroms ; should be 512 arrays of 40 elements each
;print,wavelength,mf1
;eventually want all 512 plots of wavelength vs mf1
endfor
end
|