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

Small modifications from Thomas Saerbeck

parent 536bd012
...@@ -3967,19 +3967,25 @@ pro cosmos_raw_read, files, monitors, counts, params, path, override, reflect=re ...@@ -3967,19 +3967,25 @@ pro cosmos_raw_read, files, monitors, counts, params, path, override, reflect=re
4: c_params.pcen = 132.5 4: c_params.pcen = 132.5
5: c_params.pcen = 132.5 ;TS 2021-02-25 corrected the value 5: c_params.pcen = 132.5 ;TS 2021-02-25 corrected the value
else: begin else: begin
cosmos_logmessage, 'c_params.data_format = ' + string(c_params.data_format) + ' not handled!', /WARNING ;TS 2021-05-12 Changed the following block since the data_format warning was always sent.
cosmos_logmessage, 'Using c_params.pcen = 132.5', /WARNING ;TS 2021-02-25 corrected the value c_params.pcen = 132.5 ;TS 2021-05-12 Default value ascii version >= 5
c_params.pcen = 132.5 ;TS 2021-02-25 corrected the value 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
c_params.pcen = tmp
endif else begin
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 end
endcase endcase
;Pcen which is now written in datafile ;TS 2021-02-25
tmp = par1[105]
if (tmp gt 0.0) then begin
c_params.pcen = tmp
endif else begin
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
; TS 2021-02-25 added reading of chopper parameter from ascii file depending on the ascii version ; TS 2021-02-25 added reading of chopper parameter from ascii file depending on the ascii version
;chopsep + chopwin + (cr) chopradius ;chopsep + chopwin + (cr) chopradius
...@@ -5175,7 +5181,6 @@ pro cosmos_raw_read_nexus, files, monitors, counts, params, path, override, refl ...@@ -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') id = h5d_open(file, '/entry0/instrument/PSD/time_of_flight')
temppar.channelwidth = (h5d_read(id))[0] temppar.channelwidth = (h5d_read(id))[0]
temppar.channelwidth *= 1.e-6 ;convert to s, units MISSING NXS 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) ;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 if c_params.data_format le 5 then begin
temppar.pixeldensity = 1 temppar.pixeldensity = 1
...@@ -5199,18 +5204,19 @@ pro cosmos_raw_read_nexus, files, monitors, counts, params, path, override, refl ...@@ -5199,18 +5204,19 @@ pro cosmos_raw_read_nexus, files, monitors, counts, params, path, override, refl
id2 = h5a_open_name(id, 'units') id2 = h5a_open_name(id, 'units')
units = h5a_read(id2) units = h5a_read(id2)
temppar.tra = cosmos_convert_units(tmp, units, 'mm') ;note mm units temppar.tra = cosmos_convert_units(tmp, units, 'mm') ;note mm units
;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/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') id = h5d_open(file, '/entry0/instrument/fl1/value')
tmp = (h5d_read(id))[0] 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 ;cosmos_logmessage, 'Detected F1: ' + cosmos_str_make(temppar.f1), /WARNING
;id = h5d_open(file, '/entry0/instrument/Flipper2/state') ;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 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] 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 ;cosmos_logmessage, 'Detected F2: ' + cosmos_str_make(temppar.f2), /WARNING
endif else if (strcmp(strtrim(c_params.inst,2),'figaro',/FOLD_CASE)) then begin endif else if (strcmp(strtrim(c_params.inst,2),'figaro',/FOLD_CASE)) then begin
c_params.chopwin = c_params.chopwin_fig c_params.chopwin = c_params.chopwin_fig
...@@ -5357,7 +5363,6 @@ pro cosmos_raw_read_nexus, files, monitors, counts, params, path, override, refl ...@@ -5357,7 +5363,6 @@ pro cosmos_raw_read_nexus, files, monitors, counts, params, path, override, refl
params = temppar params = temppar
params.monitor = 0. params.monitor = 0.
params.runtime = 0. params.runtime = 0.
monitors = lonarr(2, temppar.size_t) monitors = lonarr(2, temppar.size_t)
counts = lonarr(temppar.size_x, 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