The code.ill.fr has been recreated and upgraded with the latest version this weekend, If you encounter any problem please inform the Helpdesk.

cosmos_globals.pro 41.5 KB
Newer Older
1
;PG on 7/8/2017:Added chopper radii into c_prams.cr
Didier Richard's avatar
Didier Richard committed
2
3
4
5
6
7
pro cosmos_globals_init

end

;+
; :Description:
8
;    Define the cosmos/galaxy table columns labels.
Didier Richard's avatar
Didier Richard committed
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
;
; :Params:
;    nCols : in, required, type="int"
;       The number of columns for the table.
;       
; :Returns:
;     The column labels of the table.
;
; :Author: pellegrini
;
; :History:
;    pellegrini, 22 Feb. 2011
;
; :Categories: cosmos, galaxy
;
; :private:
;-
function cosmos_get_table_labels, nCols

    if n_elements(nCols) eq 0 then nCols = -1   

    ; These are the only possible number of columns for cosmos/galaxy.
    case nCols of
32
        4    : tLabels = ['Position', 'Date (dd/mm/yy)', 'Time (hh:mm:ss)', 'Info']
Didier Richard's avatar
Didier Richard committed
33
        6    : tLabels = ['Direct 1', 'Reflect 1', 'Normalise', 'Theta 1'  , 'Out file' , 'Out LAMP']
34
        7    : tLabels = ['Direct 1', 'Reflect 1', 'Instr 1'  , 'Normalise', 'Theta 1'  , 'Out file' , 'Out LAMP']
Didier Richard's avatar
Didier Richard committed
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
        10   : tLabels = ['Direct 1', 'Direct 2' , 'Reflect 1', 'Reflect 2', 'Normalise', 'Factor'   , 'Theta 1'  , 'Theta 2'   , 'Out file'  , 'Out LAMP']
        12   : tLabels = ['Direct 1', 'Direct 2' , 'Reflect 1', 'Reflect 2', 'Instr 1'  , 'Instr 2'  , 'Normalise', 'Factor'    , 'Theta 1'   , 'Theta 2'  , 'Out file'  , 'Out LAMP' ]    
        14   : tLabels = ['Direct 1', 'Direct 2' , 'Direct 3' , 'Reflect 1', 'Reflect 2', 'Reflect 3', 'Normalise', 'Factor 1-2', 'Factor 2-3', 'Theta 1'  , 'Theta 2'   , 'Theta 3'   , 'Out file', 'Out LAMP' ]    
        17   : tLabels = ['Direct 1', 'Direct 2' , 'Direct 3' , 'Reflect 1', 'Reflect 2', 'Reflect 3', 'Instr 1'  , 'Instr 2'   , 'Instr 3'   , 'Normalise', 'Factor 1-2', 'Factor 2-3', 'Theta 1' , 'Theta 2', 'Theta 3', 'Out file', 'Out LAMP' ]
        else : begin
            print, "Invalid column number."
            tLabels = string(indgen(nCols))        
        end
    
  endcase 
                
  return, tLabels
    
end

;+
; :Description:
;    Returns the default settings for cosmos/galaxy programs.
;
; :Returns:
;     An IDL structure storing the default settings for cosmos/galaxy programs.
;
; :Author: pellegrini
;
; :History:
;    pellegrini, 22 Feb. 2011
;
; :Categories: cosmos, galaxy
;
; :private:
;-
function cosmos_get_default_settings

  case strupcase(!VERSION.OS_FAMILY) of
  
    "WINDOWS" : begin
                  defPath_data = getenv("USERPROFILE")
                  defPath_output = getenv("USERPROFILE")
                end  
    "UNIX"    : begin
                   defPath_data = '/users/data'
                   defPath_output = getenv("HOME")
                end  
    
  endcase

  settings = {insrow             : 1                     , $
              setval             : 1.0                   , $
              incrval            : 1.0                   , $
              nangles            : 1                     , $
              instbg             : 0                     , $
              table              : ptr_new(strarr(10,20)), $
87
88
89
              foregdwidth1       : [7,0]                 , $
              foregdwidth2       : [15,0]                , $
              foregdwidth3       : [15,0]                , $
Didier Richard's avatar
Didier Richard committed
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
              backgdlowwidth1    : 5                     , $
              backgdlowwidth2    : 5                     , $
              backgdlowwidth3    : 5                     , $
              backgdlowoffset1   : 5                     , $
              backgdlowoffset2   : 5                     , $
              backgdlowoffset3   : 5                     , $
              backgdhighwidth1   : 5                     , $
              backgdhighwidth2   : 5                     , $
              backgdhighwidth3   : 5                     , $
              backgdhighoffset1  : 5                     , $
              backgdhighoffset2  : 5                     , $
              backgdhighoffset3  : 5                     , $
              lambdamin1         : 2.0                   , $
              lambdamin2         : 2.0                   , $
              lambdamin3         : 2.0                   , $
              lambdamax1         : 30.0                  , $
              lambdamax2         : 30.0                  , $
              lambdamax3         : 30.0                  , $
              group              : 1                     , $
              groupvar1          : 0.5                   , $
              groupvar2          : 0.5                   , $
              groupvar3          : 0.5                   , $
              dbeam1             : ''                    , $
              dbeam2             : ''                    , $
              dbeam3             : ''                    , $
              rbeam1             : ''                    , $
              rbeam2             : ''                    , $
              rbeam3             : ''                    , $
Gonzalez, Miguel's avatar
Gonzalez, Miguel committed
118
119
              normalise          : 0                     , $ ;kept here, but not used (no useful monitors)
              angmethod          : 0                     , $
Didier Richard's avatar
Didier Richard committed
120
              backmeth           : 0                     , $
121
122
123
              method1            : 'incoherent'          , $
              method2            : 'incoherent'          , $
              method3            : 'incoherent'          , $
Didier Richard's avatar
Didier Richard committed
124
              groupdiscard       : 1                     , $
125
              usenexus           : 0                     , $
Didier Richard's avatar
Didier Richard committed
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
              waterrun           : ''                    , $
              qmin               : 0.010                 , $
              qmax               : 0.015                 , $
              usefulpixelmin1    : 25L                   , $
              usefulpixelmin2    : 25L                   , $
              usefulpixelmin3    : 25L                   , $
              usefulpixelmax1    : 230L                  , $
              usefulpixelmax2    : 230L                  , $
              usefulpixelmax3    : 230L                  , $
              searchpixelmin1    : 25L                    , $
              searchpixelmin2    : 25L                    , $
              searchpixelmin3    : 25L                    , $
              searchpixelmax1    : 230L                   , $
              searchpixelmax2    : 230L                   , $
              searchpixelmax3    : 230L                   , $
              searchtimemin1     : 0L                    , $
              searchtimemin2     : 0L                    , $
              searchtimemin3     : 0L                    , $
              searchtimemax1     : 999L                  , $
              searchtimemax2     : 999L                  , $
              searchtimemax3     : 999L                  , $
              autosearchpixel1   : 0                     , $
              autosearchpixel2   : 0                     , $
              autosearchpixel3   : 0                     , $
              autosearchtime1    : 0                     , $
              autosearchtime2    : 0                     , $
              autosearchtime3    : 0                     , $
153
154
155
              detpixel1          : 0.0                   , $
              detpixel2          : 0.0                   , $
              detpixel3          : 0.0                   , $
Didier Richard's avatar
Didier Richard committed
156
157
158
159
160
161
162
163
164
165
166
167
168
169
              xdh1               : 1.135                 , $
              xdh2               : 2.077                 , $
              ydet               : 0.509                 , $
              poff1              : 0.0                   , $
              poff2              : 0.0                   , $
              poff3              : 0.0                   , $
              d01                : 0.0                   , $
              d02                : 0.0                   , $
              d03                : 0.0                   , $
              openoff1           : 0.0                   , $
              openoff2           : 0.0                   , $
              openoff3           : 0.0                   , $
              pixelwidth         : 0.0                   , $
              sdetd              : 0.0                   , $
170
171
172
              spoff1             : 0.0                   , $
              spoff2             : 0.0                   , $
              spoff3             : 0.0                   , $
Didier Richard's avatar
Didier Richard committed
173
174
175
176
177
178
179
180
181
182
183
184
185
              edelay1            : 0.0                   , $
              edelay2            : 0.0                   , $
              edelay3            : 0.0                   , $
              normvar            : 1.0                   , $
              factor1            : 1.0                   , $
              factor2            : 1.0                   , $
              takenum1           : 0L                    , $                         
              takenum2           : 0L                    , $                         
              takenum3           : 0L                    , $                         
              override           : 0                     , $
              pathdir            : defPath_data          , $
              outputdir          : defPath_output        , $
              outputbase         : 'settings'            , $
186
              outputfmt          : [0, 0, 1, 0, 0]       , $
Didier Richard's avatar
Didier Richard committed
187
              mftinstr           : 0                     , $
188
              interface          : 0                     , $
Didier Richard's avatar
Didier Richard committed
189
190
191
192
193
194
195
196
              mftparamsfig       : strarr(9)             , $
              mftparamsd17       : strarr(9)             , $
              firstnumor         : ''                    , $
              lastnumor          : ''                    , $
              numorstep          : ''                    , $
              include            : [1, 1, 1, 1, 1, 1, 1] , $
              makesubdir         : 1                     , $
              gtable             : ptr_new(strarr(4,20)) , $
197
198
              peakref            : [0, 0, 0]             , $
              polcorrfile        : ''}
Didier Richard's avatar
Didier Richard committed
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
                                                                           
  return, settings

end


pro cosmos_globals

  common cosmos_direct, direct1_files, direct2_files, direct3_files, direct1_monitor, direct2_monitor, direct3_monitor, $
                        direct1_array, direct2_array, direct3_array, direct1_params, direct2_params, direct3_params
    
  common cosmos_message, cosmos_info, cosmos_warn
        
  common cosmos_results, c_results
      
  common cosmos_water, water_file, water_array, water_lowerlimit
  
  common cosmos_params, c_params

  common cosmos_help, cosmos_help_message, cosmos_version

  common cosmos_doc, cosmos_doc

  common cosmos_settings, c_settings

  c_settings = cosmos_get_default_settings()

  c_params = {cosmos_constants, $
              months           : ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], $
              planckperkg      : 3.956e-7, $
229
              chopsep_d17      : 81.1e-3 , $
Didier Richard's avatar
Didier Richard committed
230
231
232
233
234
235
236
237
              chopsep12_fig    : 0.0972  , $
              chopsep13_fig    : 0.3472  , $
              chopsep14_fig    : 0.7972  , $
              chopsep23_fig    : 0.2472  , $
              chopsep24_fig    : 0.6972  , $
              chopsep34_fig    : 0.4472  , $
              chopwin_d17      : 45.0    , $
              chopwin_fig      : 45.0    , $
238
239
              cr_d17           : 0.36    , $
              cr_fig           : 0.305   , $
Didier Richard's avatar
Didier Richard committed
240
241
242
243
244
245
246
247
248
249
250
              interslit_d17    : 3500.0  , $
              interslit_fig    : 2165.0  , $
              pixels_x         : 300L    , $
              pixels_t         : 1000L   , $
              pixels_x_d17     : 286L    , $
              pixels_x_fig     : 256L    , $
              pixels_t_d17     : 1000L   , $
              pixels_t_fig     : 1000L   , $
              poff             : 0.0     , $
              d0               : 0.0     , $
              openoff          : 0.0     , $
251
              offset           : 0.0     , $
Didier Richard's avatar
Didier Richard committed
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
              pixelwidth       : 0.0     , $
              sdetd            : 0.0     , $
              edelay           : 0.0     , $
              xdh1             : 1.135   , $
              xdh2             : 2.077   , $
              ydet             : 0.509   , $
              sizeset          : 0L      , $
              inst             : ''      , $
              data_format      : 0L      , $
              user             : ''      , $
              local_contact    : ''      , $
              title            : ''      , $
              subtitle         : ''      , $
              start_time       : ''      , $
              end_time         : ''      , $
              chopsep          : 0.0     , $
              chopwin          : 0.0     , $
269
              cr               : 0.0     , $
Didier Richard's avatar
Didier Richard committed
270
271
272
273
274
275
276
277
278
279
              interslit        : 0.0     , $
              uselambdamonitor : 0L      , $
              rowinit          : 0L      , $
              row              : 0L      , $
              rowfinish        : 0L      , $
              pcen             : 132.5   , $
              min_refl_numor   : 1000000L, $
              max_refl_numor   : 0L      , $
              angle_bragg_1    : 0.0     , $
              angle_bragg_2    : 0.0     , $
280
              angle_bragg_3    : 0.0}
Didier Richard's avatar
Didier Richard committed
281
282
283
284
285
286
287
288
289
290

  
  ; An array of string storing the information about the current cosmos/galaxy session.
  cosmos_info =["SESSION STARTED ON " + systime() + ":"]

  ; An array of string storing the warnings about the current cosmos/galaxy session.
  cosmos_warn = ["WARNINGS:"]
                                              
  ; Define (other) global structures
  temppar = {cosmos_parameters   , $
Gonzalez, Miguel's avatar
Gonzalez, Miguel committed
291
             monitor      : 0.0  , $
Didier Richard's avatar
Didier Richard committed
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
             runtime      : 0.0  , $
             dan          : 0.0  , $
             san          : 0.0  , $
             size_x       : 0L   , $
             size_t       : 0L   , $
             x_min        : 0L   , $
             x_max        : 0L   , $
             openangle    : 0.0  , $
             period       : 0.0  , $
             slits        : 0.0  , $
             slitsproduct : 0.0  , $
             tofd         : 0.0  , $
             tofm         : 0.0  , $
             delayangle   : 0.0  , $
             delay        : 0.0  , $
             channelwidth : 0.0  , $
             pixeldensity : 0L   , $
             sdetd        : 0.0  , $
             refdown      : 0    , $
             offset       : 0.0  , $
             slit3        : 0.37 , $
             slit2        : 2.535, $
             s2w          : 0.5  , $
315
316
             s3w          : 0.5  , $
             wantedtheta  : 0.0  , $
317
318
319
320
             wantedpixel  : 0    , $
             tra          : 0.0  , $
             f1           : 0    , $
             f2           : 0}
Didier Richard's avatar
Didier Richard committed
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
    
  direct1_files = strarr(1)
  direct2_files = strarr(1)
  direct3_files = strarr(1)

  direct1_array = lonarr(c_params.pixels_x, c_params.pixels_t)
  direct2_array = lonarr(c_params.pixels_x, c_params.pixels_t)
  direct3_array = lonarr(c_params.pixels_x, c_params.pixels_t)
  
  direct1_params = { cosmos_parameters }
  direct2_params = { cosmos_parameters }
  direct3_params = { cosmos_parameters }
                                                                             
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  ; The cosmos_water variables
  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  water_file = strarr(1)
  water_array = make_array(c_params.pixels_x, /float, value = 1.)
  water_lowerlimit = 0.1 ; lower limit on efficiency to avoid divide by zero errors
   
  c_results = {}

343
  cosmos_version = '3.3.13'
Didier Richard's avatar
Didier Richard committed
344
345

  cosmos_help_message = [$
346
  '',$
347
348
  'COSMOS V. 3.3.13',$
  '14 October 2019',$
349
  'Added routines to be able to read and use NeXus files (not functional for Figaro yet).',$
350
351
  '',$
  '',$
Gonzalez, Miguel's avatar
Gonzalez, Miguel committed
352
353
354
355
356
  'COSMOS V. 3.3.12',$
  '26 July 2019',$
  'Thomas Saerbeck added spin assymmetry calculation and output (for polarized case).',$
  '',$
  '',$
357
358
359
360
361
  'COSMOS V. 3.3.11',$
  '20 June 2019',$
  'Put back option to choose between time/monitor normalization.',$
  '',$
  '',$
362
363
364
365
366
  'COSMOS V. 3.3.10',$
  '10 September 2018',$
  'Removed /READ option in call to file_test, as this test fails now with the new serdon.',$
  '',$
  '',$
367
368
369
370
371
372
  'COSMOS V. 3.3.9',$
  '27 June 2018',$
  'Includes changes done by Thomas Saerbeck (indicated by TS 2018-06-04 comments).',$
  'Added patch to use the same peak position for a given angle in all polarization runs.',$
  '',$
  '',$
Gonzalez, Miguel's avatar
Gonzalez, Miguel committed
373
374
375
376
377
378
379
  'COSMOS V. 3.3.8',$
  '4 April 2018',$
  'Use float for monitor counts in order to avoid int32 overflow.',$
  'Correct error in calculation of wavelength resolution.',$
  'Added option in Normalization tab to choose between dan/san.',$
  '',$
  '',$
380
381
382
383
384
385
386
387
  'COSMOS V. 3.3.7',$
  '2 February 2018',$
  'Correct bug in call to cosmos_anal_correctdistance routine, ',$
  '  as the relevant input is the sample to detector distance',$
  '  and not the total TOF distance.',$
  'Add missing factor of 2 in calculation of resolution.',$
  '',$
  '',$
388
389
390
391
392
393
394
395
396
397
398
399
400
401
  'COSMOS V. 3.3.6',$
  '17 October 2017',$
  'Several changes and new features by P. Gutfreund for consistency with ',$
  '  paper by P. gutfreund et al. submitted to J. Appl. Cryst.',$
  'The chopper radii have been added as a global parameter (c_params.cr).',$
  'The wavelength resolution smearing due to the finite beam size at the',$
  '  chopper position has been added. This mainly concerns large s2 openings,',$
  '  high wavelength resolution and short wavelengths.',$
  'The gravity correction for FIGARO has been improved with a very small ',$
  '  correction to theta in reflection down and taking into account of the ', $
  '  opening offset gravity correction.',$
  'Small correction to the detector center calculation of FIGARO.',$
  '',$
  '',$
402
403
404
405
406
  'COSMOS V. 3.3.5',$
  '12 May 2017',$
  'Added output options in .mft format for D17.',$
  '',$
  '',$
407
408
409
410
411
412
413
  'COSMOS V. 3.3.4',$
  '13 January 2017',$
  'Added options (store_polparams, pol_lambda, pol_parref) in order to use the same ',$
  '  same set of parameters (determined from 1st numors) for all the numors ',$
  '  corresponding to the same sample and different polarizations.',$
  '',$
  '',$
414
415
416
417
418
  'COSMOS V. 3.3.3',$
  '3 November 2016',$
  'Several corrections by Thomas Saerbeck related to the treatment of polarized data.',$
  '',$
  '',$
419
420
421
422
423
  'COSMOS V. 3.3.2',$
  '5 July 2016',$
  'Version of Cosmos handling polarization based on V. 3.2.21 and work by Thomas Saerbeck.',$
  '',$
  '',$
424
425
426
427
428
429
430
431
  'COSMOS V. 3.2.21',$
  '29 June 2016',$
  'Write correct start/end times (by line) in MFT output.',$
  'Solved problem when having more than 2 numors for the DB. This bug was introduced',$
  '  in v. 3.2.1 by an unnecessary optimization.',$
  'Remove wrong warning when trying to read empty cells.',$
  '',$
  '',$
432
433
434
435
436
  'COSMOS V. 3.2.20',$
  '23 June 2016',$
  'Reorder output formats as in v. 3.2.17 to keep compatibility with old saved tables.',$
  '',$
  '',$
437
438
439
440
441
442
  'COSMOS V. 3.2.19',$
  '20 June 2016',$
  'Corrected bug that made that in the .lam output files the normalization factors',$
  '  between angles were incorrectly applied a second time.',$
  '',$
  '',$
443
444
445
446
447
448
449
  'COSMOS V. 3.2.18',$
  '13 June 2016',$
  'Added test in cosmos_raw_read to check if file is readable before opening it.',$
  'Modified defaults for output, so now by default only the MFT format is written.',$
  'Keep zeros in name of Out File when using automatic filling in this column',$
  '',$
  '',$
450
451
452
453
454
455
456
  'COSMOS V. 3.2.17',$
  '28 October 2015',$
  'Bug fix: Instrument background did not work when a single angle was selected because of a typo.',$
  'Bug fix: Modifications to cosmos_widgets.pro to improve the interface in Linux/Mac machines and',$
  '  avoid that the interface freezes when sans_sheet or a similar interface has been launched before.',$
  '',$
  '',$
457
458
459
460
461
462
463
  'COSMOS V. 3.2.16',$
  '17 September 2015',$
  'Bug fix when writing .lam output files (normalization and factor correctly taken into account).',$
  'Peaksearchrefined routine improved to consider the cases where a single pixel is given as',$
  '  search region and some pixel intensities are negative.',$
  '',$
  '',$
464
465
466
467
468
469
470
471
  'COSMOS V. 3.2.15',$
  '30 July 2015',$
  'Several fixes and modifications done by P. Gutfreund:',$
  '  TrueSampleDistance (including sample offset) used also in SAN and DET options.',$
  '  Use wavelength corrected (for gravity) theta in coherent summing.',$
  '  Additional check for chopper phases.',$
  'Use different chopper separations (81.1 or 85.0 mm) for data taken after 2012 and',$
  '  before 2012 whenever the value read from the numor file is wrong (<79 or > 87 mm).',$
472
  'Storing of the full set of results in w61 (introduced in v. 3.2.2) disabled when',$
473
474
475
476
477
478
479
480
481
482
483
484
  '  the number of rows is > 500.',$
  '',$
  '',$
  'COSMOS V. 3.2.14',$
  '9 July 2015',$
  'DAN option in Figaro modified to be really equivalent to D17 DAN.',$
  'Previous Figaro-DAN option (introduced in v. 3.2.11) renamed to DET.',$
  '  This option uses the difference between the peak position in the DB and',$
  '  the wanted/reference peak position to correct the Bragg angle given in',$
  '  the numor file as parameter Yellow-51 (Wanted Theta).',$
  '',$
  '',$
485
486
487
  'COSMOS V. 3.2.13b',$
  '27 July 2015',$
  'Added a test to check that the value of the separation between choppers in D17 is valid.',$
488
  '  If not, uses the default value stored in c_params.chopsep_d17 (i.e. 81.1 mm).',$
489
490
491
492
493
494
495
496
497
498
  '  This is needed because occasionally Nomad writes a completely wrong value.',$
  '',$
  '',$
  'COSMOS V. 3.2.13',$
  '30 June 2015',$
  'Return to use the same background subtraction routine as in v. 3.2.8,',$
  '  now called cosmos_anal_backgroundaverage_old, because the newer routine',$
  '  seems to overestimate the error bars at large Q (to check).',$
  '',$
  '',$
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
  'COSMOS V. 3.2.12',$
  '25 June 2015',$
  'Modified the behavior if after treatment the size of the result array is zero.',$
  '  The message: Empty array returned as result! will now appear.',$
  'Added a check in Lamp related routines to avoid errors when Cosmos is run without Lamp.',$
  'Information about the sample offset being not zero has been removed from the warnings,',$
  '  and will appear now as an standard info in the log window.',$
  'For Figaro DAN option, added a box to give the position in the detector of the reflected beam',$
  '  for a desired reflection angle, determined from a reference measurement,',$
  'Also added the information about peak positions in the log output (again for Figaro DAN only).',$
  '',$
  '',$
  'COSMOS V. 3.2.11',$
  '19 June 2015',$
  'Added DAN option to calculate theta in Figaro.',$
  '',$
  '',$
516
517
518
519
520
521
522
523
524
  'COSMOS V. 3.2.10',$
  '18 June 2015',$
  'Implementation of minor changed requested by Richard Campbell.',$
  'Opening value for slit 3 modified depending on the value of BGS3 actual value.',$
  'When starting a new table, the default foreground width is given by a single number',$
  '  instead of a pair of numbers, in order to conform to the usual appearance.',$
  'Separate buttons in normalization window to transfer DB, 2-theta and norm factors.',$
  '',$
  '',$
525
526
527
528
529
530
531
  'COSMOS V. 3.2.9',$
  '10 June 2015',$
  'Additions and corrections to cosmos_analysis.pro (fixing smaller bugs in coherent',$
  ' summation and changes to cosmos_anal_backgroundfit cosmos_anal_backgroundaverage)',$
  ' done by T. Saerbeck and R. Cubitt.',$
  '',$
  '',$
532
533
534
535
536
  'COSMOS V. 3.2.8',$
  '13 May 2015',$
  'Bug fix: After loading/starting cosmos the values of coherent/incoherent method.',$
  '  could not be changed.',$
  '',$
537
538
539
540
541
542
543
544
  'COSMOS V. 3.2.7',$
  '7 May 2015',$
  'Bug fix: Coherent/incoherent method was not correctly loaded from saved file.',$
  'Removed test for slits opening added in v. 3.2.5, as P. Gutfreund modified the',$
  '  code to be able to apply the coherent method also when different openings in',$
  ' DB and RB are used.',$
  '',$
  '',$
545
546
547
548
549
  'COSMOS V. 3.2.6',$
  '28 April 2015',$
  'Corrections by P. Gutfreund to coherent analysis.',$
  '',$
  '',$
550
551
552
553
554
555
556
557
558
  'COSMOS V. 3.2.5',$
  '27 April 2015',$
  'Small addition to cosmos_anal.pro done by PG in order to overcome a Nomad bug ',$
  '  that makes that the chopper values are not correctly written in the numor.',$
  'Added a test when the coherent is requested to ensure that the slits openings ',$
  '  for the direct and reflected beam measurements are the same.',$
  '  Otherwise return to use incoherent analysis.',$
  '',$  
  '',$
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
  'COSMOS V. 3.2.4',$
  '16 April 2015',$
  'Additional changes from Bob and Philipp.',$
  '',$
  '',$
  'COSMOS V. 3.2.3',$
  '26 March 2015',$
  'Incorporating latest modifications from Bob and Philipp, mainly related to the ',$
  '  resolution calculation.',$
  '',$
  '',$
  'COSMOS V. 3.2.2',$
  '25 March 2015',$
  'The writing of the log info and the warnings into the corresponding windows has been ',$
  '  modified in order to improve the performance of the program when treating many rows.',$
  '  Now the log and the warnings are written only at the end of the run, once the full table ',$
  '  or the selected rows have been treated. However a Refresh button has been added to the ',$
  '  LOG tab interface, to allow the user to update the log at any time during the execution.',$
  'In the normalization tab, the Transfer button will fill the table with the direct beam numors ',$
  '  the angles and the factors appearing in that window. However if the corresponding colums in ',$
  '  the table are not completely empty, a warning message is raised in order to let the user ',$
  '  decide if he wants to overwrite the table contents or not.',$
  'The results of the table will be automatically saved into Lamp workspace w61.',$
  '  This will be a 2D workspace containing R[Q,row] that can be manipulated with Lamp',$
  '  and visualized with SuperPlot by loading it previously into a workspace w1-w60.',$
  '',$
  '',$
  'COSMOS V. 3.2.1',$
  '23 March 2015',$
  'Cleaning and refactoring parts of the code before introducing major changes requested.',$
  'Only two modes left: normal_run (standard) and nodirect_run (using monitor 2, only Figaro).',$
  'Direct beam data re-read only if numor changed.',$
  'Warning when trying to reduce the number of columns (lost info for columns not shown).',$
  'Possibility to choose incoherent/coherent treatment independently for each angle.',$
  'Foreground saved with the same format employed by the user (1 or 2 values), but it ',$
  '  should be noted that internally Cosmos will work with a pair of values corresponding to',$
  '  the number of pixels at both sides of the peak pixel to take in the integration.',$
  '  Note that the conversion of one value to a pair of values is done using integers,',$
  '  so foreground values of 8 or 9 will be both converted to [4,4], corresponding to a',$
  '  total integration range of 9 pixels.',$
  '',$
  '',$
  'COSMOS V. 3.1.0',$
  'February 2015 - Never publicly released - Working version used by RC, PG and MAG',$
  'Working to allow asymmetric foreground (by giving a couple of integers in the Foreground Width box instead of 1)',$
  '  and adding a button in the calculation tab to allow the user select between the standard treatment',$
  '  and the new coherent treatment developed by B. Cubitt.',$
  'Changed cosmos_load_settings and cosmos_set_settings in order to fill correctly foreground width when ',$ 
  '  loading a table (two values now)',$
  'Need to check if new cosmos_anal_group does not create problems (average Q will be different in direct ',$
  '  and reflect beams because weighted by errors. Need also to find best way of defining weights.',$
  '',$
611
  '',$
612
613
614
  'COSMOS V. 3.0.20',$
  'Released on 5 February 2015.',$
  'Lambda output modified again to produce separate files for each detector angle,',$
615
  '  but each of them containing grouped data.',$
616
  'Change needed because different detector angles imply different length paths through',$
617
  '  the sample absorbing layers, so the absorption corrections need to be applied separately.',$
618
  'Bug fix: Corrected minor problem in the creation of the output file names when outfile is not given.',$
619
620
  '',$
  '',$
621
622
623
624
625
  'COSMOS V. 3.0.19',$
  'Released on 23 January 2015.',$
  'Lambda output modified - now working on grouped data (average wavelength)',$
  '',$
  '',$
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
  'COSMOS V. 3.0.18',$
  'Released on 5 December 2014.',$
  'Added output format writing the ungrouped results + lambda + theta ',$
  '             (computed after gravity corrections).',$
  'Added scroll bar to IO and normalization tab in Cosmos/Galaxy.',$
  'Galaxy table header modified to indicate format for date and time. ',$
  'Added button to IO tab in Galaxy to choose correct parameter number for sample position ',$
  '             (#49 for solid/liquid interfaces and #52 for air/liquid interfaces).',$
  'Added import/export of CSV files for the main table interface ',$
  'Added option to fill a cell giving first and last numor and increment ',$
  '             (the option appears in the context menu obtained with a mouse right-click in one table cell).',$
  'Bug fix: Solved problem with output file names when Outfile column is not filled ',$
  '             and some reflect cells are empty.',$
  'Bug fix: Factor12 was not transferred to the table when #Angles = 2.',$
  'Bug fix: Warning with sample offset message removed. Now Offset message only if NOT zero.',$
  '',$
  '',$
  'COSMOS V. 3.0.17',$
  'Released on 24 October 2014.',$
  'Change: P. Gutfreund modified cosmos_analysis.pro to compute the angular resolution ',$
  '             in the special case in which very small foreground widths are used.',$
  'Bug fix: In the Machine tab the units of TOF delay are seconds, not microseconds.',$
648
649
650
651
652
  '',$
  '',$
  'COSMOS V. 3.0.16',$
  'Released on 1 September 2014.',$
  'Bug fix: Increase button to work when more than 2 numors are written in table cell.',$
653
  '             (but mixing of concatenation symbols is not allowed).',$
654
655
656
657
658
659
  '',$
  '',$
  'COSMOS V. 3.0.15',$
  'Released on 22 July 2014.',$
  'Bug fix: Corrected problem when a single detector line for the background is passed.',$
  'Change: Added possibility to modify manually in MACHINE tab the sample position offset. ',$
Didier Richard's avatar
Didier Richard committed
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
  '',$
  '',$
  'COSMOS V. 3.0.14',$
  'Released on 26 April 2013.',$
  'Change: Edelay in Figaro calculated using an extra correction factor stored in par1[93].',$
  '',$
  '',$
  'COSMOS V. 3.0.13',$
  'Released on 17 April 2013.',$
  'Bug fix: Corrected bug (Variable is undefined: MONARR) affecting old D17 data and introduced ',$
  '             in version 3.0.10, when the option for the kinetic scans in D17 was added.',$
  '',$
  '',$
  'COSMOS V. 3.0.12',$
  'Released on 16 April 2013.',$
  'Change: In DAN option (only for D17) the peak positions of the direct and reflected beam are now ',$
  '             refined using a Gaussian fit before computing theta. ',$
  '             (Before they were just integers corresponding to the pixel where the intensity was maximal).',$
  '',$
  '',$
  'COSMOS V. 3.0.11',$
  'Released on 6 April 2013.',$
  'Change: Extended the TOF delay option to give different values for the three angles. ',$
  '',$
  '',$
  'COSMOS V. 3.0.10',$
  'Released on 28 March 2013.',$
  'Change: Treat also kinetic scans measured in D17. ',$
  'Change: Added possibility to modify manually in MACHINE tab the TOF delay. ',$
  '',$
  '',$
  'COSMOS V. 3.0.9',$
  'Released on 12 March 2013.',$
  'Change: Added possibility to modify manually in MACHINE tab the sample to detector distance. ',$
  '',$
  '',$
  'COSMOS V. 3.0.8',$
  'Released on 5 March 2013.',$
  'Bug fix: Corrected bug when search range = useful range ',$
  'Change: Added button to separate calculation of normalization factors and transfer to table. ',$
  '',$
  '',$
  'COSMOS V. 3.0.7',$
  'Released on 22 February 2013.',$
  'Change: Added new data format (version 3) produced in D17 by new kinetic acquisition card (used from 21/02/2013) ',$
  'Change: Angular resolution calculation updated (PG). ',$
  'Change: Statistical error calculation updated (PG). ',$
  'Change: Added option to have different chopper openings for direct and reflected beam (PG). ',$
  '',$
  '',$
  'COSMOS V. 3.0.6',$
  'Released on 8 February 2013.',$
  'Bug fix: Solved linux runtime specific problems (resizing, status bar color, buttons, ...)',$
  'Change: MFT output completed --> Parameter selection for Figaro OK',$
  'Change: Extended the cosmos table functionalities in case of missing values for direct or reflected beam',$
  'Change: Added the support for reading compressed numors',$
  'Change: Improved the cosmos table filling from the contents of normalization tab',$
  '',$
  '',$
  'COSMOS V. 3.0.5',$
  'Released on 30 October 2012.',$
  'Change: MFT format changed to G15.6',$
  '',$
  '',$
  'COSMOS V. 3.0.4',$
  'Released on 24 October 2012.',$
  'Bug fix: The Take numors button works now.',$
  'Bug fix: Case where only one extension is selected.',$
  'Bug fix: Case where the input and output directories are the same.',$
  'Change: Modified the reading routine to handle the new format.',$
  'Change: Added buttons for Paste, Clear, Copy basic actions.',$
  'Change: Added a status bar that displays a contextual help about the widgets.',$
  'Change: (Tried to) improve the Linux display.',$
  '',$
  '',$
  'COSMOS V. 3.0.3',$
  'Released on 30 July 2012.',$
  'Bug fix: Start and end time in MFT file format were wrong.',$
  'Change: In MFT format actual theta value written (instead of san).',$
  'Change: Slight changes in MFT format to eliminate undesired spaces.',$
  'Change: Some initial default values changed, including the data path for Unix.',$
  'Change: In normalization tab Water run --> Detector calibration.',$
  'Change: Default plotting style changed to log(R) vs Q.',$
  'Change: Removed warning messages concerning time stamp and water incompatible.',$
  'Code: New variables in c_params  to deal with changes in MFT writing',$
  '',$
  '',$
  'COSMOS V. 3.0.2',$
  'Released on 19 July 2012.',$
  'Introduced a new file format (mft) that contains a header with general informations about the run and a fourth-column containing the q-resolution.',$
  'This format is fully compatible with the Motofit program.',$
  'Updated widgets to improve the GUI for Linux users.',$
  'Added a prompt message when the user clicks on Reset button',$
  'Bug fix: the user could not select a workspace > 40 when using LAMP.',$
  'Bug fix: only the first slice of a kinetic run was output when the LAMP output was requested.',$
  'Bug fix: the normalization, when called from the Normalization tab, was only using the first reflect numor.',$
  '',$
  '',$
  'COSMOS V. 3.0.1',$
  '',$
  'Released on June 2012', $
  'Presents a new interface and enhanced functionality.',$
  'The old Cosmos is still available and can be obtained upon request or from',$
  'the ILL server: /net/serhom/home/cs/lambda/macros/FIGARO/fcosmos.pro.',$
  'Some older versions can be found as well in /net/serhom/home/cs/lambda/macros/COSMOS.#',$
  '',$
  'The list of changes that have taken place in Cosmos during 2012 is below. Note that a',$
  'major change related to the calculation of the detector distances in Figaro has been',$
  'only performed in the newer Cosmos version. This means that the old Cosmos can still',$
  'be used to treat D17 data, but it should not be used for Figaro data. In any case,',$ 
  'we advise everybody to use the new Cosmos.',$
  '',$
  'List of changes in the code during 2012 (latest modification in 2011 concerns the',$
  'calculation of wavelength and angular resolutions and was done by Philip Gutfreund',$
  'on 30 November 2011, v. 2.37):',$
  '',$
  '14 May 2012: Old Cosmos v. 2.38',$
  '             A bug affecting the treatment of kinetic runs has been corrected. This',$
  '             bug made that the background was only subtracted to the first frame of',$
  '             a kinetic run and not to the following ones. It had no effect for',$
  '             standard runs, where the background was correctly subtracted.',$
  '',$
  '1 June 2012: Release of the new Cosmos v. 3.01',$
  '             Completely new interface and two modifications affecting the reflectivity',$
  '             calculation in the case of Figaro:',$
  '             1. The sample-detector distance is calculated taking into account the correct geometry of FIGARO.',$
  '                Note that this requires the use of parameters XDH1, XDH2, YDET which are correctly included ',$
  '                in the numor file starting from version 9 of FIGARO file format. For version prior to 9,',$ 
  '                COSMOS will use default values suggested by instrument responsibles.',$ 
  '             2. The foreground region applied to the direct beam in the case of Figaro',$
  '                is incremented by 6 pixels with respect to the value given in the table',$ 
  '                (CALCULATION / Foreground (pixel)) and employed for the reflectivity peak,',$
  '                i.e. foregdref = Foreground and foregddir = Foreground + 6. Note that if no',$
  '                value is given in the table, the default value of 13 is applied to both the',$
  '                direct and reflect beam.']

  cosmos_doc = {cosmos_doc, $
                INSERT_ROWS       : 'Insert the entered number of rows in the cosmos input spreadsheet.', $
                SET_COLUMNS       : 'Set the column selection with the defined value.', $
                INCR_COLUMNS      : 'Increment the column selection with the defined value.', $
                COPY              : 'Copy the selected part of the cosmos input spreadsheet.', $
                PASTE             : 'Paste the selected part of the cosmos input spreadsheet (!!! that has to be copied before).', $
                DELROW            : 'Delete the selected number of rows of the cosmos input spreadsheet.', $
                CLEAR             : 'Clear the selected part of the cosmos input spreadsheet.', $
                CLEARALL          : 'Clear the whole cosmos input spreadsheet.', $
805
806
                EXPORTCSV         : 'Export the contents of the cosmos input spreadsheet into a CSV file.', $
                IMPORTCSV         : 'Import the contents of a CSV file into the cosmos input spreadsheet.', $
Didier Richard's avatar
Didier Richard committed
807
808
809
810
811
812
813
814
                N_ANGLES          : 'Change the number of angles used in the experiment setup (!!! will change the spreadsheet layout).', $
                INST_BG           : 'Include the instrument background for each angles used in the setup (!!! will change the spreadsheet layout).', $
                FG                : 'The width (in pixels) of the integration area.', $
                LEFT_BG           : 'The width and offset (in pixels) of the background area on the left side of the integration area.', $
                RIGHT_BG          : 'The width and offset (in pixels) of the background area on the right side of the integration area.', $
                LAMBDA            : 'The minimum and maximum wavelength (in Angstrom) for each angles.',$
                GROUPING          : 'If set, group the reflectivity values by step of dq.', $
                BG_METHOD         : 'Select the method used to define the background.', $
815
                CALC_METHOD       : 'Select the method used to perform the reduction (coherent/incoherent).', $
Didier Richard's avatar
Didier Richard committed
816
817
818
819
820
821
822
823
824
825
826
827
                GROUP_DISCARD     : 'If set, the data for which the statistics is too poor will be discarded from the final reflectivity curve.', $
                USEFUL_PIXEL      : 'To be documented.', $
                USEFUL_PIXEL_MIN  : 'To be documented.', $
                USEFUL_PIXEL_MAX  : 'To be documented.', $
                SEARCH_PIXEL      : 'To be documented.', $
                SEARCH_PIXEL_MIN  : 'To be documented.', $
                SEARCH_PIXEL_MAX  : 'To be documented.', $
                AUTO_SEARCH_PIXEL : 'To be documented.', $
                SEARCH_TIME       : 'To be documented.', $
                SEARCH_TIME_MIN   : 'To be documented.', $
                SEARCH_TIME_MAX   : 'To be documented.', $
                AUTO_SEARCH_TIME  : 'To be documented.', $
828
829
                REF_PEAK_POS      : 'Used with Figaro + DAN to compute theta.',$
                DET_PIXEL         : 'Give the exact pixel position at which the reflected peak is found in the reference measurement.',$
Didier Richard's avatar
Didier Richard committed
830
831
832
                TOF_DISTANCE      : 'Time of flight distance (in meter).', $
                OPENING_OFFSET    : 'To be documented.', $
                POFF_OFFSET       : 'To be documented.', $
833
                SPOFF_OFFSET      : 'Sample position offset (in meter).', $
Didier Richard's avatar
Didier Richard committed
834
835
836
837
838
839
840
841
842
843
                PIXEL_WIDTH       : 'To be documented.', $
                DET_DIST          : 'To be documented.', $
                E_DELAY           : 'To be documented.', $
                X_DH1             : 'To be documented.', $
                X_DH2             : 'To be documented.', $
                Y_DET             : 'To be documented.', $
                TAKE_VALUES       : 'Get all machine values from the entered input numors (one for each angle).', $
                OVERRIDE_VALUES   : 'Override the machine values stored in the numors entered in the input cosmos spreadsheet',$
                DIRECT_BEAM       : 'To be documented.', $
                D2O               : 'To be documented.', $
844
                SANGLE            : 'To be documented.', $
Didier Richard's avatar
Didier Richard committed
845
846
847
                NORM_FACTOR       : 'To be documented.', $
                Q_RANGE           : 'To be documented.', $
                BEAM_NORMALIZE    : 'To be documented.', $
Gonzalez, Miguel's avatar
Gonzalez, Miguel committed
848
                ANGLE_METHOD      : 'To be documented.', $
849
                DET_CALIBRATION   : 'To be documented.', $
850
851
                POL_CORR          : 'To be documented.', $
                USE_NEXUS         : 'Uses files in NeXus format'}
Didier Richard's avatar
Didier Richard committed
852
853

end