Commit 363d9ab8 authored by Gonzalez, Miguel's avatar Gonzalez, Miguel
Browse files

Issue 33: Added Salsa tests, including first files produced in 2004. rdid...

Issue 33: Added Salsa tests, including first files produced in 2004. rdid modified to handle the older Salsa files
parent ed89a46e
......@@ -1996,13 +1996,7 @@ if STATUS eq 0 then begin
'salsa': begin
;Modified on May 2019 - Tested on 2018 data, but not on older data (M. A. Gonzalez)
;Old data
if year lt 2014 then begin
lamp_journal, "Old data files! Check carefully if reading is OK."
lamp_message, "Old data files! Check carefully if reading is OK."
endif
;Modified on May-Aug 2019 and tested on 2004-2019 data (lamp_reading_unit_test)
;The current code has been written for version 5 of Salsa Ascii files
;In previous versions (at least in v. 4), the information about the
;type of scan was encoded in the variables manip and nbang, but since
......@@ -2012,9 +2006,7 @@ if STATUS eq 0 then begin
;uses the information available from the title, as the type of scan
;is written at the end. There are chances that this works also for
;previous versions, but this has not been tested.
;References in the previous code to manip and nbang have been removed,
;until the reading of data before 2014 is re-validated again.
;If needed, the old rdid code can be retrived from the Git repository.
;References in the previous code to manip and nbang have been removed.
WOUT = float(WOUT)
bix=0
......@@ -2031,7 +2023,6 @@ if STATUS eq 0 then begin
if scan gt 1 then WOUT = transpose(temporary(WOUT), [1,0,2]) $
else WOUT = transpose(temporary(WOUT))
endelse
;WOUT=reverse(WOUT) ; First detector till run 394
if (n_elements(cal_d1a) eq 0) or (n_elements(cal_d1a) eq 25) then $
P_DID_CALOD, insv, insv + '.cal', flg
......@@ -2094,7 +2085,7 @@ if STATUS eq 0 then begin
;determine type of scan
tmp = strsplit(exper[0], /extract)
scantype = tmp[-1]
case scantype of
'2theta': begin
......@@ -2112,12 +2103,14 @@ if STATUS eq 0 then begin
end
'chi': begin
ZZ = reform(vparm[20,*]/1000.)
if year ge 2014 then ZZ = reform(vparm[20,*]/1000.) $
else ZZ = reform(vparm[3,*]/1000.)
ZT = 'phi scan'
end
'phi': begin
ZZ = reform(vparm[21,*]/1000.)
if year ge 2014 then ZZ = reform(vparm[21,*]/1000.) $
else ZZ = reform(vparm[3,*]/1000.)
ZT = 'phi scan'
end
......@@ -2153,7 +2146,8 @@ if STATUS eq 0 then begin
end
else: begin
ZZ = reform(vparm[12,*]/1000.)
if year gt 2014 then ZZ = reform(vparm[12,*]/1000.) $
else ZZ = reform(vparm[3,*]/1000.)
ZT = 'Unknown scan'
end
......@@ -2161,31 +2155,45 @@ if STATUS eq 0 then begin
endif else begin ;single acquisition
NN[0,0,0] = param[43] ;value of monitor1 in common block in header
if year lt 2014 then NN[0,0,0] = vpara[1] ;value of monitor in 2nd parameter block (11 values)
endelse
if n_elements(cal_d1a) eq 256.*256. then $
for i=0,scan-1 do WOUT[0,0,i] = WOUT[*,*,i]*cal_d1a
;Raw button not set --> To check if those options are still valid (MG, 14/5/2019)
;Raw button not set
if (INST[2] eq '0') then begin
WOUT = WOUT[17:238,1:254,*] & sz=size(WOUT) ;Bad areas
XX = XX[17:238,*] & YY = YY[1:254] ;Bad areas
datp = {x:XX[*,0], y:YY, e:0, z:ZZ}
; Select good detector region
WOUT = WOUT[17:238, 1:254, *]
XX = XX[17:238,*]
YY = YY[1:254]
if typename(ZZ) eq 'STRING' then begin
; Replace hexapod strings by number of scan point, to allow call to regular
; Info about hexapod position (Tx, Ty, Tz) will be kept in Z
Z2 = fix(indgen(n_elements(ZZ)) + 1)
endif else Z2 = ZZ
datp = {x:XX[*,0], y:YY, e:0, z:Z2}
sz=size(WOUT)
temp = regular(WOUT[*,*,0], datp=datp, DY=0, /GetNewSize)
sz[1:2] = temp[0:1]
if YEAR lt '2014' then DistCm = 89. else DistCm = 125.
if (size(XX))[0] eq 1 then begin ;not a gamma scan
WTMP = straight_1d(WOUT, distance=DistCm, datp=datp)
XTMP = datp.x
endif else begin ;gamma scan
WTMP = reform(fltarr(sz[1], scan))
XTMP = WTMP
for i=0,scan-1 do begin
datp = {x:XX[*,i<bix], y:YY, e:0, z:ZZ}
for i=0, scan-1 do begin
datp = {x:XX[*,i<bix], y:YY, e:0, z:Z2}
WTMP[*,i] = straight_1d(WOUT[*,*,i], distance=DistCm, datp=datp)
XTMP[*,i] = datp.x
endfor
endelse
endelse
XX = temporary(XTMP)
EE = 0.
if scan gt 1 then if (size(XX))[0] eq 1 then begin
......@@ -2193,7 +2201,7 @@ if STATUS eq 0 then begin
XX = fltarr((size(XX))[1], scan)
for i=0,scan-1 do XX[*,i] = tmp
endif
YY = ZZ
YY = Z2
YT = ZT
ZT = 'join_y'
WOUT = temporary(WTMP)
......
......@@ -78,6 +78,906 @@ if err gt tol then return, 1 else return, 0
end
function unittest_check_string, array, expected_string
;+
;** ******************************************
;** Check if axis labels are equal
;-
correct = 1
for i = 0, n_elements(array)-1 do begin
if array[i] ne expected_string[i] then correct = 0
endfor
if not correct then return, 1 else return, 0
end
pro unittest_reading_in16, P_to_DATA, fails_count, failed_tests, user_directory, u
;+
;** ******************************************
;** Tests for IN16
;-
@lamp.cbk
rdset, inst='IN16'
TEST_directory = P_to_DATA + 'data_in16' + lamp_dvd
cd, TEST_directory
;Theta-D1 scan (15 Feb 2000)
message, /reset
st = 'IN16: ThetaD1 scan (Feb 2000)'
rdset, /raw
W = RDOPR('14029', W=60)
utest = []
if !error_state.msg gt '' then unittest_error_reading, !error_state.msg, st, fails_count, failed_tests, user_directory, test_directory, u else begin
utest = [utest, unittest_check_dimensions(W60, [2, 21, 22, 4, 462])]
utest = [utest, unittest_check_axis([X60[0], X60[-1]], [75.04, 79.95])]
utest = [utest, unittest_check_axis([Y60[0], Y60[-1]], [10.86, 148.50])]
utest = [utest, unittest_check_axis([N60[11], N60[16]], [58, 5])]
utest = [utest, unittest_check_axis([P60[0], P60[14]], [10.0, 1.0])]
utest = [utest, unittest_check_total(W60, 1074.0)]
utest = [utest, unittest_check_total(E60, 423.90131)]
idx = where(utest gt 0, nfails)
if nfails gt 0 then unittest_failed_test, idx, st, fails_count, failed_tests, user_directory, test_directory, u
endelse
message, /reset
st = 'IN16: ThetaD1 scan (Feb 2000, no raw)'
rdset, /noraw, unmirror=0, fws=0
W = RDOPR('14029', W=60)
utest = []
if !error_state.msg gt '' then unittest_error_reading, !error_state.msg, st, fails_count, failed_tests, user_directory, test_directory, u else begin
utest = [utest, unittest_check_dimensions(W60, [2, 21, 22, 4, 462])]
utest = [utest, unittest_check_axis([X60[0], X60[-1]], [75.04, 79.95])]
utest = [utest, unittest_check_axis([Y60[0], Y60[-1]], [10.86, 148.50])]
utest = [utest, unittest_check_axis([N60[11], N60[16]], [8, 8])]
utest = [utest, unittest_check_axis([P60[0], P60[14]], [10.0, 1.0])]
utest = [utest, unittest_check_total(W60, 386.58856)]
utest = [utest, unittest_check_total(E60, 246.43626)]
idx = where(utest gt 0, nfails)
if nfails gt 0 then unittest_failed_test, idx, st, fails_count, failed_tests, user_directory, test_directory, u
endelse
;Theta-D2 scan (15 Feb 2000)
message, /reset
st = 'IN16: ThetaD2 scan (Feb 2000)'
rdset, /raw
W = RDOPR('14034', W=60)
utest = []
if !error_state.msg gt '' then unittest_error_reading, !error_state.msg, st, fails_count, failed_tests, user_directory, test_directory, u else begin
utest = [utest, unittest_check_dimensions(W60, [2, 21, 22, 4, 462])]
utest = [utest, unittest_check_axis([X60[0], X60[-1]], [109.00, 113.00])]
utest = [utest, unittest_check_axis([Y60[0], Y60[-1]], [10.86, 148.50])]
utest = [utest, unittest_check_axis([N60[11], N60[16]], [76, 71])]
utest = [utest, unittest_check_axis([P60[0], P60[14]], [12.0, 1.0])]
utest = [utest, unittest_check_total(W60, 4013.0000)]
utest = [utest, unittest_check_total(E60, 1169.7231)]
idx = where(utest gt 0, nfails)
if nfails gt 0 then unittest_failed_test, idx, st, fails_count, failed_tests, user_directory, test_directory, u
endelse
message, /reset
st = 'IN16: ThetaD2 scan (Feb 2000, no raw)'
rdset, /noraw, unmirror=0, fws=0
W = RDOPR('14034', W=60)
utest = []
if !error_state.msg gt '' then unittest_error_reading, !error_state.msg, st, fails_count, failed_tests, user_directory, test_directory, u else begin
utest = [utest, unittest_check_dimensions(W60, [2, 21, 22, 4, 462])]
utest = [utest, unittest_check_axis([X60[0], X60[-1]], [109.00, 113.00])]
utest = [utest, unittest_check_axis([Y60[0], Y60[-1]], [10.86, 148.50])]
utest = [utest, unittest_check_axis([N60[11], N60[16]], [42, 42])]
utest = [utest, unittest_check_axis([P60[0], P60[14]], [12.0, 1.0])]
utest = [utest, unittest_check_total(W60, 4761.6641)]
utest = [utest, unittest_check_total(E60, 1454.7106)]
idx = where(utest gt 0, nfails)
if nfails gt 0 then unittest_failed_test, idx, st, fails_count, failed_tests, user_directory, test_directory, u
endelse
;Temperature scan (17 Feb 2000)
message, /reset
st = 'IN16: Temp scan (Feb 2000)'
rdset, /raw
W = RDOPR('14047', W=60)
utest = []
if !error_state.msg gt '' then unittest_error_reading, !error_state.msg, st, fails_count, failed_tests, user_directory, test_directory, u else begin
utest = [utest, unittest_check_dimensions(W60, [2, 91, 22, 4, 2002])]
utest = [utest, unittest_check_axis([X60[0], X60[-1]], [1.645, 60.042])]
utest = [utest, unittest_check_axis([Y60[0], Y60[-1]], [10.86, 148.50])]
utest = [utest, unittest_check_axis([N60[0], N60[-1]], [136777, 137534])]
utest = [utest, unittest_check_axis([P60[0], P60[10], P60[14]], [1.0, 24.29, 1.0])]
utest = [utest, unittest_check_total(W60, 44767972.)]
utest = [utest, unittest_check_total(E60, 295248.03)]
idx = where(utest gt 0, nfails)
if nfails gt 0 then unittest_failed_test, idx, st, fails_count, failed_tests, user_directory, test_directory, u
endelse
message, /reset
st = 'IN16: Temp scan (Feb 2000, no raw)'
rdset, /noraw, unmirror=0, fws=0
W = RDOPR('14047', W=60)
utest = []
if !error_state.msg gt '' then unittest_error_reading, !error_state.msg, st, fails_count, failed_tests, user_directory, test_directory, u else begin
utest = [utest, unittest_check_dimensions(W60, [2, 91, 22, 4, 2002])]
utest = [utest, unittest_check_axis([X60[0], X60[-1]], [1.645, 60.042])]
utest = [utest, unittest_check_axis([Y60[0], Y60[-1]], [10.86, 148.50])]
utest = [utest, unittest_check_axis([N60[0], N60[-1]], [136651, 136651])]
utest = [utest, unittest_check_axis([P60[0], P60[10], P60[14]], [1.0, 24.29, 1.0])]
utest = [utest, unittest_check_total(W60, 44820812.)]
utest = [utest, unittest_check_total(E60, 295631.47)]
idx = where(utest gt 0, nfails)
if nfails gt 0 then unittest_failed_test, idx, st, fails_count, failed_tests, user_directory, test_directory, u
endelse
;QENS scan (17 Feb 2000)
message, /reset
st = 'IN16: QENS scan (Feb 2000)'
rdset, /raw
W = RDOPR('14048>14050', W=60)
utest = []
if !error_state.msg gt '' then unittest_error_reading, !error_state.msg, st, fails_count, failed_tests, user_directory, test_directory, u else begin
utest = [utest, unittest_check_dimensions(W60, [2, 256, 22, 4, 5632])]
utest = [utest, unittest_check_axis([X60[0], X60[-1]], [1, 256])]
utest = [utest, unittest_check_axis([Y60[0], Y60[-1]], [10.86, 148.50])]
utest = [utest, unittest_check_axis([N60[0], N60[128], N60[-1]], [258., 46519., 3.])]
utest = [utest, unittest_check_axis([P60[0], P60[10], P60[14]], [0.0, 24.29, 1.0])]
utest = [utest, unittest_check_total(W60, 1565852.0)]
utest = [utest, unittest_check_total(E60, 43488.328)]
idx = where(utest gt 0, nfails)
if nfails gt 0 then unittest_failed_test, idx, st, fails_count, failed_tests, user_directory, test_directory, u
endelse
message, /reset
st = 'IN16: QENS scan (Feb 2000, no raw)'
rdset, /noraw, unmirror=0, fws=0
W = RDOPR('14048>14050', W=60)
utest = []
if !error_state.msg gt '' then unittest_error_reading, !error_state.msg, st, fails_count, failed_tests, user_directory, test_directory, u else begin
utest = [utest, unittest_check_dimensions(W60, [2, 256, 22, 4, 5632])]
utest = [utest, unittest_check_axis([X60[0], X60[-1]], [1, 256])]
utest = [utest, unittest_check_axis([Y60[0], Y60[-1]], [10.86, 148.50])]
utest = [utest, unittest_check_axis([N60[0], N60[128], N60[-1]], [55848.000, 55848.000, 55848.000])]
utest = [utest, unittest_check_axis([P60[0], P60[10], P60[14]], [0.0, 24.29, 1.0])]
utest = [utest, unittest_check_total(W60, 1878683.4)]
utest = [utest, unittest_check_total(E60, 47355.332)]
idx = where(utest gt 0, nfails)
if nfails gt 0 then unittest_failed_test, idx, st, fails_count, failed_tests, user_directory, test_directory, u
endelse
message, /reset
st = 'IN16: QENS scan (Feb 2000, diffraction detector)'
rdset, /raw, /dif
W = RDOPR('14048>14050', W=60)
rdset, dif=0
utest = []
if !error_state.msg gt '' then unittest_error_reading, !error_state.msg, st, fails_count, failed_tests, user_directory, test_directory, u else begin
utest = [utest, unittest_check_dimensions(W60, [1, 160, 4, 160])]
utest = [utest, unittest_check_axis([X60[0], X60[-1]], [-13.04, 149.25])]
utest = [utest, unittest_check_axis([N60[0], N60[128], N60[-1]], [258., 46519., 3.])]
utest = [utest, unittest_check_axis([P60[0], P60[10], P60[14]], [0.0, 24.29, 1.0])]
utest = [utest, unittest_check_total(W60, 25694882.)]
utest = [utest, unittest_check_total(E60, 62510.813)]
idx = where(utest gt 0, nfails)
if nfails gt 0 then unittest_failed_test, idx, st, fails_count, failed_tests, user_directory, test_directory, u
endelse
;QENS scan (21 Mar 2004)
message, /reset
st = 'IN16: QENS scan (Mar 2004)'
rdset, /raw
W = RDOPR('10011>10020', W=60)
utest = []
if !error_state.msg gt '' then unittest_error_reading, !error_state.msg, st, fails_count, failed_tests, user_directory, test_directory, u else begin
utest = [utest, unittest_check_dimensions(W60, [2, 256, 22, 4, 5632])]
utest = [utest, unittest_check_axis([X60[0], X60[-1]], [1, 256])]
utest = [utest, unittest_check_axis([Y60[0], Y60[2], Y60[-1]], [10.96, 25.0, 148.50])]
utest = [utest, unittest_check_axis([N60[0], N60[128], N60[-1]], [2784., 188640., 2082.])]
utest = [utest, unittest_check_axis([P60[0], P60[10], P60[14]], [0.0, 24.29, 1.0])]
utest = [utest, unittest_check_total(W60, 607243.00)]
utest = [utest, unittest_check_total(E60, 27176.396)]
idx = where(utest gt 0, nfails)
if nfails gt 0 then unittest_failed_test, idx, st, fails_count, failed_tests, user_directory, test_directory, u
endelse
message, /reset
st = 'IN16: QENS scan (Mar 2004, diffraction detector)'
rdset, /raw, /dif
W = RDOPR('10011>10020', W=60)
rdset, dif=0
utest = []
if !error_state.msg gt '' then unittest_error_reading, !error_state.msg, st, fails_count, failed_tests, user_directory, test_directory, u else begin
utest = [utest, unittest_check_dimensions(W60, [1, 160, 4, 160])]
utest = [utest, unittest_check_axis([X60[0], X60[-1]], [-13.04, 149.25])]
utest = [utest, unittest_check_axis([N60[0], N60[128], N60[-1]], [2784., 188640., 2082.])]
utest = [utest, unittest_check_axis([P60[0], P60[10], P60[14]], [0.0, 24.29, 1.0])]
utest = [utest, unittest_check_total(W60, 11508689.)]
utest = [utest, unittest_check_total(E60, 42118.301)]
idx = where(utest gt 0, nfails)
if nfails gt 0 then unittest_failed_test, idx, st, fails_count, failed_tests, user_directory, test_directory, u
endelse
message, /reset
st = 'IN16: QENS scan (Mar 2004, diffraction detector)'
rdset, /noraw, /dif
W = RDOPR('10011>10020', W=60)
rdset, dif=0
utest = []
if !error_state.msg gt '' then unittest_error_reading, !error_state.msg, st, fails_count, failed_tests, user_directory, test_directory, u else begin
utest = [utest, unittest_check_dimensions(W60, [1, 160, 4, 160])]
utest = [utest, unittest_check_axis([X60[0], X60[-1]], [-13.04, 149.25])]
utest = [utest, unittest_check_axis([N60[0], N60[128], N60[-1]], [222728., 222728., 222728.])]
utest = [utest, unittest_check_axis([P60[0], P60[10], P60[14]], [0.0, 24.29, 1.0])]
utest = [utest, unittest_check_total(W60, 11508689.)]
utest = [utest, unittest_check_total(E60, 42118.301)]
idx = where(utest gt 0, nfails)
if nfails gt 0 then unittest_failed_test, idx, st, fails_count, failed_tests, user_directory, test_directory, u
endelse
;QENS scan (19 Mar 2005)
message, /reset
st = 'IN16: QENS scan (Mar 2005)'
rdset, /raw
W = RDOPR('13000>13002', W=60)
utest = []
if !error_state.msg gt '' then unittest_error_reading, !error_state.msg, st, fails_count, failed_tests, user_directory, test_directory, u else begin
utest = [utest, unittest_check_dimensions(W60, [2, 256, 22, 4, 5632])]
utest = [utest, unittest_check_axis([X60[0], X60[-1]], [1, 256])]
utest = [utest, unittest_check_axis([Y60[0], Y60[2], Y60[-1]], [10.96, 25.00, 148.50])]
utest = [utest, unittest_check_axis([N60[0], N60[128], N60[-1]], [539., 35810., 454.])]
utest = [utest, unittest_check_axis([P60[0], P60[10], P60[14]], [0.0, 24.29, 1.0])]
utest = [utest, unittest_check_total(W60, 67262.000)]
utest = [utest, unittest_check_total(E60, 8927.3652)]
idx = where(utest gt 0, nfails)
if nfails gt 0 then unittest_failed_test, idx, st, fails_count, failed_tests, user_directory, test_directory, u
endelse
;Temperature scan (25 Mar 2005)
message, /reset
st = 'IN16: Temp scan (Mar 2005)'
rdset, /raw
W = RDOPR('13124', W=60)
utest = []
if !error_state.msg gt '' then unittest_error_reading, !error_state.msg, st, fails_count, failed_tests, user_directory, test_directory, u else begin
utest = [utest, unittest_check_dimensions(W60, [2, 14, 22, 4, 308])]
utest = [utest, unittest_check_axis([X60[0], X60[-1]], [276.914, 284.382])]
utest = [utest, unittest_check_axis([Y60[0], Y60[2], Y60[-1]], [10.96, 25.00, 148.50])]
utest = [utest, unittest_check_axis([N60[0], N60[7], N60[-1]], [334695, 335377, 333818])]
utest = [utest, unittest_check_axis([P60[0], P60[10], P60[14]], [1.0, 24.29, 1.0])]
utest = [utest, unittest_check_total(W60, 356990.00)]
utest = [utest, unittest_check_total(E60, 10267.870)]
idx = where(utest gt 0, nfails)
if nfails gt 0 then unittest_failed_test, idx, st, fails_count, failed_tests, user_directory, test_directory, u
endelse
;Temperature scan (23 Jul 2005)
message, /reset
st = 'IN16: Temp scan (Jul 2005)'
rdset, /raw
W = RDOPR('15236', W=60)
utest = []
if !error_state.msg gt '' then unittest_error_reading, !error_state.msg, st, fails_count, failed_tests, user_directory, test_directory, u else begin
utest = [utest, unittest_check_dimensions(W60, [2, 346, 22, 4, 7612])]
utest = [utest, unittest_check_axis([X60[0], X60[-1]], [20.742, 314.568])]
utest = [utest, unittest_check_axis([Y60[0], Y60[2], Y60[-1]], [10.96, 25.00, 148.50])]
utest = [utest, unittest_check_axis([N60[0], N60[200], N60[-1]], [589266, 586009, 586423])]
utest = [utest, unittest_check_axis([P60[0], P60[10], P60[14]], [1.0, 24.29, 1.0])]
utest = [utest, unittest_check_total(W60, 73606360.)]
utest = [utest, unittest_check_total(E60, 729860.94)]
idx = where(utest gt 0, nfails)
if nfails gt 0 then unittest_failed_test, idx, st, fails_count, failed_tests, user_directory, test_directory, u
endelse
;Temperature scan (24 Jul 2006, one of first scans using Nomad)
message, /reset
st = 'IN16: Temp scan (Jul 2006, Nomad)'
rdset, /raw
W = RDOPR('16000:16029', W=60)
utest = []
if !error_state.msg gt '' then unittest_error_reading, !error_state.msg, st, fails_count, failed_tests, user_directory, test_directory, u else begin
utest = [utest, unittest_check_dimensions(W60, [2, 22, 30, 4, 660])]
utest = [utest, unittest_check_axis([X60[0], X60[2], X60[-1]], [10.96, 25.00, 148.50])]
utest = [utest, unittest_check_axis([Y60[0], Y60[2], Y60[-1]], [16000, 16002, 16029])]
utest = [utest, unittest_check_axis([N60[0], N60[20], N60[-1]], [398886., 279711., 281990.])]
utest = [utest, unittest_check_axis([P60[0], P60[2], P60[14]], [21.0, 0.0, 256.])]
utest = [utest, unittest_check_axis([PV60[9,0], PV60[9,20], PV60[9,-1]], [15.379, 169.299, 198.345])]
utest = [utest, unittest_check_total(W60, 1808938.0)]
utest = [utest, unittest_check_total(E60, 33500.199)]
idx = where(utest gt 0, nfails)
if nfails gt 0 then unittest_failed_test, idx, st, fails_count, failed_tests, user_directory, test_directory, u
endelse
message, /reset
st = 'IN16: Temp scan (Jul 2006, Nomad, no raw)'
rdset, /noraw, unmirror=0, fws=0
W = RDOPR('16000:16029', W=60)
utest = []
if !error_state.msg gt '' then unittest_error_reading, !error_state.msg, st, fails_count, failed_tests, user_directory, test_directory, u else begin
utest = [utest, unittest_check_dimensions(W60, [2, 22, 30, 4, 660])]
utest = [utest, unittest_check_axis([X60[0], X60[2], X60[-1]], [10.96, 25.00, 148.50])]
utest = [utest, unittest_check_axis([Y60[0], Y60[2], Y60[-1]], [16000, 16002, 16029])]
utest = [utest, unittest_check_axis([N60[0]], [302080.])]
utest = [utest, unittest_check_axis([P60[0], P60[2], P60[14]], [21.0, 0.0, 256.])]
utest = [utest, unittest_check_axis([PV60[9,0], PV60[9,20], PV60[9,-1]], [15.379, 169.299, 198.345])]
utest = [utest, unittest_check_total(W60, 1783215.4)]
utest = [utest, unittest_check_total(E60, 33416.270)]
idx = where(utest gt 0, nfails)
if nfails gt 0 then unittest_failed_test, idx, st, fails_count, failed_tests, user_directory, test_directory, u
endelse
message, /reset
st = 'IN16: TEMP scan (Jul 2006, Nomad, diffraction detector)'
rdset, /raw, /dif
W = RDOPR('16000:16029', W=60)
rdset, dif=0
utest = []
if !error_state.msg gt '' then unittest_error_reading, !error_state.msg, st, fails_count, failed_tests, user_directory, test_directory, u else begin
utest = [utest, unittest_check_dimensions(W60, [2, 160, 30, 3, 4800])]
utest = [utest, unittest_check_axis([X60[0], X60[2], X60[-1]], [-13.04, -11.22, 149.25])]
utest = [utest, unittest_check_axis([Y60[0], Y60[2], Y60[-1]], [16000, 16002, 16029])]
utest = [utest, unittest_check_axis([N60[0], N60[20], N60[-1]], [398886., 279711., 281990.])]
utest = [utest, unittest_check_axis([P60[0], P60[2], P60[14]], [21.0, 0.0, 256.0])]
utest = [utest, unittest_check_total(W60, 837014.00)]
utest = [utest, unittest_check_total(E60, 62429.586)]
idx = where(utest gt 0, nfails)
if nfails gt 0 then unittest_failed_test, idx, st, fails_count, failed_tests, user_directory, test_directory, u
endelse
;QENS scan (25 Jul 2006, using Nomad)
message, /reset
st = 'IN16: QENS scan (Jul 2006, Nomad)'
rdset, /raw
W = RDOPR('16206>16210', W=60)
utest = []
if !error_state.msg gt '' then unittest_error_reading, !error_state.msg, st, fails_count, failed_tests, user_directory, test_directory, u else begin
utest = [utest, unittest_check_dimensions(W60, [2, 256, 22, 4, 5632])]
utest = [utest, unittest_check_axis([X60[0], X60[2], X60[-1]], [1, 3, 256])]
utest = [utest, unittest_check_axis([Y60[0], Y60[2], Y60[-1]], [10.96, 25.00, 148.50])]
utest = [utest, unittest_check_axis([N60[0,0], N60[128,0], N60[-1,0]], [1393., 89920., 1097.])]
utest = [utest, unittest_check_axis([N60[0,1], N60[128,1], N60[-1,1]], [5., 5., 5.])]
utest = [utest, unittest_check_axis([P60[0], P60[2], P60[14]], [0.0, 14.020133, 256.0])]
utest = [utest, unittest_check_total(W60, 121024.00)]
utest = [utest, unittest_check_total(E60, 20787.855)]
idx = where(utest gt 0, nfails)
if nfails gt 0 then unittest_failed_test, idx, st, fails_count, failed_tests, user_directory, test_directory, u
endelse
message, /reset
st = 'IN16: QENS scan (Jul 2006, Nomad, no raw)'
rdset, /noraw, unmirror=0, fws=0
W = RDOPR('16206>16210', W=60)
utest = []
if !error_state.msg gt '' then unittest_error_reading, !error_state.msg, st, fails_count, failed_tests, user_directory, test_directory, u else begin
utest = [utest, unittest_check_dimensions(W60, [2, 256, 22, 4, 5632])]
utest = [utest, unittest_check_axis([X60[0], X60[2], X60[-1]], [1, 3, 256])]
utest = [utest, unittest_check_axis([Y60[0], Y60[2], Y60[-1]], [10.96, 25.00, 148.50])]
utest = [utest, unittest_check_axis([N60[0,0], N60[128,0], N60[-1,0]], [106103., 106103., 106103.])]
utest = [utest, unittest_check_axis([N60[0,1], N60[128,1], N60[-1,1]], [5., 5., 5.])]
utest = [utest, unittest_check_axis([P60[0], P60[2], P60[14]], [0.0, 14.020133, 256.0])]
utest = [utest, unittest_check_total(W60, 132633.91)]
utest = [utest, unittest_check_total(E60, 20879.000)]
idx = where(utest gt 0, nfails)
if nfails gt 0 then unittest_failed_test, idx, st, fails_count, failed_tests, user_directory, test_directory, u
endelse
;QENS scan (9 Nov 2010, with PSD)
message, /reset
st = 'IN16: QENS scan (Nov 2010, with PSD)'
rdset, /raw
W = RDOPR('93000', W=60)
utest = []
if !error_state.msg gt '' then unittest_error_reading, !error_state.msg, st, fails_count, failed_tests, user_directory, test_directory, u else begin
utest = [utest, unittest_check_dimensions(W60, [3, 256, 18, 128, 4, 589824])]
utest = [utest, unittest_check_axis([X60[0], X60[2], X60[-1]], [1, 3, 256])]
utest = [utest, unittest_check_axis([Y60[0], Y60[2], Y60[-1]], [10.94, 25.65, 142.65])]
utest = [utest, unittest_check_axis([N60[0], N60[128], N60[-1]], [387., 4376., 1.])]
utest = [utest, unittest_check_axis([P60[0], P60[2], P60[14]], [30.0, 4.6685452, 1.0])]
utest = [utest, unittest_check_total(W60, 13997.000)]
utest = [utest, unittest_check_total(E60, 9309.3916)]
idx = where(utest gt 0, nfails)
if nfails gt 0 then unittest_failed_test, idx, st, fails_count, failed_tests, user_directory, test_directory, u
endelse
message, /reset