Changeset 788 for sans/Dev/trunk/NCNR_User_Procedures/Reduction
- Timestamp:
- Feb 10, 2011 1:29:02 PM (12 years ago)
- Location:
- sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/Marquee.ipf
r779 r788 581 581 // 582 582 // 583 // The histogram could potentially be done with the Igor ImageLineProfile operation 584 // but this seems to be just as efficient to do. 585 // 583 586 Function DoHistogramPair(xin,yin) 584 587 Variable xin,yin … … 597 600 AvgCountsY=0 598 601 599 //set position wave 602 //set position wave, in detector coordinates 600 603 positionX=p+pt1 601 604 positionY=p+pt1 602 //convert the position to Detector coordinates603 positionX += 1604 positionY += 1605 605 606 606 //do the vertical, then the horizontal … … 642 642 GetMarquee/K //to keep from drawing the marquee on the new histo graph 643 643 //draw the graph, or just bring to the front with the new data 644 Variable step = 30 644 645 DoWindow/F HistoPair 645 646 if(V_Flag != 1) 646 647 Draw_HistoPair() 647 endif 648 649 650 //could draw the width lines on the graph using the normal drawing routines 651 // -- but can't draw horizontal and vertical on at the same time. MasterAngleDraw clears 652 // between drawing. Also, the lines are drawn though the beam center of the data file as 653 // loaded. Not good for beamstop alignment, since the beam center may not have been measured yet 654 // SVAR tempStr = root:myGlobals:Drawing:gDrawInfoStr 655 // String newStr = ReplaceNumberByKey("WIDTH", tempStr, xWidth, "=", ";") 656 // newStr = ReplaceNumberByKey("PHI", newStr, 0, "=", ";") 657 // String/G root:myGlobals:Drawing:gDrawInfoStr = newStr 658 // //redraw the angles 659 // MasterAngleDraw() 648 else 649 SetAxis bottom (xin-step),(xin+step) 650 SetAxis bottomY (yin-step),(yin+step) 651 endif 660 652 661 653 // so use a pair of cursors instead (how do I easily get rid of them?) - a "done" button -
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 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/WorkFileUtils.ipf
r670 r788 136 136 137 137 //deadtime corrections to raw data 138 deadTime = DetectorDeadtime(raw_text[3],raw_text[9] ) //pick the correct detector deadtime138 deadTime = DetectorDeadtime(raw_text[3],raw_text[9],dateAndTimeStr=raw_text[1]) //pick the correct detector deadtime, switch on date too 139 139 itim = raw_ints[2] 140 140 cntrate = sum(raw_data,-inf,inf)/itim //080802 use data sum, rather than scaler value … … 308 308 itim = integersread[2] 309 309 cntrate = sum(data,-inf,inf)/itim //use sum of detector counts rather than scaler value 310 deadtime = DetectorDeadtime(textread[3],textread[9] ) //pick the correct deadtime310 deadtime = DetectorDeadtime(textread[3],textread[9],dateAndTimeStr=textRead[1]) //pick the correct deadtime 311 311 dscale = 1/(1-deadTime*cntrate) 312 312
Note: See TracChangeset
for help on using the changeset viewer.