Commit 5a54212e authored by Miguel Angel Gonzalez's avatar Miguel Angel Gonzalez
Browse files

Small modifications from Thomas Saerbeck

parent 536bd012
......@@ -3967,11 +3967,9 @@ pro cosmos_raw_read, files, monitors, counts, params, path, override, reflect=re
4: c_params.pcen = 132.5
5: c_params.pcen = 132.5 ;TS 2021-02-25 corrected the value
else: begin
cosmos_logmessage, 'c_params.data_format = ' + string(c_params.data_format) + ' not handled!', /WARNING
cosmos_logmessage, 'Using c_params.pcen = 132.5', /WARNING ;TS 2021-02-25 corrected the value
c_params.pcen = 132.5 ;TS 2021-02-25 corrected the value
end
endcase
;TS 2021-05-12 Changed the following block since the data_format warning was always sent.
c_params.pcen = 132.5 ;TS 2021-05-12 Default value ascii version >= 5
if c_params.data_format ge 5 then begin
;Pcen which is now written in datafile ;TS 2021-02-25
tmp = par1[105]
if (tmp gt 0.0) then begin
......@@ -3980,6 +3978,14 @@ pro cosmos_raw_read, files, monitors, counts, params, path, override, reflect=re
cosmos_logmessage, 'No valid value for Pcen in numor ' + file_name, /WARNING
cosmos_logmessage, 'Using default value = ' + cosmos_str_make(c_params.pcen), /WARNING
endelse
endif else begin
cosmos_logmessage, 'c_params.data_format = ' + string(c_params.data_format) + ' not handled!', /WARNING
cosmos_logmessage, 'Using c_params.pcen = 132.5', /WARNING ;TS 2021-02-25 corrected the value
c_params.pcen = 132.5 ;TS 2021-02-25 corrected the value
endelse
end
endcase
; TS 2021-02-25 added reading of chopper parameter from ascii file depending on the ascii version
;chopsep + chopwin + (cr) chopradius
......@@ -5175,7 +5181,6 @@ pro cosmos_raw_read_nexus, files, monitors, counts, params, path, override, refl
id = h5d_open(file, '/entry0/instrument/PSD/time_of_flight')
temppar.channelwidth = (h5d_read(id))[0]
temppar.channelwidth *= 1.e-6 ;convert to s, units MISSING NXS
;TS 2021-04-27 pixeldensity should be read from file. But careful, nx and ny seem to be exchanged in Nexus version 2 (data_format=5). Fixed for Nexus version 3 (data_format=6)
if c_params.data_format le 5 then begin
temppar.pixeldensity = 1
......@@ -5203,14 +5208,15 @@ pro cosmos_raw_read_nexus, files, monitors, counts, params, path, override, refl
;id = h5d_open(file, '/entry0/instrument/Flipper1/state') ; TS 2021-04-20 Flipper1 is now written correctly in NEXUS but I keep using the shutter state
id = h5d_open(file, '/entry0/instrument/fl1/value')
tmp = (h5d_read(id))[0]
if tmp eq '+' then temppar.f1 = 0 else if tmp eq '-' then temppar.f1 = 1 else temppar.f1 = tmp;to be consistent with Ascii; TS 2021-04-20 This line is only needed if the Flipper1 string is read. I left it here as an option.
;TS 2021-05-12 The fl1_value from nexus version 3 is now an integer. Cannot do the "+", "-" comparison
temppar.f1 = tmp;if string(tmp) eq '+' then temppar.f1 = 0 else if tmp eq '-' then temppar.f1 = 1 else temppar.f1 = tmp;to be consistent with Ascii; TS 2021-04-20 This line is only needed if the Flipper1 string is read. I left it here as an option.
;cosmos_logmessage, 'Detected F1: ' + cosmos_str_make(temppar.f1), /WARNING
;id = h5d_open(file, '/entry0/instrument/Flipper2/state')
id = h5d_open(file, '/entry0/instrument/fl2/value') ; TS 2021-02-17 Flipper2 is now written correctly in NEXUS but I keep using the shutter state
tmp = (h5d_read(id))[0]
if tmp eq '+' then temppar.f2 = 0 else if tmp eq '-' then temppar.f2 = 1 else temppar.f2 = tmp;to be consistent with Ascii; TS 2021-04-20 This line is only needed if the Flipper2 string is read. I left it here as an option.
;TS 2021-05-12 The fl1_value from nexus version 3 is now an integer. Cannot do the "+", "-" comparison
temppar.f2 = tmp;if tmp eq '+' then temppar.f2 = 0 else if tmp eq '-' then temppar.f2 = 1 else temppar.f2 = tmp;to be consistent with Ascii; TS 2021-04-20 This line is only needed if the Flipper2 string is read. I left it here as an option.
;cosmos_logmessage, 'Detected F2: ' + cosmos_str_make(temppar.f2), /WARNING
endif else if (strcmp(strtrim(c_params.inst,2),'figaro',/FOLD_CASE)) then begin
c_params.chopwin = c_params.chopwin_fig
......@@ -5357,7 +5363,6 @@ pro cosmos_raw_read_nexus, files, monitors, counts, params, path, override, refl
params = temppar
params.monitor = 0.
params.runtime = 0.
monitors = lonarr(2, temppar.size_t)
counts = lonarr(temppar.size_x, temppar.size_t)
......
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