- Timestamp:
- Jun 23, 2016 4:26:43 PM (7 years ago)
- Location:
- sans/Dev/trunk/NCNR_User_Procedures/Reduction
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/NCNR_Utils.ipf
r945 r1003 36 36 37 37 Variable/G root:myGlobals:PixelResDefault = 0.5 38 38 39 //Very old - ILL/Cerca-style detectors 39 40 Variable/G root:myGlobals:DeadtimeNG3_ILL = 3.0e-6 //deadtime in seconds 40 41 Variable/G root:myGlobals:DeadtimeNG5_ILL = 3.0e-6 41 42 Variable/G root:myGlobals:DeadtimeNG7_ILL = 3.0e-6 42 43 Variable/G root:myGlobals:DeadtimeNGB_ILL = 4.0e-6 // fictional 44 // retired NG5 (NG1) 8m-sans instrument 45 Variable/G root:myGlobals:DeadtimeNG5_ORNL = 0.6e-6 //as of 9 MAY 2002 46 47 // NG3 SANS, moved to NGB (currently named as CGB) 43 48 Variable/G root:myGlobals:DeadtimeNG3_ORNL_VAX = 3.4e-6 //pre - 23-JUL-2009 used VAX 44 49 Variable/G root:myGlobals:DeadtimeNG3_ORNL_ICE = 1.5e-6 //post - 23-JUL-2009 used ICE 45 Variable/G root:myGlobals:DeadtimeNG5_ORNL = 0.6e-6 //as of 9 MAY 2002 50 Variable/G root:myGlobals:DeadtimeNG3_ORNL_NISTO = 1.0e-6 //post - 22-JUN-2016 using new NISTO 51 52 // NG7 SANS 46 53 Variable/G root:myGlobals:DeadtimeNG7_ORNL_VAX = 3.4e-6 //pre 25-FEB-2010 used VAX 47 54 Variable/G root:myGlobals:DeadtimeNG7_ORNL_ICE = 2.3e-6 //post 25-FEB-2010 used ICE 55 Variable/G root:myGlobals:DeadtimeNG7_ORNL_NISTO = 1.0e-6 //--post 22-JUN-2016 using new NISTO 56 57 // 10m sans @ NGB 48 58 Variable/G root:myGlobals:DeadtimeNGB_ORNL_ICE = 4.0e-6 //per JGB 16-JAN-2013, best value we have for the oscillating data 59 Variable/G root:myGlobals:DeadtimeNGB_ORNL_NISTO = 1.0e-6 // (not a measured value!) per JGB June 2016, using NISTO, match value to NG7 and CGB 30m as of 27-APR-2016 60 49 61 50 62 // Variable/G root:myGlobals:DeadtimeCGB_ORNL_ICE = 1.5e-6 // fiction … … 484 496 // 485 497 // 498 // 486 499 // The day of the switch to ICE on NG7 was 25-FEB-2010 (per J. Krzywon) 487 500 // The day of the switch to ICE on NG3 was 23-JUL-2009 (per C. Gagnon) … … 495 508 // MAY 2014 -- if the beam is CGB (now that the NG3 SANS has been moved to NGB), the logic 496 509 // drops to select the values from NG3, since nothing has changed. When it does, I'll add in specifics for CGB 510 // 511 // 512 // *** JUNE 2016 *** 513 // instruments are now using new version of NISTO (all using the same hardware now) 514 // ** the day of the switch is 22-JUN-2016 ** 515 // CGB 30m (former NG3) 0.96 us == 1.0 us 516 // NG7 SANS (measured as 1.02 us == 1.0 us) 517 // 10m, yet unmeasured (use 1.0 us) starting 27-APR-2016 518 // ************** 519 // 497 520 // 498 521 Function DetectorDeadtime(fileStr,detStr,[dateAndTimeStr,dtime]) … … 507 530 NVAR DeadtimeNG7_ILL = root:myGlobals:DeadtimeNG7_ILL 508 531 NVAR DeadtimeNGB_ILL = root:myGlobals:DeadtimeNGB_ILL 532 509 533 NVAR DeadtimeNG3_ORNL_VAX = root:myGlobals:DeadtimeNG3_ORNL_VAX 510 534 NVAR DeadtimeNG3_ORNL_ICE = root:myGlobals:DeadtimeNG3_ORNL_ICE 535 NVAR DeadtimeNG3_ORNL_NISTO = root:myGlobals:DeadtimeNG3_ORNL_NISTO 511 536 // NVAR DeadtimeCGB_ORNL_ICE = root:myGlobals:DeadtimeCGB_ORNL_ICE 512 537 NVAR DeadtimeNG5_ORNL = root:myGlobals:DeadtimeNG5_ORNL 513 538 NVAR DeadtimeNG7_ORNL_VAX = root:myGlobals:DeadtimeNG7_ORNL_VAX 514 539 NVAR DeadtimeNG7_ORNL_ICE = root:myGlobals:DeadtimeNG7_ORNL_ICE 540 NVAR DeadtimeNG7_ORNL_NISTO = root:myGlobals:DeadtimeNG7_ORNL_NISTO 515 541 NVAR DeadtimeNGB_ORNL_ICE = root:myGlobals:DeadtimeNGB_ORNL_ICE 542 NVAR DeadtimeNGB_ORNL_NISTO = root:myGlobals:DeadtimeNGB_ORNL_NISTO 516 543 NVAR DeadtimeDefault = root:myGlobals:DeadtimeDefault 517 544 … … 528 555 endif 529 556 530 557 // the switch from VAX to ICE 531 558 Variable NG3_to_ICE = ConvertVAXDay2secs("23-JUL-2009") 532 559 Variable NG7_to_ICE = ConvertVAXDay2secs("25-FEB-2010") 560 561 // dates for the new NISTO hardware 562 Variable NG3_to_NISTO = ConvertVAXDay2secs("22-JUN-2016") 563 Variable NGB_to_NISTO = ConvertVAXDay2secs("22-JUN-2016") 564 Variable NG7_to_NISTO = ConvertVAXDay2secs("27-APR-2016") //one cycle earlier on 10m 565 566 533 567 Variable fileTime = ConvertVAXDay2secs(dateAndTimeStr) 534 568 … … 540 574 deadtime= DeadtimeNG3_ILL 541 575 else 542 if(fileTime > NG3_to_ICE) 576 if(fileTime > NG3_to_NISTO) 577 deadtime = DeadtimeNG3_ORNL_NISTO //detector is ordella-type, using NISTO hardware 578 endif 579 if(fileTime > NG3_to_ICE && fileTime <= NG3_to_NISTO) 543 580 deadtime = DeadtimeNG3_ORNL_ICE //detector is ordella-type, using ICE hardware 544 else 545 deadtime = DeadtimeNG3_ORNL_VAX //detector is ordella-type 581 endif 582 if(fileTime <= NG3_to_ICE) 583 deadtime = DeadtimeNG3_ORNL_VAX //detector is ordella-type, VAX hardware 546 584 endif 547 585 endif … … 558 596 deadtime= DeadtimeNG7_ILL 559 597 else 560 if(fileTime > NG7_to_ICE) 598 if(fileTime > NG7_to_NISTO) 599 deadtime = DeadtimeNG7_ORNL_NISTO //detector is ordella-type, using NISTO hardware 600 endif 601 if(fileTime > NG7_to_ICE && fileTime <= NG7_to_NISTO) 561 602 deadtime = DeadtimeNG7_ORNL_ICE //detector is ordella-type, using ICE hardware 562 else563 deadtime = DeadtimeNG7_ORNL_VAX //detector is ordella-type564 603 endif 604 if(fileTime <= NG7_to_ICE) 605 deadtime = DeadtimeNG7_ORNL_VAX //detector is ordella-type, VAX hardware 606 endif 607 565 608 endif 566 609 break … … 570 613 deadtime= DeadtimeNGB_ILL 571 614 else 572 deadtime = DeadtimeNGB_ORNL_ICE //detector is ordella-type, using ICE hardware 615 if(fileTime > NGB_to_NISTO) 616 deadtime = DeadtimeNGB_ORNL_NISTO //detector is ordella-type, using NISTO hardware 617 else 618 deadtime = DeadtimeNGB_ORNL_ICE //detector is ordella-type, using ICE hardware 619 endif 573 620 endif 574 621 // Print "Using fictional values for NGB dead time" -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_FileCatalog.ipf
r1002 r1003 153 153 // But typically, I'd like to see that the disk version really did get updated... 154 154 // 155 V_CleanOutRawVSANS()156 157 155 // V_CleanOutRawVSANS() 156 // This will display a progress bar 157 V_CleanupData_w_Progress(0,1) 158 158 159 159 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Initialize.ipf
r1002 r1003 342 342 // TODO -- decide if this is really necessary 343 343 // 344 V_CleanOutRawVSANS() 344 // V_CleanOutRawVSANS() 345 // present a progress window 346 V_CleanupData_w_Progress(0,1) 345 347 Printf "Hook cleaned out RawVSANS, experiment saved\r" 346 348 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_PatchFiles.ipf
r1002 r1003 220 220 NVAR gRadioVal= root:Packages:NIST:VSANS:Globals:Patch:gRadioVal 221 221 222 223 224 222 // run number list 225 223 if(gRadioVal == 1) 226 // list = ParseRunNumberList(match) //slow, file access every time 227 // list = ReplaceString(",", list, ";") 228 // newList = list 229 230 // cut this 0ct 2014 -- the ListMatch at the bottom returns bad results when certain conditions are met: 231 // -- for example OCT14nnn runs will return all of the OCT141nn runs if you try to match run 141 232 // 233 // 234 // list = ExpandNumRanges(match) //now simply comma delimited 235 // num=ItemsInList(list,",") 236 // for(ii=0;ii<num;ii+=1) 237 // item = StringFromList(ii,list,",") 238 // val=str2num(item) 239 // //make a three character string of the run number 240 // if(val<10) 241 // numStr = "00"+num2str(val) 242 // else 243 // if(val<100) 244 // numStr = "0"+num2str(val) 245 // else 246 // numStr = num2str(val) 247 // Endif 248 // Endif 249 // runList += ListMatch(newList,"*"+numStr+"*",";") 250 // 251 // endfor 252 253 // oct 2014 -- try this way: 254 // TODO -- replace call 255 // list = ExpandNumRanges(match) //now simply comma delimited 224 225 list = V_ExpandNumRanges(match) //now simply comma delimited 256 226 num=ItemsInList(list,",") 257 227 for(ii=0;ii<num;ii+=1) … … 259 229 val=str2num(item) 260 230 261 // TODO -- replace call 262 // runList += GetFileNameFromPathNoSemi(FindFileFromRunNumber(val)) + ";" 263 231 runList += V_GetFileNameFromPathNoSemi(V_FindFileFromRunNumber(val)) + ";" 264 232 endfor 265 233 newlist = runList … … 299 267 item=StringFromList(ii, newList , ";") 300 268 fname = path + item 301 // TODO -- replace call 302 // sdd = getSDD(fname)269 // TODO -- replace call -- this is hard-wired for "FL" 270 sdd = V_getDet_ActualDistance(fname,"FL") 303 271 if(pos == -1) 304 272 //no wildcard … … 690 658 Proc V_Patch_Panel() 691 659 PauseUpdate; Silent 1 // building window... 692 NewPanel /W=(519,85,950,608)/K=1 as "Patch Raw VSANS Data Files" 693 // NewPanel /W=(519,85,950,608) as "Patch Raw SANS Data Files" 660 NewPanel /W=(519,85,950,608)/K=2 as "Patch Raw VSANS Data Files" 694 661 DoWindow/C V_Patch_Panel 695 662 ModifyPanel cbRGB=(1,39321,19939) … … 992 959 993 960 //simple action for button to close the panel 961 // 962 // cleans out the RawVSANS folder on closing 963 // 994 964 Function DoneButtonProc(ctrlName) : ButtonControl 995 965 String ctrlName 996 966 997 967 DoWindow/K V_Patch_Panel 998 968 969 // V_CleanOutRawVSANS() 970 // present a progress window 971 V_CleanupData_w_Progress(0,1) 972 973 return(0) 999 974 End 1000 975 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Utilities_General.ipf
r1002 r1003 110 110 111 111 // TODO: 112 // -- this still does not quite work. If there are no sub folders present in the RawVSANS folder112 // x- this still does not quite work. If there are no sub folders present in the RawVSANS folder 113 113 // it still thinks there are (1) item there. 114 114 // -- if I replace the semicolon with a comma, it thinks there are two folders present and appears 115 115 // to delete the RawVSANS folder itself! seems very dangerous...this is because DataFolderDir returns 116 116 // a comma delimited list, but with a semicolon and \r at the end. need to remove these... 117 // 118 // NOTE -- use V_CleanupData_w_Progress(0,1) to get a progress bar - since this will take more than 119 // a few seconds to complete, especially if a file catalog was done, or a "batch" patching, etc. 120 // 117 121 Function V_CleanOutRawVSANS() 118 122 … … 151 155 return(0) 152 156 End 157 158 // 159 // examples straight from Wavemetrics help file topic "Progress Windows" 160 // Try simpletest(0,0) and simpletest(1,0), simpletest(0,1) and simpletest(1,1) 161 // 162 // 163 // look for simpletest() function in Wavemetrics help file topic "Progress Windows" 164 // this is a modified version. 165 // 166 // call with (1,1) to get the candystripe bar 167 // call with (0,1) to the the "countdown" bar as they are killed 168 // 169 Function V_CleanupData_w_Progress(indefinite, useIgorDraw) 170 Variable indefinite 171 Variable useIgorDraw // True to use Igor's own draw method rather than native 172 173 Variable num 174 175 // is there anything there to be killed? 176 num = V_CleanOutOneRawVSANS() 177 if(num <= 0) 178 return(0) 179 endif 180 181 // there are some folders to kill, so proceed 182 183 NewPanel /N=ProgressPanel /W=(285,111,739,193) 184 ValDisplay valdisp0,pos={18,32},size={342,18},limits={0,num,0},barmisc={0,0} 185 ValDisplay valdisp0,value= _NUM:0 186 DrawText 20,24,"Cleaning up old files... Please Wait..." 187 188 if( indefinite ) 189 ValDisplay valdisp0,mode= 4 // candy stripe 190 else 191 ValDisplay valdisp0,mode= 3 // bar with no fractional part 192 endif 193 if( useIgorDraw ) 194 ValDisplay valdisp0,highColor=(15000,45535,15000) //(0,65535,0) 195 endif 196 Button bStop,pos={375,32},size={50,20},title="Stop" 197 DoUpdate /W=ProgressPanel /E=1 // mark this as our progress window 198 199 do 200 num = V_CleanOutOneRawVSANS() 201 if( V_Flag == 2 || num == 0 || num == -1) // either "stop" or clean exit, or "done" exit from function 202 break 203 endif 204 205 ValDisplay valdisp0,value= _NUM:num,win=ProgressPanel 206 DoUpdate /W=ProgressPanel 207 while(1) 208 209 210 KillWindow ProgressPanel 211 return(0) 212 End 213 214 215 // TODO: 216 // x- this still does not quite work. If there are no sub folders present in the RawVSANS folder 217 // it still thinks there are (1) item there. 218 // -- if I replace the semicolon with a comma, it thinks there are two folders present and appears 219 // to delete the RawVSANS folder itself! seems very dangerous...this is because DataFolderDir returns 220 // a comma delimited list, but with a semicolon and \r at the end. need to remove these... 221 // 222 // -- for use with progress bar, kills only one folder, returns the new number of folders left 223 // -- if n(in) = n(out), nothing was able to be killed, so return "done" code 224 Function V_CleanOutOneRawVSANS() 225 226 SetDataFolder root:Packages:NIST:VSANS:RawVSANS: 227 228 // get a list of the data folders there 229 // kill them all if possible 230 String list,item 231 Variable numFolders,ii,pt,numIn 232 233 list = DataFolderDir(1) 234 // this has FOLDERS: at the beginning and is comma-delimited 235 list = list[8,strlen(list)] 236 pt = strsearch(list,";",inf,1) 237 list = list[0,pt-1] //remove the ";\r" from the end of the string 238 // print list 239 240 numFolders = ItemsInList(list , ",") 241 numIn = numFolders 242 // Print List 243 // print strlen(list) 244 245 if(numIn > 0) 246 item = StringFromList(0, list ,",") 247 // Print item 248 KillDataFolder/Z $(item) 249 endif 250 251 list = DataFolderDir(1) 252 list = list[8,strlen(list)] 253 pt = strsearch(list,";",inf,1) 254 list = list[0,pt-1] 255 numFolders = ItemsInList(list, ",") 256 257 if(numIn == numFolders) 258 Printf "%g RawVSANS folders could not be killed\r",numFolders 259 SetDataFolder root: 260 261 return (-1) 262 endif 263 264 SetDataFolder root: 265 return(numFolders) 266 End 267 268 269 270 153 271 154 272 //given a filename of a SANS data filename of the form
Note: See TracChangeset
for help on using the changeset viewer.