Commit b3160af3 authored by Didier Richard's avatar Didier Richard
Browse files

Linux draw font 'fixed'. D16 new macros.

parent 1f3e5053
......@@ -9,7 +9,7 @@ print,""
!warn.obs_sysvars = 1
!warn.parens = 1
.run sys_dep.pro
.run sys_dep.pro
.run stime.pro ;in lamp\ or legacy\
lamd=sys_dep("GETENV","LAMP_DIR")
......@@ -48,9 +48,9 @@ print,"Compiling scan ...2" & wait,.1
!warn.parens = 0
.run read_par.pro ;in lamp_mac\
print,"Saving "+lamd+divd+"lamp.sav ...1" & wait,.1
if sys_dep("VERSION") ge 5.3 then save,/routines,filename=lamd+divd+"lamp.sav" ;,/compress
if sys_dep("VERSION") lt 5.3 then save,/routines,filename=lamd+divd+"lamp.sav"
print,"Saving "+lambd+divd+"lamp.sav ...1" & wait,.1
if sys_dep("VERSION") ge 5.3 then save,/routines,filename=lambd+divd+"lamp.sav" ;,/compress
if sys_dep("VERSION") lt 5.3 then save,/routines,filename=lambd+divd+"lamp.sav"
print,""
print,"Enter lamp or @lamp.ini to start lamp"
......
......@@ -280,7 +280,7 @@ pro P_DID_CREATE_MORE, bsxy,bsoptf,bsopt0
if sys_dep('MAP') ne -1 then $
bidbg =widget_button(bsbs ,font=ft_smallest,value='Bg' ,uvalue=[-88,344,0],resource_name='discret') else $
bidbg =widget_button(bsbs ,font=ft_smallest,value='Bg' ,uvalue=[-88,344,0])
widget_control,bidFill,set_button=did_repr[21]
widget_control,bidbg,set_button=did_repr[21]
endelse
; -----
if sys_dep( 'MACHINE') eq 'win' then cap=1 else cap=0
......@@ -1163,7 +1163,7 @@ pro P_AFTER_REALIZE_DID ,sepben,sepdon,sepdid
if ii eq 0 then logo,1
if did_wd gt 0 then begin & catch,stat
if stat eq 0 then device ,font=sys_dep('FONTD') & catch,/cancel
if stat eq 0 then device ,set_font=sys_dep('FONTD') & catch,/cancel
endif
if lamp_focus gt 0 then widget_control,bad_id=i,lamp_focus,set_value='',/append,/no_newline,$
/input_focus
......@@ -6455,7 +6455,7 @@ IF n_tags(alter) gt 0 then begin
if did_etc.spDid gt 0 then begin ; is active
IdlMem = memory(/current)/1024000. ; Memory used by Idl in Mbytes
curTim = systime(1)
MN = 9. ; Number of minutes before asking memory info to the system
MN = 5. ; Number of minutes before asking memory info to the system
if (curTim - did_etc.spTim) gt 60.*MN then DF = 0 else DF = 50
if abs(IdlMem - did_etc.spMemIdl) gt DF then begin ; DF MegaBytes in difference so update progress bar
did_etc.spMemIdl = IdlMem
......@@ -6585,15 +6585,21 @@ if n_elements(s) eq 1 then begin ; S=SNAi should be 0 to redo the snapshoot
s=tvrdd() & endif
if sz[0] eq 2 then begin & i=sz[1]<aa>(aa/2) & j=sz[2]<bb>(bb/2)
s=bytscl(congrid(w,i,j))
s=congrid(w,i,j)
maxi =max(s)
media=median(s)
if (media gt 0.) then if (maxi/media gt 1000.) then s = alog(s>media)
s=bytscl(s)
tv ,s,(aa-i)/2,(bb-j)/2 & endif
if sz[0] eq 3 then begin & i=sz[1]<aa>(aa/2) & j=sz[2]<bb>(bb/2) & k=sz[3]<40
if sys_dep('VERSION') ge 4.0 then ii=execute('s=transpose(congrid(w,i,j,k),[2,0,1])') $
else s =congrid(w,i,j,k)
maxi=max( s,min=mini) & thresh=mini+(maxi-mini)/3.
maxi =max(s,min=mini)
media=median(s)
if (media gt 0.) then if (maxi/media gt 1000.) then s = alog(s>media)
maxi =max(s,min=mini) & thresh=mini+(maxi-mini)/3.
shade_volume,s,thresh,v,p
if n_elements(p) gt 3 then begin
s={w:s,thresh:thresh,v:v,p:p}
......@@ -6604,7 +6610,8 @@ if n_elements(s) eq 1 then begin ; S=SNAi should be 0 to redo the snapshoot
set_shading,reject=0 & tvscl,polyshade(v,p,/t3d) & set_shading,reject=1
s=tvrdd()
endif else begin
s=bytscl(congrid(total(w,3),i,j))
s=congrid(total(w,3),i,j)
s=bytscl(s)
tv ,s,(aa-i)/2,(bb-j)/2 & endelse
endif
endif ; n_elements(w) gt 1
......
FUNCTION scale_d16, win, factors=factors
;+
;******* ***********
;**
;** User callable
;** The call is w6=merge_d16(w1)
;**
;** win is a 2D diffractogram from D16 as returned by the straight_d16 routine,
;** i.e. I(2-theta, scan)
;-
;get variables associated with win
take_datp, datp
s = size(win)
size_x = s[1]
if s[0] eq 1 then nscans = 1 else nscans = s[2]
;if multiplication factors not given, determine them
if n_elements(factors) eq 0 then begin
factors = [1.0]
for i = 0, nscans-2 do begin
lowlim = datp.x[0,i+1]
uplim = datp.x[-1,i]
tmp1 = where(datp.x[*,i] ge lowlim and datp.x[*,i] le uplim)
tmp2 = where(datp.x[*,i+1] ge lowlim and datp.x[*,i+1] le uplim)
;ratio = mean(win[tmp1,i]) / mean(win[tmp2,i+1])
ratio = median(win[tmp1,i]) / median(win[tmp2,i+1])
factors = [factors, ratio]
endfor
endif
;scale scans
wout = win
for i = 0, nscans-1 do begin
wout[*,i] *= product(factors[0:i])
datp.e[*,i] *= product(factors[0:i])
;print, 'scan i = ', i, ' x ', product(factors[0:i])
endfor
give_datp, datp
return, wout
end
\ No newline at end of file
FUNCTION straight_d16, win, center=xy0, norm=norm
;+
;******* ***********
;**
;** User callable
;** The call is w6=straight_d16(w1)
;**
;** win is a 3D diffractogram measured on D16 as a combination of
;** several acquisitions, e.g. w1 = rdopr(1:7)
;-
forward_function straight_1d
;set normalization method
if n_elements(norm) eq 0 then norm = 'monitor'
norm = strlowcase(strtrim(norm,2))
if ((norm eq 't') or (norm eq 'time')) then norm = 'time' else norm = 'monitor'
;get variables associated with win
take_datp, datp
det_dist = datp.p[12] ;sample-detector distance (cm)
xpixel_size = 0.1 ;cm
ypixel_size = 0.1 ;cm
wavelength = datp.p[8] ;angstroms
s = size(win)
size_x = s[1]
size_y = s[2]
if s[0] eq 2 then nscans = 1 else nscans = s[3]
;center (xy_firstpixel = [0.5,0.5], xy_lastpixel = [319.5,319.5], xy_center = [160,160])
if n_elements(xy0) eq 0 then begin
cx = float(s[1]/2)
cy = float(s[2]/2)
endif else begin
cx = float(xy0[0])
cy = float(xy0[1])
endelse
print, 'Straight_d16 using center = ', cx, cy, ' & norm = ', norm
;horizontal and vertical distances to center
dx = xpixel_size * (findgen(size_x)-cx+0.5)
dy = ypixel_size * (findgen(size_y)-cy+0.5)
theta_x = atan(dx/det_dist) * !radeg
;errors (need to be provided correctly, otherwise set to zero)
;if n_elements(datp.e) ne n_elements(win) then datp.e *= 0.0
;!!!!!!!!!!!! NEED TO DECIDE WHAT TO DO WITH ERRORS
;call to straight_1d --> straight_2d
wout = [] & xout = [] & yout = [] & eout = []
for i = 0, nscans-1 do begin
if nscans gt 1 then begin
gamma = datp.pv[0,i]
monitor_counts = datp.pv[38,i]
counting_time = datp.pv[37,i]
endif else begin
gamma = datp.p[0]
monitor_counts = datp.p[38]
counting_time = datp.p[37]
endelse
;normalize to monitor/time
if (norm eq 'time') then begin
wtmp = win[*,*,i] / counting_time
if n_elements(datp.e) eq n_elements(win) then errors = datp.e[*,*,i] / counting_time else errors = wtmp*0.0
endif else begin
wtmp = win[*,*,i] /monitor_counts
if n_elements(datp.e) eq n_elements(win) then errors = datp.e[*,*,i] / monitor_counts else errors = wtmp*0.0
endelse
x_axis = theta_x + gamma ;horizontal angle (degrees)
y_axis = dy ;vertical distance to center (cm)
dattmp ={x:x_axis,y:y_axis, e:errors}
m = straight_1d(wtmp, distance = det_dist, datp = dattmp)
wout = [wout, m]
xout = [xout, dattmp.x]
eout = [eout, dattmp.e]
if i eq 0 then nbins = n_elements(m) else begin
if n_elements(m) ne nbins then begin
print, 'Problem! Scan ', i+1, ' binned to ', n_elements(m), ' x-points vs ', nbins, ' points for previous scans'
print, 'Nothing returned.'
return, 0
endif
endelse
endfor
wout = reform(wout, nbins, nscans)
eout = reform(eout, nbins, nscans)
xout = reform(xout, nbins, nscans)
;Remove first and last points of output because some times have much lower intensity
mod_datp, datp, 'e', eout[1:-2,*]
mod_datp, datp, 'x', xout[1:-2,*]
mod_datp, datp, 'y', 0
give_datp, datp
return, wout[1:-2,*]
end
;COLUMNS: Sample | Bgr_S | Vana | Bgr_V | Cd | T_S | T_BgrS | T_V | T_BgrV | Center | Grouping
;RESULTS: {w16}Sample, {w17}Vana, {w18}SampleNorm, {w20}SampleMerged, {w21}SampleGrouped
;;; PROX_SHEET TO REDUCE A D16 'DIFFRACTION' SCAN:
;;;
;;; The numors composing the scan have to be given in the corresponding cell
;;; using the 'contatenation' format, e.g: '1:7'.
;;; Non consecutive numors can be given as e.g. '1, 5:10', but note
;;; that at least a ':' symbol must appear in the cell, i.e. a command
;;; such as '1, 3, 5, 7, 9' will not work and in order to concatenate
;;; those five numors the command '1:1, 3, 5, 7, 9' must be used.
;;;
;;; The number of scans in each cell (Sample, Bgr_S, Vana, Bgr_V, and Cd) must be
;;; the same and they must correspond to the same 'gamma' acquisitions to be consistent.
;;; This macro will not check this and results will be incorrect if the numors given
;;; for the different scans are not consistent.
;;;
;;; The macro assumes as default that the beam center is at the center of the Miland detector,
;;; i.e. at pixel position 160,160 (note that the position of the lower left pixel is taken as 0.5,0.5
;;; and the position of the upper right pixel is taken as 319.5,319.5). However if a
;;; different center has been previously calculated it can be given using the Center cell.
;;;
;;; The numors will be read using the RDOPR command in Lamp, so if a calibration file is
;;; needed it has to be loaded into Lamp before calling the macro. Use the Calibration files
;;; for instruments in the File menu of Lamp to do this.
;;;
;;; The macro does the following operations:
;;;
;;; 1. Reads a scan as a 3D workspace, e.g. w1[320, 320, N_acquisitions], where N_acquisitions
;;; corresponds to the number of gamma positions measured. If a calibration file has been
;;; previously loaded, each numor is divided by the calibration file.
;;;
;;; 2. Compute the associated error as the square root of the number of counts.
;;;
;;; 3. Integrates over pixels having the same scattering angle using the straight_d16
;;; routine. This function calls the function straight_1d, which was written for D2B.
;;; The geometry of both instruments is not exactly the same, but it works reasonably
;;; well, although in the future it could be refined to take into account more
;;; accurately the exact D16 scan geometry.
;;;
;;; 4. Subtract the background as:
;;;
;;; I_sample = [(Sample-Bgr_S)/(T_S*T_BgrS)] - [(Bgr_S-Cd)/T_BgrS] --> w16
;;;
;;; If a normalization (vanadium) run has been given, its background is subtracted in
;;; a similar way and the corrected intensity stored in w16.
;;;
;;; The needed transmissions must have been calculated previously and be given in
;;; the corresponding T_S, T_BgrS, T_V, and T_BgrV cells.
;;; Any transmission value not given is set to 1 by default.
;;;
;;; 5. Normalize the sample by the normalization (vanadium) run (if the latter is given) --> w18
;;;
;;; 6. Scale the result by multiplying each of the N_acquisitions by a factor computed as the
;;; mean of the intensity of two numors in the overlapping region. The first numor is taken
;;; as reference, so the second numor in the scan will be multiplied by I_1/I_2, the third
;;; by (I_1/I_2)*(I_2/I_3), etc.
;;;
;;; 7. Join and sorth the N_acquisitions composing an scan --> w20
;;;
;;; 8. Reduce the number of points and improve the statistics of each point by averaging
;;; N points together, where N is the value given in the Grouping cell --> w21.
;;;
;;; The macro will go through all the lines and for each line it will save the content of
;;; the following workspaces:
;;;
;;; w16 = Sample intensity (integrated over 2-theta and corrected for background) for each gamma position
;;; w17 = Normalization (vanadium) intensity (integrated and corrected) for each gamma position
;;; w18 = Sample normalized intensity (Sample/Vanadium) for each gamma position
;;; w20 = Sample normalized intensity vs 2-theta (all gamma positions combined)
;;; w21 = Sample normalized intensity vs 2-theta (after grouping)
;Initialize w1-w5 wokspaces
if (cell.Sn eq 1) then begin & w_clear,w=1 & w_clear,w=2 & w_clear,w=3 & w_clear,w=4 & w_clear,w=5 & endif
;Set coordinates for center
if (cell.Center gt '') then a = float(strsplit(cell.Center, ',', /extract))
if (n_elements(a) ne 2) then a = [160.0,160.0]
;Default transmissions = 1
if (cell.T_S gt '') then s = float(cell.T_S)
if (cell.T_BgrS gt '') then t = float(cell.T_BgrS)
if (cell.T_V gt '') then v = float(cell.T_V)
if (cell.T_BgrV gt '') then w = float(cell.T_BgrV)
if n_elements(s) eq 0 then s = 1.0
if n_elements(t) eq 0 then t = 1.0
if n_elements(v) eq 0 then v = 1.0
if n_elements(w) eq 0 then w = 1.0
if ((s lt 0.0) or (s gt 1.0)) then s = 1.0
if ((t lt 0.0) or (t gt 1.0)) then t = 1.0
if ((v lt 0.0) or (v gt 1.0)) then v = 1.0
if ((w lt 0.0) or (w gt 1.0)) then w = 1.0
;print, 'Sample ', cell.Sn, ' center = ', a, ' transm = ', s, t, v, w
;Sample
w1 = rdopr(cell.Sample) & e1 = sqrt(w1) & w11 = straight_d16(w1, center=a)
;Background for sample
if (cell.Bgr_S gt '') then w2 = rdopr(cell.Bgr_S)
if (cell.Bgr_S gt '') then e2 = sqrt(w2)
if (cell.Bgr_S gt '') then w12 = straight_d16(w2, center=a)
;Vanadium
if (cell.Vana gt '') then w3 = rdopr(cell.Vana)
if (cell.Vana gt '') then e3 = sqrt(w3)
if (cell.Vana gt '') then w13 = straight_d16(w3, center=a)
;Background for vanadium
if (cell.Bgr_V gt '') then w4 = rdopr(cell.Bgr_V)
if (cell.Bgr_V gt '') then e4 = sqrt(w4)
if (cell.Bgr_V gt '') then w14 = straight_d16(w4, center=a)
;Cadmium
if (cell.Cd gt '') then w5 = rdopr(cell.Cd)
if (cell.Cd gt '') then e5 = sqrt(w5)
if (cell.Cd gt '') then w15 = straight_d16(w5, center=a)
;Compare dimensions of ancillary measurements with those of sample & set to zero any wks with different dimensions
if n_elements(w12) ne n_elements(w11) then w12 = w11 * 0.0
if n_elements(w13) ne n_elements(w11) then w13 = w11 * 0.0
if n_elements(w14) ne n_elements(w11) then w14 = w11 * 0.0
if n_elements(w15) ne n_elements(w11) then w15 = w11 * 0.0
;Subtract background and Cd (sample)
w16 = ((w11-w15)/(s*t)) - ((w12-w15)/t)
e16 = sqrt( (e11/(s*t))^2 + (e15/(s*t))^2 + (e12/t)^2 + (e15/t)^2 )
;Subtract background and Cd (vanadium, only if contains data)
if total(w13) gt 0.0 then w17 = ((w13-w15)/(v*w)) - ((w14-w15)/w)
if total(w13) gt 0.0 then e17 = sqrt( (e13/(s*t))^2 + (e15/(s*t))^2 + (e14/t)^2 + (e15/t)^2 )
if total(w13) gt 0.0 then x17 = x13
;Normalise by vanadium (only if contains data)
w18 = w16
if total(w17) gt 0.0 then w18 = w16 / w17
if total(w17) gt 0.0 then e18 = sqrt( (e16/w17)^2 + (w16*e17/(w17^2))^2 )
if total(w17) gt 0.0 then x18 = x16
;Scale consecutive scans so that they overlap
w19 = scale_d16(w18)
;Create a single vector and group points
w20 = reform(w19, n_elements(w19))
e20 = reform(e19, n_elements(e19))
x20 = reform(x19, n_elements(x19))
w20 = w20[sort(x20)]
e20 = e20[sort(x20)]
x20 = x20[sort(x20)]
;Number of theta points to group
if (cell.Grouping gt '') then n = fix(cell.Grouping)
if n_elements(n) eq 0 then n = 1
w21 = groupx(w20,n) / float(n) & e21 = e21 / float(n)
\ No newline at end of file
......@@ -75,7 +75,7 @@ h_pixels =(size(datp.y))[1]
glob_low_idx=fltarr(h_pixels) & glob_hi_idx=glob_low_idx
;define output array and initialise it
if (pasp) then give_w,0 ;(clear output workspace so we gain memory)
;if (pasp) then give_w,0 ;(clear output workspace so we gain memory)
Wout = win*0.
Eout = 0
win_s1 =(size(win))[1] -1
......
......@@ -5,7 +5,6 @@
pos_angles = pos_angles, neg_angles = neg_angles, $
all_angles = all_angles, ev, eb, qb, ib, $
verbose = verbose
;
;+
;
; For IN4, IN5, IN6 and D7
......@@ -49,8 +48,8 @@
;-------------------------------------------------------------------------------
common c_lamp_access, inst
common grid, Qmin, Qmax, Emin, Emax
forward_function string_round, overlap
TAKE_DATP, datp
......@@ -160,7 +159,7 @@
y_in = y_in[isort]
w_in = w_in[*,isort]
e_in = e_in[*,isort]
i = WHERE(y_in GT 0.,n)
i = WHERE(y_in GT 0.,n)
IF (ibank EQ 2) THEN BEGIN
twice = 1
iphi1 = 0 & iphi1next = i[0]
......@@ -192,7 +191,7 @@ start:
phi[nphi-1] = y_buf1[iphi2] + (y_buf1[iphi2] - y_buf1[iphi2 - 1])/2.
w_buf = w_buf1[iEarr,iphi1:iphi2]
e_buf = e_buf1[iEarr,iphi1:iphi2]
y_buf = y_buf1[iphi1:iphi2]
y_buf = y_buf1[iphi1:iphi2]
ENDIF ELSE IF (inst EQ 'IN4') AND (NOT no_small) THEN BEGIN
nphi = ny+2
phi = FLTARR(nphi)
......@@ -218,7 +217,7 @@ start:
ENDELSE
COSphi = COS(phi)
; -------------------------------------------------------------------------------------
; reverse array direction for negative angles (for D7 only)
; -------------------------------------------------------------------------------------
......@@ -261,7 +260,7 @@ start:
ip = WHERE(phi LT phimean, np)
iphi0 = ip[np-1]
ENDIF
startrebin:
startrebin:
Areasum = 0.
wsum = 0.
e2sum = 0.
......@@ -287,7 +286,7 @@ startrebin:
e_out[iQ,iEps] = SQRT(e2sum)/areasum
GOTO, binned
ENDIF
outside:
outside:
w_out[iQ,iEps] = 0.
e_out[iQ,iEps] = -1.
GOTO, nextpoint
......@@ -333,16 +332,16 @@ nextpoint:
;-------------------------------------------------------------------------------------
; Add E channels together
;-------------------------------------------------------------------------------------
dEps = Eps[1:nEps-1]-Eps[0:nEps-2]
dEps = Eps[1:nEps-1]-Eps[0:nEps-2]
dEpssum = Eps[nEps-1]-Eps[0]
dEps = REFORM(dEps,1,nEps-1)
x = fltarr(nQ)+1.
dEps = REFORM(dEps,1,nEps-1)
x = fltarr(nQ)+1.
dEps = x#dEps
n_out = 0*w_out+1
i = WHERE(e_out LT 0.)
n_out = 0*w_out+1
i = WHERE(e_out LT 0.)
if i[0] gt 0 then begin
n_out[i] = 0
n_out[i] = 0
e_out[i] = 0.
endif
......
......@@ -85,7 +85,8 @@
; FUNCTION normalise_tof, w_in, inorm, verbose=verbose
; -----------------------------------------------------------------------------------------------
COMMON c_lamp_access, inst
COMMON printing, iprint, outstring
COMMON printing, iprint, outstring
forward_function strfit
iprint = 0
......
......@@ -45,8 +45,8 @@
;**********************************************************************************
common c_lamp_access, inst
common grid, Qmin, Qmax, Emin, Emax
forward_function string_round, overlap
iprint = 0
......@@ -180,7 +180,7 @@ start:
phi[nphi-1] = y_buf1[iphi2] + (y_buf1[iphi2] - y_buf1[iphi2 - 1])/2.
w_buf = w_buf1[*,iphi1:iphi2]
e_buf = e_buf1[*,iphi1:iphi2]
y_buf = y_buf1[iphi1:iphi2]
y_buf = y_buf1[iphi1:iphi2]
ENDIF ELSE IF (inst EQ 'IN4') AND (NOT no_small) THEN BEGIN
nphi = ny+2
phi = FLTARR(nphi)
......@@ -206,7 +206,7 @@ start:
ENDELSE
COSphi = COS(phi)
; reverse array direction for negative angles
; IN5: negative angles doesn't mean as on D7
if inst eq 'D7' then begin
......@@ -229,12 +229,12 @@ start:
a=const2 ; E(meV)=a*Q(A**-1)**2 for neutron
oldymin=0.
Qmin = Qvalue-dQ/2.
Qmin = Qvalue-dQ/2.
Qmax = Qvalue+dQ/2.
Q00 = [Qmin,Qmin,Qmax,Qmax]
; IF keyword_set(verbose) THEN PRINT,Qmin,' < Q <',Qmax
FOR iEps = 0,nEps-2 DO BEGIN
Emin = Eps[iEps]
Emin = Eps[iEps]
Emax = Eps[iEps+1]
corrarea = dQ*(Emax-Emin)
Eps0 = [Emin,Emax,Emax,Emin]
......@@ -242,7 +242,7 @@ start:
IF (MAX(ABS(COSphi0)) GE 1.) THEN $
GOTO, outside
phi0 = ACOS(COSphi0)
phimin = MIN(phi0)
phimin = MIN(phi0)
phimax = MAX(phi0)
IF (phimax LT phi[0] OR phimin GT phi[nphi-1]) THEN $
GOTO, outside
......@@ -253,14 +253,14 @@ start:
ip = WHERE(phi LT phimean, np)
iphi0 = ip[np-1]
ENDIF
startrebin:
startrebin:
Areasum = 0.
wsum = 0.
e2sum = 0.
phiminmeas = 7.
phiminmeas = 7.
phimaxmeas = 0.
FOR iphi = iphi0,(iphi0 + nlines) < (nphi-2) DO BEGIN
COSphi1 = COSphi[iphi]
COSphi1 = COSphi[iphi]
COSphi2 = COSphi[iphi+1]
COSphi0 = [COSphi1,COSphi1,COSphi2,COSphi2]
Q0 = SQRT( (2.*Ei - Eps0 - 2.*SQRT(Ei*(Ei - Eps0))*COSphi0)/a)
......@@ -281,7 +281,7 @@ startrebin:
e_out[iEps]=SQRT(e2sum)/areasum
GOTO, binned
ENDIF
outside:
outside:
w_out[iEps] = 0.
e_out[iEps] = -1.
GOTO, nextpoint
......@@ -297,7 +297,7 @@ nextpoint:
IF twice THEN BEGIN
IF (iphi1 EQ 0) THEN BEGIN
w_out1 = w_out
w_out1 = w_out
e_out1 = e_out
iphi1 = iphi1next
iphi2 = iphi2next
......@@ -305,7 +305,7 @@ nextpoint:
ENDIF ELSE BEGIN
w_out2 = w_out
e_out2 = e_out
w_out[*] = 0.
w_out[*] = 0.
e_out[*] = 0.
not1 = WHERE( e_out1 LE 0.,n1 )
IF (n1 NE 0) THEN e_out1[not1] = 1.
......@@ -354,9 +354,9 @@ nextpoint:
if keyword_set(verbose) then $
PRINT, FORMAT = '("QSTRIP: Rebinned to constant Q-w: Q=",F4.2," +/- ",F4.2," A-1")', Qvalue, dQ/2.
s = STRTRIM(STRING(FLOAT(Qvalue)),2)
s = STRTRIM(STRING(FLOAT(Qvalue)),2)
Qvalue = string_round(s)
s = STRTRIM(STRING(FLOAT(dQ)),2)
s = STRTRIM(STRING(FLOAT(dQ)),2)
dQ = string_round(s)
s =' -qs(Q='+Qvalue+',dQ='+dQ
CASE ibank OF
......
......@@ -33,6 +33,8 @@
; -
;
;------------------------------------------------------------------------------
forward_function str_fit
take_datp, datp
;-------------------------------------------------------------------------------
......@@ -55,7 +57,7 @@
; ---------------------------------------------------------------------------
; If data in ToF , compute the energy data for better
; rescaling application
; ---------------------------------------------------------------------------
; ---------------------------------------------------------------------------
if ~strcmp(datp.x_tit[0], 'Energy Transfer (meV)', 4, /FOLD_CASE) then begin
if keyword_set(verbose) then $
print, 'RESCALE_T: WARNING: data in time channels -> compute energies.'
......@@ -102,7 +104,7 @@
if max( abs(hw) ) gt 1000.0 then $
print, 'RESCALE_T: WARNING: Rescaling might be wrong for large energy values (> +/-1000meV)!'
endif