- Timestamp:
- Feb 10, 2011 1:29:02 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/NCNR_Utils.ipf
r750 r788 37 37 Variable/G root:myGlobals:DeadtimeNG5_ILL = 3.0e-6 38 38 Variable/G root:myGlobals:DeadtimeNG7_ILL = 3.0e-6 39 Variable/G root:myGlobals:DeadtimeNG3_ORNL = 3.4e-6 40 Variable/G root:myGlobals:DeadtimeNG5_ORNL = 0.6e-6 //as of 9 MAY 2002 41 Variable/G root:myGlobals:DeadtimeNG7_ORNL = 3.4e-6 39 Variable/G root:myGlobals:DeadtimeNG3_ORNL_VAX = 3.4e-6 //pre - 23-JUL-2009 used VAX 40 Variable/G root:myGlobals:DeadtimeNG3_ORNL_ICE = 1.5e-6 //post - 23-JUL-2009 used ICE 41 Variable/G root:myGlobals:DeadtimeNG5_ORNL = 0.6e-6 //as of 9 MAY 2002 42 Variable/G root:myGlobals:DeadtimeNG7_ORNL_VAX = 3.4e-6 //pre 25-FEB-2010 used VAX 43 Variable/G root:myGlobals:DeadtimeNG7_ORNL_ICE = 2.3e-6 //post 25-FEB-2010 used ICE 42 44 Variable/G root:myGlobals:DeadtimeDefault = 3.4e-6 43 45 … … 354 356 // fileStr is passed as TextRead[3] 355 357 // detStr is passed as TextRead[9] 356 // 357 Function DetectorDeadtime(fileStr,detStr) 358 String fileStr,detStr 358 // dateAndTimeStr is passed as TextRead[1] 359 // --- if no date/time string is passed, ICE values are the default 360 // 361 // Due to the switch from VAX -> ICE, there were some hardware changes that led to 362 // a change in the effective detector dead time. The dead time was re-measured by J. Barker 363 // as follows: 364 // Instrument Date measured deadtime constant 365 // NG3 DECEMBER 2009 1.5 microseconds 366 // NG7 APRIL2010 2.3 microseconds 367 // 368 // The day of the switch to ICE on NG7 was 25-FEB-2010 (per J. Krzywon) 369 // The day of the switch to ICE on NG3 was 23-JUL-2009 (per C. Gagnon) 370 // 371 // so any data after these dates is to use the new dead time constant. The switch is made on the 372 // data collection date. 373 // 374 // 375 Function DetectorDeadtime(fileStr,detStr,[dateAndTimeStr]) 376 String fileStr,detStr,dateAndTimeStr 359 377 360 378 Variable deadtime … … 364 382 NVAR DeadtimeNG5_ILL = root:myGlobals:DeadtimeNG5_ILL 365 383 NVAR DeadtimeNG7_ILL = root:myGlobals:DeadtimeNG7_ILL 366 NVAR DeadtimeNG3_ORNL = root:myGlobals:DeadtimeNG3_ORNL 384 NVAR DeadtimeNG3_ORNL_VAX = root:myGlobals:DeadtimeNG3_ORNL_VAX 385 NVAR DeadtimeNG3_ORNL_ICE = root:myGlobals:DeadtimeNG3_ORNL_ICE 367 386 NVAR DeadtimeNG5_ORNL = root:myGlobals:DeadtimeNG5_ORNL 368 NVAR DeadtimeNG7_ORNL = root:myGlobals:DeadtimeNG7_ORNL 387 NVAR DeadtimeNG7_ORNL_VAX = root:myGlobals:DeadtimeNG7_ORNL_VAX 388 NVAR DeadtimeNG7_ORNL_ICE = root:myGlobals:DeadtimeNG7_ORNL_ICE 369 389 NVAR DeadtimeDefault = root:myGlobals:DeadtimeDefault 390 391 // if no date string is passed, default to the ICE values 392 if(strlen(dateAndTimeStr)==0) 393 dateAndTimeStr = "01-JAN-2011" //dummy date to force to ICE values 394 endif 395 396 397 Variable NG3_to_ICE = ConvertVAXDay2secs("23-JUL-2009") 398 Variable NG7_to_ICE = ConvertVAXDay2secs("25-FEB-2010") 399 Variable fileTime = ConvertVAXDay2secs(dateAndTimeStr) 400 370 401 371 402 strswitch(instr) … … 374 405 deadtime= DeadtimeNG3_ILL 375 406 else 376 deadtime = DeadtimeNG3_ORNL //detector is ordella-type 407 if(fileTime > NG3_to_ICE) 408 deadtime = DeadtimeNG3_ORNL_ICE //detector is ordella-type, using ICE hardware 409 else 410 deadtime = DeadtimeNG3_ORNL_VAX //detector is ordella-type 411 endif 377 412 endif 378 413 break … … 388 423 deadtime= DeadtimeNG7_ILL 389 424 else 390 deadtime = DeadtimeNG7_ORNL //detector is ordella-type 425 if(fileTime > NG7_to_ICE) 426 deadtime = DeadtimeNG7_ORNL_ICE //detector is ordella-type, using ICE hardware 427 else 428 deadtime = DeadtimeNG7_ORNL_VAX //detector is ordella-type 429 endif 391 430 endif 392 431 break … … 398 437 return(deadtime) 399 438 End 439 440 // converts ONLY DD-MON-YYYY portion of the data collection time 441 // to a number of seconds from midnight on 1/1/1904, as Igor likes to do 442 // 443 // dateAndTime is the full string of "dd-mon-yyyy hh:mm:ss" as returned by the function 444 // getFileCreationDate(file) 445 // 446 Function ConvertVAXDay2secs(dateAndTime) 447 string dateAndTime 448 449 Variable day,yr,mon,time_secs 450 string monStr 451 452 sscanf dateandtime,"%d-%3s-%4d",day,monStr,yr 453 mon = monStr2num(monStr) 454 // print yr,mon,day 455 time_secs = date2secs(yr,mon,day) 456 457 return(time_secs) 458 end 459 460 // takes a month string and returns the corresponding number 461 // 462 Function monStr2num(monStr) 463 String monStr 464 465 String list=";JAN;FEB;MAR;APR;MAY;JUN;JUL;AUG;SEP;OCT;NOV;DEC;" 466 return(WhichListItem(monStr, list ,";")) 467 end 468 400 469 401 470 //make a three character string of the run number
Note: See TracChangeset
for help on using the changeset viewer.