Commit 073364b0 authored by Gonzalez, Miguel's avatar Gonzalez, Miguel

Urgen correction for error in reading old IN16 data (elastic scan + PSD case)....

Urgen correction for error in reading old IN16 data (elastic scan + PSD case). Will need further checking and adding unit tests, ideally for all instruments
parent 37e9fb5c
......@@ -2630,18 +2630,36 @@ if STATUS eq 0 then begin
PP[28] = param[28]
PTXT[29] = 'Angle increment PSD (deg.)'
PP[29] = param[29]
XT = 'Channels'
YT = '2-Theta'
ZT = 'Vertical pixel'
YY = findgen(n_psdh+n_sdused)
YY[0:n_sdused-1] = SD_angles[sd_used]
psd_start = param[28]
psd_step = param[29]
psd_angles = findgen(n_psdh)*psd_step + psd_start
YY[n_sdused:*] = psd_angles
ZZ = indgen(n_psdv) + 1
PP[0] = 30 ; NOMAD qens scan with PSD
ENDELSE
IF pp[2] gt 0.0 THEN BEGIN ; If doppler on --> 3D output
XT = 'Channels'
YT = '2-Theta'
ZT = 'Vertical pixel'
YY = findgen(n_psdh+n_sdused)
YY[0:n_sdused-1] = SD_angles[sd_used]
psd_start = param[28]
psd_step = param[29]
psd_angles = findgen(n_psdh)*psd_step + psd_start
YY[n_sdused:*] = psd_angles
ZZ = indgen(n_psdv) + 1
PP[0] = 30 ; NOMAD qens scan with PSD
ENDIF ELSE BEGIN ; If doppler speed = 0 --> elastic scan (2D output)
WOU = total(wou,1) ; integrate over channels
EE = sqrt(wou)
XT = '2-Theta'
YT = 'Vertical pixel'
XX = findgen(n_psdh+n_sdused)
XX[0:n_sdused-1] = SD_angles[sd_used]
psd_start = param[28]
psd_step = param[29]
psd_angles = findgen(n_psdh)*psd_step + psd_start
XX[n_sdused:*] = psd_angles
YY = indgen(n_psdv) + 1
NN = total(NNel[*,0],1) ; use only first monitor
PP[0] = 31 ; NOMAD elastic scan with PSD
ENDELSE
ENDELSE
IF (INST[2] eq '0') THEN BEGIN ; Case NORAW
......@@ -2665,10 +2683,28 @@ if STATUS eq 0 then begin
endif
endif else begin ;If PSD integrate over tubes
WOT = WOU
WOU = lonarr(nb_chn,n_psdh+n_sdused)
WOU[*,0:n_sdused-1] = WOT[*,0:n_sdused-1,0] ;SD counts
WOU[*,n_sdused:*] = total(WOT[*,n_sdused:*,lowlim:uplim],3) ;Integrate central region of PSD
EE = sqrt(WOU)
IF pp[2] gt 0.0 THEN BEGIN ;QENS scan
WOU = lonarr(nb_chn,n_psdh+n_sdused)
WOU[*,0:n_sdused-1] = WOT[*,0:n_sdused-1,0] ;SD counts
WOU[*,n_sdused:*] = total(WOT[*,n_sdused:*,lowlim:uplim],3) ;Integrate central region of PSD
EE = sqrt(WOU)
PP[0] = 40 ; NOMAD qens scan with PSD and integrated over tubes
ENDIF ELSE BEGIN ;Elastic scan
WOU = lonarr(n_psdh+n_sdused)
WOU[0:n_sdused-1] = WOT[0:n_sdused-1,0] ;SD counts
WOU[n_sdused:*] = total(WOT[n_sdused:*,lowlim:uplim],2) ;Integrate central region of PSD
;YT = 'Temperature'
;YY = par1[9]
YT = 'Numor'
YY = numor
EE = sqrt(WOU)
WOU= float(WOU)/(NN>1)
EE = EE/(NN>1)
NN = 1
;if n_elements(NN) eq 1 then NN = [NN, 0]
;if n_elements(NN) eq 2 then NN = reform(NN, 1, 2)
PP[0] = 41 ; NOMAD qens scan with PSD and integrated over tubes
ENDELSE
endelse
if zupe.unmirror eq 1 then begin; both sides summed
......@@ -2720,7 +2756,7 @@ if STATUS eq 0 then begin
ENDIF ;end NoRaw
EE = sqrt(WOU)
;EE = sqrt(WOU)
IF (Helas) THEN BEGIN ;par1(13)=1
OT = OT + " (Diff. on)"
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment