- Timestamp:
- Feb 17, 2017 1:55:05 PM (6 years ago)
- Location:
- sans/Dev/trunk/NCNR_User_Procedures/Reduction
- Files:
-
- 4 added
- 4 deleted
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/SANS/Initialize.ipf
r871 r1023 115 115 116 116 if(cmpstr("Macintosh",IgorInfo(2)) == 0) 117 String/G root:Packages:NIST:gAngstStr = num2char(-127) 117 // String/G root:Packages:NIST:gAngstStr = num2char(-127) 118 String/G root:Packages:NIST:gAngstStr = num2char(197) 118 119 Variable/G root:myGlobals:gIsMac = 1 119 120 else -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_DetectorBinning_Utils.ipf
r1022 r1023 70 70 break 71 71 case "AgBeh": 72 tmpInten = VC_BroadPeak(1e- 9,3,20,100.0,0.1,3,0.1,qTot[p][q])72 tmpInten = VC_BroadPeak(1e-11,3,20,100.0,0.1,3,0.1,qTot[p][q]) 73 73 break 74 74 case "Vycor": … … 76 76 break 77 77 case "Empty Cell": 78 tmpInten = VC_EC_Empirical(2.2e- 8,3.346,0.0065,9.0,0.016,qTot[p][q])78 tmpInten = VC_EC_Empirical(2.2e-12,3.346,0.0065,9.0,0.016,qTot[p][q]) 79 79 break 80 80 case "Blocked Beam": 81 tmpInten = VC_BlockedBeam( 1,qTot[p][q])81 tmpInten = VC_BlockedBeam(0.01,qTot[p][q]) 82 82 break 83 83 case "Debye +": … … 86 86 break 87 87 case "AgBeh +": 88 tmpInten = VC_BroadPeak(1e- 9,3,20,100.0,0.1,3,0.1,qTot[p][q])88 tmpInten = VC_BroadPeak(1e-11,3,20,100.0,0.1,3,0.1,qTot[p][q]) 89 89 addEmpBgd = 1 90 90 break 91 91 case "Empty Cell +": 92 tmpInten = VC_EC_Empirical(2.2e- 8,3.346,0.0065,9.0,0.016,qTot[p][q])93 tmpInten += VC_BlockedBeam( 1,qTot[p][q])92 tmpInten = VC_EC_Empirical(2.2e-12,3.346,0.0065,9.0,0.016,qTot[p][q]) 93 tmpInten += VC_BlockedBeam(0.01,qTot[p][q]) 94 94 break 95 95 default: … … 99 99 100 100 if(addEmpBgd == 1) 101 tmpInten += VC_EC_Empirical(2.2e- 8,3.346,0.0065,9.0,0.016,qTot[p][q])102 tmpInten += VC_BlockedBeam( 1,qTot[p][q])101 tmpInten += VC_EC_Empirical(2.2e-12,3.346,0.0065,9.0,0.016,qTot[p][q]) 102 tmpInten += VC_BlockedBeam(0.01,qTot[p][q]) 103 103 endif 104 104 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_HDF5_VSANS_Utils.ipf
r1019 r1023 23 23 // since I need a "template" of the Nexus folder structure to start from and fill in 24 24 // 25 // It doesn't reproduce the NICE logs, but will leave a sp ece for them if25 // It doesn't reproduce the NICE logs, but will leave a space for them if 26 26 // it is read in and is part of the xref. 27 27 // … … 50 50 // 51 51 52 53 // Next... think of all of R/W access needed 54 // 55 // the simple read/write works... 56 // linear_data does not seem to need to be transposed at all 57 // 58 // -- this seems too easy. what am I doing wrong? Is something getting garbled when I 59 // write back any single values back to the file 60 // 61 // -- try a string value next 62 // -- then start to write the generic get/write functions 63 // 64 65 // 66 // do I ditch the RealsRead/IntegersRead/TextRead? It makes little sense now. 67 // maybe copy a "dataInfo" folder/subfolders. can't keep them all (bloat) 68 // but then what about multiple files added together? 69 // 70 52 // 53 54 // 55 // FEB 2017: All that is functional right now is the Setup/save of DIV and MASK files, and the attribute routines. 56 // 57 // The DIV and MASK routines are in their respective procedure files, and call save functions for the simplified 58 // Nexus structure (in V_HDF5_RW_Utils.ipf). 59 // 60 // The R/W with attributes is part of the HDF5 Gateway procedure from Pete Jemain, and needs to be kept and functional 61 // to be able to work with attributes - if needed. 62 // 71 63 Menu "VSANS" 72 SubMenu "Nexus File Testing"73 "Fill_Nexus_V_Template"74 "Save_Nexus_V_Template"75 "Load_Nexus_V_Template"76 "-"77 "IgorOnly_Setup_VSANS_Struct"78 "IgorOnly_Save_VSANS_Nexus"79 "IgorOnly_Setup_SANS_Struct"80 "IgorOnly_Save_SANS_Struct"64 SubMenu "Nexus File RW" 65 // "Fill_Nexus_V_Template" 66 // "Save_Nexus_V_Template" 67 // "Load_Nexus_V_Template" 68 // "-" 69 // "IgorOnly_Setup_VSANS_Struct" 70 // "IgorOnly_Save_VSANS_Nexus" 71 // "IgorOnly_Setup_SANS_Struct" 72 // "IgorOnly_Save_SANS_Struct" 81 73 "Setup_VSANS_DIV_Struct" 82 74 "Save_VSANS_DIV_Nexus" … … 93 85 94 86 87 88 89 90 91 92 93 94 95 96 97 98 99 ///////////////////////////// 100 101 102 95 103 Proc Load_Nexus_V_Template() 96 104 H_HDF5Gate_Read_Raw("") … … 114 122 115 123 116 117 118 119 120 121 122 123 124 125 126 /////////////////////////////127 128 124 /////////////below is largely depricated, ugly dance to be able to "fake" a file from Igor 129 125 // which was not complete anyways. 126 130 127 131 128 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VSANS_Includes.ipf
r1022 r1023 36 36 37 37 #include "HDF5gateway_NCNR" 38 #include " Nexus_SANS_Write"39 #include " Nexus_VSANS_Write"38 #include "Vx_Nexus_SANS_Write" 39 #include "Vx_Nexus_VSANS_Write" 40 40 //#include "V_ReadWrite_HDF5" //AUG2015 beginning of read/write, renamed Nov2015 41 #include "V _NexusFromIgor" //AUG2015 - depricated, but keep for now41 #include "Vx_NexusFromIgor" //AUG2015 - depricated, but keep for now 42 42 43 43 // for possible peak fitting 44 44 #include "V_BroadPeak_Pix_2D" 45 #include "V C_BeamCenter"45 #include "V_BeamCenter" 46 46 47 47 // for fitting data to generate tube corrections -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Correct.ipf
r1021 r1023 267 267 // was freshly loaded. added final copy of cor result to cor:data and cor:linear_data 268 268 // 269 // TODO -- verify the operation 270 // -- check that all "get" reads are returning proper values (+units) 271 // 269 272 Function V_CorrectMode_1() 270 273 … … 383 386 cor1 *= noadd_bgd*noadd_emp //zero out the array mismatch values 384 387 388 cor_data = cor1 //the final result 389 385 390 // do the error propagation piecewise 386 391 Duplicate/O sam_err, tmp_a, tmp_b, tmp_c, tmp_d,c_val,d_val … … 498 503 cor1 *= noadd_bgd //zeros out regions where arrays do not overlap, one otherwise 499 504 505 cor_data = cor1 //the final result 506 500 507 // do the error propagation piecewise 501 508 Duplicate/O sam_err, tmp_a, tmp_b … … 610 617 cor1 = fsam*sam_data/sam_AttenFactor - femp*(tsam/temp)*emp_temp/emp_AttenFactor 611 618 cor1 *= noadd_emp //zeros out regions where arrays do not overlap, one otherwise 619 620 cor_data = cor1 //the final result 612 621 613 622 // do the error propagation piecewise … … 808 817 cor1 -= drk_temp/sam_attenFactor 809 818 cor1 *= noadd_bgd*noadd_emp //zero out the array mismatch values 819 820 cor_data = cor1 //the final result 810 821 811 822 // do the error propagation piecewise … … 941 952 cor1 += -1*(fbgd*bgd_temp/bgd_attenFactor - drk_temp) - drk_temp/sam_attenFactor 942 953 cor1 *= noadd_bgd //zeros out regions where arrays do not overlap, one otherwise 954 955 cor_data = cor1 //the final result 943 956 944 957 // do the error propagation piecewise … … 1072 1085 cor1 += drk_temp - drk_temp/sam_attenFactor 1073 1086 cor1 *= noadd_emp //zeros out regions where arrays do not overlap, one otherwise 1087 1088 cor_data = cor1 //the final result 1074 1089 1075 1090 // do the error propagation piecewise … … 1163 1178 //correct sam for attenuators, and do the same to drk, since it was scaled to sam count time 1164 1179 cor1 = fsam*sam_data/sam_AttenFactor - drk_temp/sam_attenFactor 1180 1181 cor_data = cor1 //the final result 1165 1182 1166 1183 // do the error propagation piecewise -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_DataPlotting.ipf
r1022 r1023 21 21 // -- VERIFY accuracy 22 22 // -- decide what to add to the control bar 23 // -- at the very least, add a log/lin toggle for the axes 24 // 25 // -- document, document, document 23 26 // 24 27 // -- see Middle_IQ_Graph() and similar for how VCALC does this plot … … 30 33 31 34 32 DoWindow V_1D_Data35 DoWindow/F V_1D_Data 33 36 if(V_flag==0) 34 37 … … 86 89 String ctrlName 87 90 88 // DoWindow/F V_1D_Data89 91 SetAxis/A 90 92 End … … 194 196 195 197 if(binType==2) 198 // clear EVERYTHING 196 199 ClearAllIQIfDisplayed("MLRTB") 200 ClearAllIQIfDisplayed("MLR") 201 ClearAllIQIfDisplayed("MTB") //this returns to root: 197 202 ClearAllIQIfDisplayed("MT") 198 203 ClearAllIQIfDisplayed("ML") 199 204 ClearAllIQIfDisplayed("MR") 200 ClearAllIQIfDisplayed("MB") 205 ClearAllIQIfDisplayed("MB") 206 207 // ClearAllIQIfDisplayed("MLRTB") 208 // ClearAllIQIfDisplayed("MT") 209 // ClearAllIQIfDisplayed("ML") 210 // ClearAllIQIfDisplayed("MR") 211 // ClearAllIQIfDisplayed("MB") 201 212 202 213 … … 222 233 223 234 if(binType==3) 235 // clear EVERYTHING 236 ClearAllIQIfDisplayed("MLRTB") 224 237 ClearAllIQIfDisplayed("MLR") 225 ClearAllIQIfDisplayed("MTB") 238 ClearAllIQIfDisplayed("MTB") //this returns to root: 226 239 ClearAllIQIfDisplayed("MT") 227 240 ClearAllIQIfDisplayed("ML") 228 241 ClearAllIQIfDisplayed("MR") 229 ClearAllIQIfDisplayed("MB") 242 ClearAllIQIfDisplayed("MB") 243 244 // ClearAllIQIfDisplayed("MLR") 245 // ClearAllIQIfDisplayed("MTB") 246 // ClearAllIQIfDisplayed("MT") 247 // ClearAllIQIfDisplayed("ML") 248 // ClearAllIQIfDisplayed("MR") 249 // ClearAllIQIfDisplayed("MB") 230 250 231 251 SetDataFolder $("root:Packages:NIST:VSANS:"+type) … … 248 268 249 269 if(binType==4) // slit aperture binning - MT, ML, MR, MB are averaged 270 // clear EVERYTHING 250 271 ClearAllIQIfDisplayed("MLRTB") 251 272 ClearAllIQIfDisplayed("MLR") 252 ClearAllIQIfDisplayed("MTB") 273 ClearAllIQIfDisplayed("MTB") //this returns to root: 274 ClearAllIQIfDisplayed("MT") 275 ClearAllIQIfDisplayed("ML") 276 ClearAllIQIfDisplayed("MR") 277 ClearAllIQIfDisplayed("MB") 278 279 280 // ClearAllIQIfDisplayed("MLRTB") 281 // ClearAllIQIfDisplayed("MLR") 282 // ClearAllIQIfDisplayed("MTB") 253 283 254 284 SetDataFolder $("root:Packages:NIST:VSANS:"+type) … … 337 367 338 368 if(binType==2) 369 // clear EVERYTHING 339 370 ClearAllIQIfDisplayed("FLRTB") 371 372 ClearAllIQIfDisplayed("FLR") 373 ClearAllIQIfDisplayed("FTB") 374 375 ClearAllIQIfDisplayed("FT") 376 ClearAllIQIfDisplayed("FL") 377 ClearAllIQIfDisplayed("FR") 378 ClearAllIQIfDisplayed("FB") 379 // ClearAllIQIfDisplayed("FLRTB") 380 // ClearAllIQIfDisplayed("FT") 381 // ClearAllIQIfDisplayed("FL") 382 // ClearAllIQIfDisplayed("FR") 383 // ClearAllIQIfDisplayed("FB") 384 385 SetDataFolder $("root:Packages:NIST:VSANS:"+type) 386 CheckDisplayed/W=V_1D_Data iBin_qxqy_FLR 387 388 if(V_flag==0) 389 AppendtoGraph/W=V_1D_Data iBin_qxqy_FLR vs qBin_qxqy_FLR 390 AppendToGraph/W=V_1D_Data iBin_qxqy_FTB vs qBin_qxqy_FTB 391 ModifyGraph/W=V_1D_Data mode=4 392 ModifyGraph/W=V_1D_Data marker=19 393 ModifyGraph/W=V_1D_Data rgb(iBin_qxqy_FLR)=(39321,26208,1),rgb(iBin_qxqy_FTB)=(2,39321,1) 394 ModifyGraph/W=V_1D_Data msize=2 395 ModifyGraph/W=V_1D_Data muloffset(iBin_qxqy_FLR)={0,2} 396 ModifyGraph/W=V_1D_Data grid=1 397 ModifyGraph/W=V_1D_Data log=1 398 ModifyGraph/W=V_1D_Data mirror=2 399 Label/W=V_1D_Data left "Intensity (1/cm)" 400 Label/W=V_1D_Data bottom "Q (1/A)" 401 endif 402 403 endif 404 405 if(binType==3) 406 // clear EVERYTHING 407 ClearAllIQIfDisplayed("FLRTB") 408 409 ClearAllIQIfDisplayed("FLR") 410 ClearAllIQIfDisplayed("FTB") 411 340 412 ClearAllIQIfDisplayed("FT") 341 413 ClearAllIQIfDisplayed("FL") 342 414 ClearAllIQIfDisplayed("FR") 343 415 ClearAllIQIfDisplayed("FB") 344 345 SetDataFolder $("root:Packages:NIST:VSANS:"+type) 346 CheckDisplayed/W=V_1D_Data iBin_qxqy_FLR 347 348 if(V_flag==0) 349 AppendtoGraph/W=V_1D_Data iBin_qxqy_FLR vs qBin_qxqy_FLR 350 AppendToGraph/W=V_1D_Data iBin_qxqy_FTB vs qBin_qxqy_FTB 351 ModifyGraph/W=V_1D_Data mode=4 352 ModifyGraph/W=V_1D_Data marker=19 353 ModifyGraph/W=V_1D_Data rgb(iBin_qxqy_FLR)=(39321,26208,1),rgb(iBin_qxqy_FTB)=(2,39321,1) 354 ModifyGraph/W=V_1D_Data msize=2 355 ModifyGraph/W=V_1D_Data muloffset(iBin_qxqy_FLR)={0,2} 416 417 // ClearAllIQIfDisplayed("FLR") 418 // ClearAllIQIfDisplayed("FTB") 419 // ClearAllIQIfDisplayed("FT") 420 // ClearAllIQIfDisplayed("FL") 421 // ClearAllIQIfDisplayed("FR") 422 // ClearAllIQIfDisplayed("FB") 423 424 SetDataFolder $("root:Packages:NIST:VSANS:"+type) 425 CheckDisplayed/W=V_1D_Data iBin_qxqy_FLRTB 426 427 if(V_flag==0) 428 AppendtoGraph/W=V_1D_Data iBin_qxqy_FLRTB vs qBin_qxqy_FLRTB 429 ModifyGraph/W=V_1D_Data mode=4 430 ModifyGraph/W=V_1D_Data marker=19 431 ModifyGraph/W=V_1D_Data rgb(iBin_qxqy_FLRTB)=(39321,26208,1) 432 ModifyGraph/W=V_1D_Data msize=2 356 433 ModifyGraph/W=V_1D_Data grid=1 357 434 ModifyGraph/W=V_1D_Data log=1 … … 362 439 363 440 endif 364 365 if(binType==3) 441 442 if(binType==4) // slit aperture binning - MT, ML, MR, MB are averaged 443 // clear EVERYTHING 444 ClearAllIQIfDisplayed("FLRTB") 445 366 446 ClearAllIQIfDisplayed("FLR") 367 ClearAllIQIfDisplayed("FTB") 447 ClearAllIQIfDisplayed("FTB") 448 368 449 ClearAllIQIfDisplayed("FT") 369 450 ClearAllIQIfDisplayed("FL") … … 371 452 ClearAllIQIfDisplayed("FB") 372 453 373 SetDataFolder $("root:Packages:NIST:VSANS:"+type) 374 CheckDisplayed/W=V_1D_Data iBin_qxqy_FLRTB 375 376 if(V_flag==0) 377 AppendtoGraph/W=V_1D_Data iBin_qxqy_FLRTB vs qBin_qxqy_FLRTB 378 ModifyGraph/W=V_1D_Data mode=4 379 ModifyGraph/W=V_1D_Data marker=19 380 ModifyGraph/W=V_1D_Data rgb(iBin_qxqy_FLRTB)=(39321,26208,1) 381 ModifyGraph/W=V_1D_Data msize=2 382 ModifyGraph/W=V_1D_Data grid=1 383 ModifyGraph/W=V_1D_Data log=1 384 ModifyGraph/W=V_1D_Data mirror=2 385 Label/W=V_1D_Data left "Intensity (1/cm)" 386 Label/W=V_1D_Data bottom "Q (1/A)" 387 endif 388 389 endif 390 391 if(binType==4) // slit aperture binning - MT, ML, MR, MB are averaged 392 ClearAllIQIfDisplayed("FLRTB") 393 ClearAllIQIfDisplayed("FLR") 394 ClearAllIQIfDisplayed("FTB") 454 455 // ClearAllIQIfDisplayed("FLRTB") 456 // ClearAllIQIfDisplayed("FLR") 457 // ClearAllIQIfDisplayed("FTB") 395 458 396 459 SetDataFolder $("root:Packages:NIST:VSANS:"+type) -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Detector_Isolate.ipf
r1022 r1023 26 26 // x- link the function to the Isolate button on the main panel 27 27 // 28 // x- when selecting the detector, set the x/y pixel sizes29 28 // -- figure out how to (better?) re-plot the images when swapping between LR and TB panels 30 29 // -- graphically show the beam center / radius of where it is in relation to the panel 30 // 31 // -- when selecting the detector, set the x/y pixel sizes -- un-do this? 32 // -- The xPixels, yPixels axis labels are not correct. The axes are scaled to the beam center, through 33 // a call to V_RestorePanels() when the raw data is loaded. The BeamCenter panel removes this wave scaling 34 // so that the data can be presented (and fit) purely as pixels. On the isolate panel, the scaling has not 35 // been removed and is confusing, especially on T/B panels. 36 // -- add a checkbox or button to remove/replace the wave scaling to the beam center. this is in a sense, 37 // a correction to toggle. 31 38 // 32 39 // -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_FileCatalog.ipf
r1018 r1023 14 14 // -- clean up and remove all of the references to other facilities, since they will not have VSANS modules 15 15 // -- add in more appropriate and some missing fields more useful to VSANS (intent, multiple beam centers, etc.) 16 // -- can I make the choice of columns customizable? There are "sets" of columns that are not used for 17 // some experiments (magnetic, rotation, temperature scans, etc.) but are necessary for others. 16 18 // 17 19 // TODO PRIORITY: … … 19 21 // files that are NOT RAW VSANS data (MASK and DIV, but these are HDF) 20 22 // x- WHY -- because if I PATCH anything, then re-run the catalog, the changes are NOT shown, since the 21 // reader will g to the LOCAL copy first! So maybe I need to clear the folder out before I start the23 // reader will go to the LOCAL copy first! So maybe I need to clear the folder out before I start the 22 24 // file catalog 23 // -- maybe it's a good thing to wipe out the RawVSANS folder before an Experiment SAVE (to save a LOT of25 // x- maybe it's a good thing to wipe out the RawVSANS folder before an Experiment SAVE (to save a LOT of 24 26 // space on disk and a potentially VERY long save 25 27 // x- see V_CleanOutRawVSANS() in V_Utilities_General for the start of this (this is now called in … … 33 35 // the "patched" values are written locally too, then maybe the update from disk is not needed. 34 36 // But typically, I'd like to see that the disk version really did get updated... 35 // 37 // -- make a background task to periodically "kill" a few of the files? maybe too dangerous. 38 39 40 36 41 37 42 // … … 69 74 70 75 Make/O/T/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Filenames" 71 Make/O/T/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Suffix"76 // Make/O/T/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Suffix" 72 77 Make/O/T/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Labels" 73 78 Make/O/T/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:DateAndTime" 74 Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:SDD"79 // Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:SDD" 75 80 Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Lambda" 76 81 Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:CntTime" … … 79 84 Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Transmission" 80 85 Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Thickness" 81 Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:XCenter"82 Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:YCenter"86 // Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:XCenter" 87 // Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:YCenter" 83 88 Make/O/T/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:nGuides" 84 89 Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:NumAttens" 85 Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:RunNumber"86 Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:IsTrans"90 // Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:RunNumber" 91 // Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:IsTrans" 87 92 Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:RotAngle" 88 93 Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Temperature" … … 90 95 Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:MCR" //added Mar 2008 91 96 Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Pos" //added Mar 2010 97 Make/O/T/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Intent" 98 Make/O/D/N=0 $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Group_ID" 92 99 93 100 94 101 WAVE/T Filenames = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Filenames" 95 WAVE/T Suffix = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Suffix"102 // WAVE/T Suffix = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Suffix" 96 103 WAVE/T Labels = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Labels" 97 104 WAVE/T DateAndTime = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:DateAndTime" 98 WAVE SDD = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:SDD"105 // WAVE SDD = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:SDD" 99 106 WAVE Lambda = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Lambda" 100 107 WAVE CntTime = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:CntTime" … … 103 110 WAVE Transmission = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Transmission" 104 111 WAVE Thickness = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Thickness" 105 WAVE XCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:XCenter"106 WAVE YCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:YCenter"112 // WAVE XCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:XCenter" 113 // WAVE YCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:YCenter" 107 114 108 115 WAVE/T nGuides = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:nGuides" 109 116 WAVE NumAttens = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:NumAttens" 110 WAVE RunNumber = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:RunNumber"111 WAVE IsTrans = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:IsTrans"117 // WAVE RunNumber = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:RunNumber" 118 // WAVE IsTrans = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:IsTrans" 112 119 WAVE RotAngle = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:RotAngle" 113 120 WAVE Temperature = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Temperature" … … 115 122 WAVE MCR = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:MCR" //added Mar 2008 116 123 WAVE Pos = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Pos" 124 WAVE/T Intent = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Intent" 125 WAVE Group_ID = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Group_ID" 117 126 118 127 119 128 If(V_Flag==0) 120 129 V_BuildTableWindow() 121 ModifyTable width(root:Packages:NIST:VSANS:CatVSHeaderInfo:SDD)=40130 // ModifyTable width(root:Packages:NIST:VSANS:CatVSHeaderInfo:SDD)=40 122 131 ModifyTable width(root:Packages:NIST:VSANS:CatVSHeaderInfo:Lambda)=40 123 132 ModifyTable width(root:Packages:NIST:VSANS:CatVSHeaderInfo:CntTime)=50 … … 126 135 ModifyTable width(root:Packages:NIST:VSANS:CatVSHeaderInfo:Transmission)=40 127 136 ModifyTable width(root:Packages:NIST:VSANS:CatVSHeaderInfo:Thickness)=40 128 ModifyTable width(root:Packages:NIST:VSANS:CatVSHeaderInfo:XCenter)=40129 ModifyTable width(root:Packages:NIST:VSANS:CatVSHeaderInfo:YCenter)=40137 // ModifyTable width(root:Packages:NIST:VSANS:CatVSHeaderInfo:XCenter)=40 138 // ModifyTable width(root:Packages:NIST:VSANS:CatVSHeaderInfo:YCenter)=40 130 139 ModifyTable width(root:Packages:NIST:VSANS:CatVSHeaderInfo:NumAttens)=30 131 140 ModifyTable width(root:Packages:NIST:VSANS:CatVSHeaderInfo:RotAngle)=50 … … 137 146 ModifyTable sigDigits(root:Packages:NIST:VSANS:CatVSHeaderInfo:Pos)=3 //to make the display look nice, given the floating point values from ICE 138 147 ModifyTable sigDigits(root:Packages:NIST:VSANS:CatVSHeaderInfo:Lambda)=3 //may not work in all situations, but an improvement 139 ModifyTable sigDigits(root:Packages:NIST:VSANS:CatVSHeaderInfo:SDD)=5148 // ModifyTable sigDigits(root:Packages:NIST:VSANS:CatVSHeaderInfo:SDD)=5 140 149 ModifyTable trailingZeros(root:Packages:NIST:VSANS:CatVSHeaderInfo:Temperature)=1 141 150 ModifyTable sigDigits(root:Packages:NIST:VSANS:CatVSHeaderInfo:Temperature)=4 142 151 143 152 ModifyTable width(Point)=0 //JUN04, remove point numbers - confuses users since point != run 153 154 // TODO: 155 // -- experimental hook with contextual menu 156 // 157 SetWindow kwTopWin hook=V_CatTableHook, hookevents=1 // mouse down events 158 144 159 Endif 145 160 … … 147 162 // NEW for VSANS 148 163 // clear out the folders in the RawVSANS folder, otherwise any changes/patches written to disk 149 // will not be read in, the "bad" local copy will be read in .164 // will not be read in, the "bad" local copy will be read in for any subsequent operations. 150 165 // TODO: 151 // -- this *may* be a very slow operation. Warn users. Give them a choice to keep local copies .If166 // -- this *may* be a very slow operation. Warn users. Give them a choice to keep local copies? If 152 167 // the "patched" values are written locally too, then maybe the update from disk is not needed. 153 168 // But typically, I'd like to see that the disk version really did get updated... … … 155 170 // V_CleanOutRawVSANS() 156 171 // This will display a progress bar 157 V_CleanupData_w_Progress(0,1) 158 172 Variable numToClean 173 numToClean = V_CleanupData_w_Progress(0,1) 174 175 Print "Cleaned # files = ",numToClean 176 Print "Cleanup time (s) = ",(ticks - t1)/60.15 177 Variable cleanupTime = (ticks - t1)/60.15 159 178 160 179 //get a list of all files in the folder, some will be junk version numbers that don't exist … … 212 231 KillWaves/Z notRAWlist 213 232 // 214 //Print "Total time (s) = ",(ticks - t1)/60.15215 // Print "Time per raw data file (s) = ",(ticks - t1)/60.15/(numItems-numpnts(notRawList))233 Print "Total time (s) = ",(ticks - t1)/60.15 234 Print "Time per raw data file (without cleanup time) (s) = ",( (ticks - t1)/60.15 - cleanupTime)/(numItems-numpnts(notRawList)) 216 235 // 217 236 // clean out again, so that the file SAVE is not slow due to the large experiment size … … 223 242 return(0) 224 243 End 244 245 // 246 // TODO: 247 // -- this is experimental... 248 // -- what else to add to the menu? 249 // -- add directly to WORK files? 250 // -- "set" as some special file type, intent, use? 251 // -- "check" the reduction protocol for completeness? 252 // 253 // x- seems to not "let go" of a selection (missing the mouse up?) 254 // (possibly) less annoying if I only handle mouseup and present a menu then. 255 // 256 Function V_CatTableHook(infoStr) 257 String infoStr 258 String event= StringByKey("EVENT",infoStr) 259 // print infoStr 260 // Print "EVENT= ",event 261 strswitch(event) 262 // case "mousedown": 263 case "mouseup": 264 // Variable xpix= NumberByKey("MOUSEX",infoStr) 265 // Variable ypix= NumberByKey("MOUSEY",infoStr) 266 // PopupContextualMenu/C=(xpix, ypix) "yes;no;maybe;" 267 PopupContextualMenu "Load RAW;no;maybe;" 268 strswitch(S_selection) 269 case "Load RAW": 270 // do something because "yes" was chosen 271 //print "yes" 272 WAVE/T Filenames = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Filenames" 273 GetSelection table,CatVSANSTable,1 274 // Print V_flag, V_startRow, V_startCol, V_endRow, V_endCol 275 Print "Loading " + FileNames[V_StartRow] 276 Variable err = V_LoadHDF5Data(FileNames[V_StartRow],"RAW") 277 if(!err) //directly from, and the same steps as DisplayMainButtonProc(ctrlName) 278 SVAR hdfDF = root:file_name // last file loaded, may not be the safest way to pass 279 String folder = StringFromList(0,hdfDF,".") 280 281 // this (in SANS) just passes directly to fRawWindowHook() 282 Execute "UpdateDisplayInformation(\"RAW\")" // plot the data in whatever folder type 283 284 FakeRestorePanelsButtonClick() //so the panels display correctly 285 286 // set the global to display ONLY if the load was called from here, not from the 287 // other routines that load data (to read in values) 288 SVAR gLast = root:Packages:NIST:VSANS:Globals:gLastLoadedFile 289 gLast = hdfDF 290 291 endif 292 break; 293 case "no": 294 print "no" 295 break; 296 case "maybe": 297 // do something because "maybe" was chosen 298 break; 299 endswitch 300 endswitch 301 return 0 302 End 303 304 225 305 226 306 //appends the list of files that are not RAW SANS data to the filename wave (1st column) … … 242 322 Function V_SortWaves() 243 323 Wave/T GFilenames = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Filenames" 244 Wave/T GSuffix = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Suffix"324 // Wave/T GSuffix = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Suffix" 245 325 Wave/T GLabels = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Labels" 246 326 Wave/T GDateTime = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:DateAndTime" 247 Wave GSDD = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:SDD"327 // Wave GSDD = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:SDD" 248 328 Wave GLambda = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Lambda" 249 329 Wave GCntTime = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:CntTime" … … 252 332 Wave GTransmission = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Transmission" 253 333 Wave GThickness = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Thickness" 254 Wave GXCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:XCenter"255 Wave GYCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:YCenter"334 // Wave GXCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:XCenter" 335 // Wave GYCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:YCenter" 256 336 257 337 Wave/T GNumGuides = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:nGuides" 258 338 Wave GNumAttens = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:NumAttens" 259 Wave GRunNumber = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:RunNumber"260 Wave GIsTrans = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:IsTrans"339 // Wave GRunNumber = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:RunNumber" 340 // Wave GIsTrans = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:IsTrans" 261 341 Wave GRot = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:RotAngle" 262 342 Wave GTemp = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Temperature" … … 264 344 Wave GMCR = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:MCR" //added Mar 2008 265 345 Wave GPos = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Pos" 266 267 268 // TODO -- the default sort is by SUFFIX, which does not exist for VSANS. So decide on a better key 269 Sort GSuffix, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens,GRunNumber,GIsTrans,GRot,GTemp,GField,GMCR,GPos,gNumGuides 346 Wave/T GIntent = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Intent" 347 Wave G_ID = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Group_ID" 348 349 350 // DONE 351 // x- the default sort is by SUFFIX, which does not exist for VSANS. So decide on a better key 352 // now, the sort is by FileName by default 353 // Sort GFilenames, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens,GRunNumber,GIsTrans,GRot,GTemp,GField,GMCR,GPos,gNumGuides 354 Sort GFilenames, GFilenames, GLabels, GDateTime, GIntent, G_ID, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GNumAttens,GRot,GTemp,GField,GMCR,GPos,gNumGuides 270 355 271 356 return(0) … … 278 363 Wave/T Labels = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Labels" 279 364 Wave/T DateAndTime = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:DateAndTime" 280 Wave SDD = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:SDD"365 // Wave SDD = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:SDD" 281 366 Wave Lambda = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Lambda" 282 367 Wave CntTime = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:CntTime" … … 285 370 Wave Transmission = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Transmission" 286 371 Wave Thickness = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Thickness" 287 Wave XCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:XCenter"288 Wave YCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:YCenter"372 // Wave XCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:XCenter" 373 // Wave YCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:YCenter" 289 374 290 375 Wave/T NumGuides = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:nGuides" … … 295 380 Wave MCR = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:MCR" //added Mar 2008 296 381 Wave Pos = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Pos" 297 382 Wave/T Intent = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Intent" 383 Wave Group_ID = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Group_ID" 298 384 299 385 // original order, magnetic at the end 300 386 // Edit Filenames, Labels, DateAndTime, SDD, Lambda, CntTime, TotCnts, CntRate, Transmission, Thickness, XCenter, YCenter, NumAttens, RotAngle, Temperature, Field, MCR as "Data File Catalog" 301 387 // with numGuides 302 Edit Filenames, Labels, DateAndTime, SDD, Lambda, numGuides, CntTime, TotCnts, CntRate, Transmission, Thickness, XCenter, YCenter, NumAttens, RotAngle, Temperature, Field, MCR, Pos as "Data File Catalog" 303 // alternate ordering, put the magnetic information first 304 // Edit Filenames, Labels, RotAngle, Temperature, Field, DateAndTime, SDD, Lambda, CntTime, TotCnts, CntRate, Transmission, Thickness, XCenter, YCenter, NumAttens as "Data File Catalog" 388 // Edit Filenames, Labels, DateAndTime, SDD, Lambda, numGuides, CntTime, TotCnts, CntRate, Transmission, Thickness, XCenter, YCenter, NumAttens, RotAngle, Temperature, Field, MCR, Pos as "Data File Catalog" 389 Edit Filenames, Labels, DateAndTime, Intent, Group_ID, Lambda, numGuides, CntTime, TotCnts, CntRate, Transmission, Thickness, NumAttens, RotAngle, Temperature, Field, MCR, Pos as "Data File Catalog" 305 390 306 391 … … 321 406 322 407 Wave/T GFilenames = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Filenames" 323 Wave/T GSuffix = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Suffix"408 // Wave/T GSuffix = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Suffix" 324 409 Wave/T GLabels = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Labels" 325 410 Wave/T GDateTime = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:DateAndTime" 326 411 327 Wave GSDD = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:SDD"412 // Wave GSDD = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:SDD" 328 413 Wave GLambda = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Lambda" 329 414 Wave GCntTime = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:CntTime" … … 332 417 Wave GTransmission = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Transmission" 333 418 Wave GThickness = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Thickness" 334 Wave GXCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:XCenter"335 Wave GYCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:YCenter"419 // Wave GXCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:XCenter" 420 // Wave GYCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:YCenter" 336 421 Wave/T GNumGuides = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:nGuides" 337 422 Wave GNumAttens = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:NumAttens" 338 Wave GRunNumber = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:RunNumber"339 Wave GIsTrans = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:IsTrans"423 // Wave GRunNumber = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:RunNumber" 424 // Wave GIsTrans = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:IsTrans" 340 425 Wave GRot = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:RotAngle" 341 426 Wave GTemp = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Temperature" … … 343 428 Wave GMCR = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:MCR" 344 429 Wave GPos = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Pos" 430 Wave/T GIntent = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Intent" 431 Wave G_ID = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Group_ID" 345 432 346 433 lastPoint = numpnts(GLambda) … … 350 437 GFilenames[lastPoint]=sname 351 438 352 //read the file alphanumeric suffix353 // TODO -- this does not exist for VSANS - so is there an equivalent, or delete?354 InsertPoints lastPoint,1,GSuffix355 GSuffix[lastPoint]="unknown"439 // //read the file alphanumeric suffix 440 // // TODO -- this does not exist for VSANS - so is there an equivalent, or delete? 441 // InsertPoints lastPoint,1,GSuffix 442 // GSuffix[lastPoint]="unknown" 356 443 357 444 //read the counting time (integer) … … 392 479 GThickness[lastPoint]=V_getSampleThickness(fname) 393 480 394 // TODO -- the x and y center have different meaning, since there are multiple panels395 // TODO -- remove the hard-wiring396 String detStr = "FL"397 //XCenter of beam on detector398 InsertPoints lastPoint,1,GXCenter399 GXCenter[lastPoint]=V_getDet_beam_center_x(fname,detStr)400 401 // TODO -- the x and y center have different meaning, since there are multiple panels402 //YCenter403 InsertPoints lastPoint,1,GYCenter404 GYCenter[lastPoint]=V_getDet_beam_center_y(fname,detStr)405 406 // TODO -- SDD has no real meaning - since there are multiple distances to report407 //SDD408 InsertPoints lastPoint,1,GSDD409 GSDD[lastPoint]=V_getDet_ActualDistance(fname,detStr)481 // // TODO -- the x and y center have different meaning, since there are multiple panels 482 // // TODO -- remove the hard-wiring 483 // String detStr = "FL" 484 // //XCenter of beam on detector 485 // InsertPoints lastPoint,1,GXCenter 486 // GXCenter[lastPoint]=V_getDet_beam_center_x(fname,detStr) 487 // 488 // // TODO -- the x and y center have different meaning, since there are multiple panels 489 // //YCenter 490 // InsertPoints lastPoint,1,GYCenter 491 // GYCenter[lastPoint]=V_getDet_beam_center_y(fname,detStr) 492 493 // // TODO -- SDD has no real meaning - since there are multiple distances to report 494 // //SDD 495 // InsertPoints lastPoint,1,GSDD 496 // GSDD[lastPoint]=V_getDet_ActualDistance(fname,detStr) 410 497 411 498 //wavelength … … 427 514 GField[lastPoint]=1000 428 515 429 //Beamstop position (not reported) 430 //strToExecute = GBLoadStr + "/S=368/U=1" + "\"" + fname + "\"" 431 432 //the run number (not displayed in the table, but carried along) 433 InsertPoints lastPoint,1,GRunNumber 434 GRunNumber[lastPoint] = V_GetRunNumFromFile(sname) 435 436 // TODO -- the isTransFile utility has not yet been written 437 // 0 if the file is a scattering file, 1 (truth) if the file is a transmission file 438 InsertPoints lastPoint,1,GIsTrans 439 GIsTrans[lastPoint] = V_isTransFile(fname) //returns one if beamstop is "out" 516 517 // //the run number (not displayed in the table, but carried along) 518 // InsertPoints lastPoint,1,GRunNumber 519 // GRunNumber[lastPoint] = V_GetRunNumFromFile(sname) 520 // 521 // // TODO -- the isTransFile utility has not yet been written 522 // // 0 if the file is a scattering file, 1 (truth) if the file is a transmission file 523 // InsertPoints lastPoint,1,GIsTrans 524 // GIsTrans[lastPoint] = V_isTransFile(fname) //returns one if beamstop is "out" 440 525 441 526 // Monitor Count Rate … … 452 537 InsertPoints lastPoint,1,GPos 453 538 GPos[lastPoint] = str2num(V_getSamplePosition(fname)) 539 540 // Intent (text) 541 InsertPoints lastPoint,1,GIntent 542 GIntent[lastPoint] = V_getReduction_intent(fname) 543 544 // group_id (sample) 545 InsertPoints lastPoint,1,G_ID 546 G_ID[lastPoint] = V_getSample_group_ID(fname) 454 547 455 548 return(0) … … 489 582 Button SortLabelsButton, pos={25,38}, size={140,24},proc=V_CatVSANSTable_SortProc,title="Labels" 490 583 Button SortDateAndTimeButton, pos={25,68}, size={140,24},proc=V_CatVSANSTable_SortProc,title="Date and Time" 491 Button Sort SSDButton, pos={25,98}, size={140,24},proc=V_CatVSANSTable_SortProc,title="SSD"492 Button Sort SDDButton, pos={25,128}, size={140,24},proc=V_CatVSANSTable_SortProc,title="SDD"584 Button SortIntentButton, pos={25,98}, size={140,24},proc=V_CatVSANSTable_SortProc,title="Intent" 585 Button SortIDButton, pos={25,128}, size={140,24},proc=V_CatVSANSTable_SortProc,title="Group ID" 493 586 Button SortLambdaButton, pos={25,158}, size={140,24},proc=V_CatVSANSTable_SortProc,title="Lambda" 494 587 Button SortCountTimButton, pos={25,188}, size={140,24},proc=V_CatVSANSTable_SortProc,title="Count Time" … … 520 613 521 614 Wave/T GFilenames = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Filenames" 522 Wave/T GSuffix = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Suffix"615 // Wave/T GSuffix = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Suffix" 523 616 Wave/T GLabels = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Labels" 524 617 Wave/T GDateTime = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:DateAndTime" 525 Wave GSDD = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:SDD"618 // Wave GSDD = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:SDD" 526 619 Wave GLambda = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Lambda" 527 620 Wave GCntTime = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:CntTime" … … 530 623 Wave GTransmission = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Transmission" 531 624 Wave GThickness = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Thickness" 532 Wave GXCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:XCenter"533 Wave GYCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:YCenter"625 // Wave GXCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:XCenter" 626 // Wave GYCenter = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:YCenter" 534 627 Wave/T GNumGuides = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:nGuides" 535 628 Wave GNumAttens = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:NumAttens" 536 Wave GRunNumber = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:RunNumber"537 Wave GIsTrans = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:IsTrans"629 // Wave GRunNumber = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:RunNumber" 630 // Wave GIsTrans = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:IsTrans" 538 631 Wave GRot = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:RotAngle" 539 632 Wave GTemp = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Temperature" … … 541 634 Wave GMCR = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:MCR" 542 635 Wave GPos = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Pos" 636 Wave/T GIntent = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Intent" 637 Wave G_ID = $"root:Packages:NIST:VSANS:CatVSHeaderInfo:Group_ID" 543 638 544 639 … … 557 652 558 653 case "SortFilenamesButton": 559 Sort GFilenames, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR 654 // Sort GFilenames, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR 655 Sort GFilenames, GFilenames, GLabels, GDateTime, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GNumAttens, GRot, GTemp, GField, GMCR, GIntent, G_ID 560 656 break 561 657 562 658 case "SortLabelsButton": 563 Sort GLabels, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR 659 // Sort GLabels, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR 660 Sort GLabels, GFilenames, GLabels, GDateTime, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GNumAttens, GRot, GTemp, GField, GMCR, GIntent, G_ID 564 661 break 565 662 566 663 case "SortDateAndTimeButton": 567 Sort GDateTime, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR 568 break 569 570 case "SortSSDButton": 571 break 572 573 case "SortSDDButton": 574 Sort GSDD, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR 664 // Sort GDateTime, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR 665 Sort GDateTime, GFilenames, GLabels, GDateTime, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GNumAttens, GRot, GTemp, GField, GMCR, GIntent, G_ID 666 667 break 668 669 case "SortIntentButton": 670 Sort GIntent, GFilenames, GLabels, GDateTime, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GNumAttens, GRot, GTemp, GField, GMCR, GIntent, G_ID 671 break 672 673 case "SortIDButton": 674 Sort G_ID, GFilenames, GLabels, GDateTime, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GNumAttens, GRot, GTemp, GField, GMCR, GIntent, G_ID 575 675 break 576 676 577 677 case "SortLambdaButton": 578 Sort GLambda, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR 678 // Sort GLambda, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR 679 Sort GLambda, GFilenames, GLabels, GDateTime, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GNumAttens, GRot, GTemp, GField, GMCR, GIntent, G_ID 680 579 681 break 580 682 581 683 case "SortCountTimButton": 582 Sort GCntTime, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR 684 // Sort GCntTime, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR 685 Sort GCntTime, GFilenames, GLabels, GDateTime, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GNumAttens, GRot, GTemp, GField, GMCR, GIntent, G_ID 686 583 687 break 584 688 585 689 case "SortTotalCountsButton": 586 Sort GTotCnts, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR 690 // Sort GTotCnts, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR 691 Sort GTotCnts, GFilenames, GLabels, GDateTime, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GNumAttens, GRot, GTemp, GField, GMCR, GIntent, G_ID 692 587 693 break 588 694 589 695 case "SortCountRateButton": 590 Sort GCntRate, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR 696 // Sort GCntRate, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR 697 Sort GCntRate, GFilenames, GLabels, GDateTime, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GNumAttens, GRot, GTemp, GField, GMCR, GIntent, G_ID 698 591 699 break 592 700 … … 595 703 596 704 case "SortTransmissionButton": 597 Sort GTransmission, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR 705 // Sort GTransmission, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR 706 Sort GTransmission, GFilenames, GLabels, GDateTime, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GNumAttens, GRot, GTemp, GField, GMCR, GIntent, G_ID 707 598 708 break 599 709 600 710 case "SortThicknessButton": 601 Sort GThickness, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR 711 // Sort GThickness, GSuffix, GFilenames, GLabels, GDateTime, GSDD, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GXCenter, GYCenter, GNumAttens, GRunNumber, GIsTrans, GRot, GTemp, GField, GMCR 712 Sort GThickness, GFilenames, GLabels, GDateTime, GLambda, GCntTime, GTotCnts, GCntRate, GTransmission, GThickness, GNumAttens, GRot, GTemp, GField, GMCR, GIntent, G_ID 713 602 714 break 603 715 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_HDF5_RW_Utils.ipf
r1018 r1023 879 879 880 880 881 882 883 884 885 ////////// 886 // 887 // These procedures are needed to write out MASK and DIV files 888 // 889 //////// 890 891 892 // 893 // saves a specified folder, with a given filename. 894 // saves to the home path 895 // 896 Proc Save_VSANS_file(dfPath, filename) 897 String dfPath ="root:VSANS_file" // e.g., "root:FolderA" or ":" 898 String filename = "Test_VSANS_file.h5" 899 900 H_NXSANS_SaveGroupAsHDF5(dfPath, filename) 901 End 902 903 904 // 905 // this is my procedure to save the folders to HDF5, once I've filled the folder tree 906 // 907 // this does NOT save attributes, but gets the folder structure correct 908 // 909 Function H_NXSANS_SaveGroupAsHDF5(dfPath, filename) 910 String dfPath // e.g., "root:FolderA" or ":" 911 String filename 912 913 Variable result = 0 // 0 means no error 914 915 Variable fileID 916 HDF5CreateFile/P=home /O /Z fileID as filename 917 if (V_flag != 0) 918 Print "HDF5CreateFile failed" 919 return -1 920 endif 921 922 HDF5SaveGroup /IGOR=0 /O /R /Z $dfPath, fileID, "." 923 // HDF5SaveGroup /O /R /Z $dfPath, fileID, "." 924 if (V_flag != 0) 925 Print "HDF5SaveGroup failed" 926 result = -1 927 endif 928 929 HDF5CloseFile fileID 930 931 return result 932 End 933 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_IQ_Utilities.ipf
r1022 r1023 2 2 #pragma rtGlobals=3 // Use modern global access method and strict wave access. 3 3 4 // 5 // does no scaling, only the basic (default) trim of the ends, concatenate, sort, and save 6 // 7 8 4 5 // 6 // Operation does no scaling, only the basic (default) trim of the ends, concatenate, sort, and save 7 // -- if data has been converted to WORK and hte solid angle correction was done, then the data 8 // is per unit solid angle, and matches up - at least the simulated data does... 9 // 10 // 11 // V_DataPlotting.ipf is where the I(q) panel is drawn and the binning is set 9 12 // 10 13 // see the VCALC BinAllMiddlePanels() for an example of this 11 14 // see the binning routines in VC_DetectorBinning_Utils.ipf for the details 12 15 // 16 13 17 // TODO 14 18 // … … 25 29 // x- figure out when this needs to be called to (force) re-calculate I vs Q 26 30 // 27 28 29 31 30 32 … … 105 107 String type = root:Packages:NIST:VSANS:Globals:gCurDispType 106 108 107 // figure out which binning was used108 109 109 110 // trim the data if needed … … 113 114 114 115 // concatenate the data sets 116 // TODO x- figure out which binning was used (this is done in V_1DConcatenate()) 115 117 // clear the old tmp waves first, if they still exist 116 118 SetDataFolder $("root:Packages:NIST:VSANS:"+type) … … 160 162 // 161 163 // TODO: 164 // x- this currently ignores the binning type (one, two, etc. ) 162 165 // -- this currently assumes that all of the waves exist 163 166 // -- need robust error checking for wave existence 164 167 // -- wave names are hard-wired and their name and location may be different in the future 165 // -- if different averaging options were chosen (bin type of 2, 4 etc) then168 // x- if different averaging options were chosen (bin type of 2, 4 etc) then 166 169 // although waves may exist, they may not be the right ones to use. There 167 170 // will be a somewhat complex selection process 168 171 // x- detector B is currently skipped 169 172 // 170 // this seems like a lot of extra work to do something so simple... 173 // this seems like a lot of extra work to do something so simple...but it's better than a loop 171 174 // 172 175 // root:Packages:NIST:VSANS:RAW:iBin_qxqy_FB 176 // 177 // binType = 1 = one 178 // binType = 2 = two 179 // binType = 3 = four 180 // binType = 4 = Slit Mode 181 // 173 182 Function V_1DConcatenate(folderStr) 174 183 String folderStr 175 184 185 Variable binType = V_GetBinningPopMode() 186 187 176 188 SetDataFolder $("root:Packages:NIST:VSANS:"+folderStr) 177 178 Wave/Z q_fb = qBin_qxqy_FB 179 Wave/Z q_ft = qBin_qxqy_FT 180 Wave/Z q_fl = qBin_qxqy_FL 181 Wave/Z q_fr = qBin_qxqy_FR 182 Wave/Z q_mb = qBin_qxqy_MB 183 Wave/Z q_mt = qBin_qxqy_MT 184 Wave/Z q_ml = qBin_qxqy_ML 185 Wave/Z q_mr = qBin_qxqy_MR 186 Wave/Z q_b = qBin_qxqy_B 187 188 Concatenate/NP {q_fb,q_ft,q_fl,q_fr,q_mb,q_mt,q_ml,q_mr,q_b}, tmp_q 189 190 Wave/Z i_fb = iBin_qxqy_FB 191 Wave/Z i_ft = iBin_qxqy_FT 192 Wave/Z i_fl = iBin_qxqy_FL 193 Wave/Z i_fr = iBin_qxqy_FR 194 Wave/Z i_mb = iBin_qxqy_MB 195 Wave/Z i_mt = iBin_qxqy_MT 196 Wave/Z i_ml = iBin_qxqy_ML 197 Wave/Z i_mr = iBin_qxqy_MR 198 Wave/Z i_b = iBin_qxqy_B 199 200 Concatenate/NP {i_fb,i_ft,i_fl,i_fr,i_mb,i_mt,i_ml,i_mr,i_b}, tmp_i 201 202 Wave/Z s_fb = eBin_qxqy_FB 203 Wave/Z s_ft = eBin_qxqy_FT 204 Wave/Z s_fl = eBin_qxqy_FL 205 Wave/Z s_fr = eBin_qxqy_FR 206 Wave/Z s_mb = eBin_qxqy_MB 207 Wave/Z s_mt = eBin_qxqy_MT 208 Wave/Z s_ml = eBin_qxqy_ML 209 Wave/Z s_mr = eBin_qxqy_MR 210 Wave/Z s_b = eBin_qxqy_B 211 212 Concatenate/NP {s_fb,s_ft,s_fl,s_fr,s_mb,s_mt,s_ml,s_mr,s_b}, tmp_s 213 214 // Concatenate/NP {$("root:"+folder1+":"+folder1+"_q"),$("root:"+folder2+":"+folder2+"_q")},tmp_q 215 // Concatenate/NP {$("root:"+folder1+":"+folder1+"_i"),$("root:"+folder2+":"+folder2+"_i")},tmp_i 216 // Concatenate/NP {$("root:"+folder1+":"+folder1+"_s"),$("root:"+folder2+":"+folder2+"_s")},tmp_s 217 // Concatenate/NP {$("root:"+folder1+":res0"),$("root:"+folder2+":res0")},tmp_res0 218 // Concatenate/NP {$("root:"+folder1+":res1"),$("root:"+folder2+":res1")},tmp_res1 219 // Concatenate/NP {$("root:"+folder1+":res2"),$("root:"+folder2+":res2")},tmp_res2 220 // Concatenate/NP {$("root:"+folder1+":res3"),$("root:"+folder2+":res3")},tmp_res3 221 222 //// move the concatenated result into the destination folder (killing the old stuff first) 223 // KillWaves/Z $("root:"+folder2+":"+folder2+"_q") 224 // KillWaves/Z $("root:"+folder2+":"+folder2+"_i") 225 // KillWaves/Z $("root:"+folder2+":"+folder2+"_s") 226 // KillWaves/Z $("root:"+folder2+":res0") 227 // KillWaves/Z $("root:"+folder2+":res1") 228 // KillWaves/Z $("root:"+folder2+":res2") 229 // KillWaves/Z $("root:"+folder2+":res3") 230 231 // Duplicate/O tmp_q $("root:"+folder2+":"+folder2+"_q") 232 // Duplicate/O tmp_i $("root:"+folder2+":"+folder2+"_i") 233 // Duplicate/O tmp_s $("root:"+folder2+":"+folder2+"_s") 234 // Duplicate/O tmp_res0 $("root:"+folder2+":res0") 235 // Duplicate/O tmp_res1 $("root:"+folder2+":res1") 236 // Duplicate/O tmp_res2 $("root:"+folder2+":res2") 237 // Duplicate/O tmp_res3 $("root:"+folder2+":res3") 189 190 if(binType == 1) 191 Wave/Z q_fb = qBin_qxqy_FB 192 Wave/Z q_ft = qBin_qxqy_FT 193 Wave/Z q_fl = qBin_qxqy_FL 194 Wave/Z q_fr = qBin_qxqy_FR 195 Wave/Z q_mb = qBin_qxqy_MB 196 Wave/Z q_mt = qBin_qxqy_MT 197 Wave/Z q_ml = qBin_qxqy_ML 198 Wave/Z q_mr = qBin_qxqy_MR 199 Wave/Z q_b = qBin_qxqy_B 200 201 Concatenate/NP {q_fb,q_ft,q_fl,q_fr,q_mb,q_mt,q_ml,q_mr,q_b}, tmp_q 202 203 Wave/Z i_fb = iBin_qxqy_FB 204 Wave/Z i_ft = iBin_qxqy_FT 205 Wave/Z i_fl = iBin_qxqy_FL 206 Wave/Z i_fr = iBin_qxqy_FR 207 Wave/Z i_mb = iBin_qxqy_MB 208 Wave/Z i_mt = iBin_qxqy_MT 209 Wave/Z i_ml = iBin_qxqy_ML 210 Wave/Z i_mr = iBin_qxqy_MR 211 Wave/Z i_b = iBin_qxqy_B 212 213 Concatenate/NP {i_fb,i_ft,i_fl,i_fr,i_mb,i_mt,i_ml,i_mr,i_b}, tmp_i 214 215 Wave/Z s_fb = eBin_qxqy_FB 216 Wave/Z s_ft = eBin_qxqy_FT 217 Wave/Z s_fl = eBin_qxqy_FL 218 Wave/Z s_fr = eBin_qxqy_FR 219 Wave/Z s_mb = eBin_qxqy_MB 220 Wave/Z s_mt = eBin_qxqy_MT 221 Wave/Z s_ml = eBin_qxqy_ML 222 Wave/Z s_mr = eBin_qxqy_MR 223 Wave/Z s_b = eBin_qxqy_B 224 225 Concatenate/NP {s_fb,s_ft,s_fl,s_fr,s_mb,s_mt,s_ml,s_mr,s_b}, tmp_s 226 endif 227 228 if(binType == 2) 229 Wave/Z q_ftb = qBin_qxqy_FTB 230 Wave/Z q_flr = qBin_qxqy_FLR 231 Wave/Z q_mtb = qBin_qxqy_MTB 232 Wave/Z q_mlr = qBin_qxqy_MLR 233 Wave/Z q_b = qBin_qxqy_B 234 235 Concatenate/NP {q_ftb,q_flr,q_mtb,q_mlr,q_b}, tmp_q 236 237 Wave/Z i_ftb = iBin_qxqy_FTB 238 Wave/Z i_flr = iBin_qxqy_FLR 239 Wave/Z i_mtb = iBin_qxqy_MTB 240 Wave/Z i_mlr = iBin_qxqy_MLR 241 Wave/Z i_b = iBin_qxqy_B 242 243 Concatenate/NP {i_ftb,i_flr,i_mtb,i_mlr,i_b}, tmp_i 244 245 Wave/Z s_ftb = eBin_qxqy_FTB 246 Wave/Z s_flr = eBin_qxqy_FLR 247 Wave/Z s_mtb = eBin_qxqy_MTB 248 Wave/Z s_mlr = eBin_qxqy_MLR 249 Wave/Z s_b = eBin_qxqy_B 250 251 Concatenate/NP {s_ftb,s_flr,s_mtb,s_mlr,s_b}, tmp_s 252 endif 253 254 if(binType == 3) 255 Wave/Z q_flrtb = qBin_qxqy_FLRTB 256 Wave/Z q_mlrtb = qBin_qxqy_MLRTB 257 Wave/Z q_b = qBin_qxqy_B 258 259 Concatenate/NP {q_flrtb,q_mlrtb,q_b}, tmp_q 260 261 Wave/Z i_flrtb = iBin_qxqy_FLRTB 262 Wave/Z i_mlrtb = iBin_qxqy_MLRTB 263 Wave/Z i_b = iBin_qxqy_B 264 265 Concatenate/NP {i_flrtb,i_mlrtb,i_b}, tmp_i 266 267 Wave/Z s_flrtb = eBin_qxqy_FLRTB 268 Wave/Z s_mlrtb = eBin_qxqy_MLRTB 269 Wave/Z s_b = eBin_qxqy_B 270 271 Concatenate/NP {s_flrtb,s_mlrtb,s_b}, tmp_s 272 endif 273 274 // TODO - This is the identical set of waves as for the case of binType = 1. 275 // they have the same names, but are averaged differently since it's slit mode. 276 // I have separated this, since in practice the TB panels are probably best to ignore 277 // and NOT include in the averaging since the Qy range is so limited. 278 if(binType == 4) 279 Wave/Z q_fb = qBin_qxqy_FB 280 Wave/Z q_ft = qBin_qxqy_FT 281 Wave/Z q_fl = qBin_qxqy_FL 282 Wave/Z q_fr = qBin_qxqy_FR 283 Wave/Z q_mb = qBin_qxqy_MB 284 Wave/Z q_mt = qBin_qxqy_MT 285 Wave/Z q_ml = qBin_qxqy_ML 286 Wave/Z q_mr = qBin_qxqy_MR 287 Wave/Z q_b = qBin_qxqy_B 288 289 Concatenate/NP {q_fb,q_ft,q_fl,q_fr,q_mb,q_mt,q_ml,q_mr,q_b}, tmp_q 290 291 Wave/Z i_fb = iBin_qxqy_FB 292 Wave/Z i_ft = iBin_qxqy_FT 293 Wave/Z i_fl = iBin_qxqy_FL 294 Wave/Z i_fr = iBin_qxqy_FR 295 Wave/Z i_mb = iBin_qxqy_MB 296 Wave/Z i_mt = iBin_qxqy_MT 297 Wave/Z i_ml = iBin_qxqy_ML 298 Wave/Z i_mr = iBin_qxqy_MR 299 Wave/Z i_b = iBin_qxqy_B 300 301 Concatenate/NP {i_fb,i_ft,i_fl,i_fr,i_mb,i_mt,i_ml,i_mr,i_b}, tmp_i 302 303 Wave/Z s_fb = eBin_qxqy_FB 304 Wave/Z s_ft = eBin_qxqy_FT 305 Wave/Z s_fl = eBin_qxqy_FL 306 Wave/Z s_fr = eBin_qxqy_FR 307 Wave/Z s_mb = eBin_qxqy_MB 308 Wave/Z s_mt = eBin_qxqy_MT 309 Wave/Z s_ml = eBin_qxqy_ML 310 Wave/Z s_mr = eBin_qxqy_MR 311 Wave/Z s_b = eBin_qxqy_B 312 313 Concatenate/NP {s_fb,s_ft,s_fl,s_fr,s_mb,s_mt,s_ml,s_mr,s_b}, tmp_s 314 endif 315 316 317 238 318 239 319 // Can't kill here, since they are still needed to sort and write out! -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Initialize.ipf
r1022 r1023 164 164 165 165 166 // lookup waves for log and linear display of images 166 // set the lookup waves for log/lin display of the detector images 167 V_MakeImageLookupTables(10000,0,1) 168 169 170 171 //set flag if Demo Version is detected 172 Variable/G root:Packages:NIST:VSANS:Globals:isDemoVersion = V_isDemo() 173 174 //set XML globals 175 // String/G root:Packages:NIST:gXMLLoader_Title = "" 176 177 Return(0) 178 End 179 180 // 181 //num = number of points (10000 seeems to be a good number so far) 182 // lo = lower value (between 0 and 1) 183 // hi = upper value (between 0 and 1) 184 // 185 // note that it is currenty NOT OK for lo > hi (!= reversed color scale, right now log(negative) == bad) 186 // 187 // TODO hi, lo not used properly here, seems to mangle log display now that I'm switching the lo,hi of the ctab 188 // 189 Function V_MakeImageLookupTables(num,lo,hi) 190 Variable num,lo,hi 191 192 // lookup waves for log and linear display of images 167 193 // this is used for the main data display. With this, I can use the original 168 194 // detector data (no copy) and the zeros in the data set are tolerated when displaying 169 195 // on log scale 170 196 SetDataFolder root:Packages:NIST:VSANS:Globals 171 Variable num,val,offset172 num=10000173 offset = 1/num 197 Variable val,offset 198 199 offset = 1/num //can't use 1/lo if lo == 0 174 200 175 201 Make/O/D/N=(num) logLookupWave,linearLookupWave 202 176 203 linearLookupWave = (p+1)/num 204 177 205 178 206 logLookupWave = log(linearLookupWave) … … 183 211 184 212 SetDataFolder root: 185 186 187 //set flag if Demo Version is detected 188 Variable/G root:Packages:NIST:VSANS:Globals:isDemoVersion = V_isDemo() 189 190 //set XML globals 191 // String/G root:Packages:NIST:gXMLLoader_Title = "" 192 193 Return(0) 194 End 195 213 214 return(0) 215 end 196 216 197 217 // -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_MainPanel.ipf
r1019 r1023 430 430 // Button MainButton_4d,pos={15,180},size={110,20},proc=CatShort_MainButtonProc,title="CAT/Notebook" 431 431 // Button MainButton_4d,help={"This will generate a CATalog notebook of all files in a specified local folder"} 432 Button MainButton_4e,pos={180,90},size={130,20},proc=NG1TransConv_MainButtonProc,title="NG1 Files to Trans"433 Button MainButton_4e,help={"Converts NG1 transmission data files to be interpreted as such"}432 // Button MainButton_4e,pos={180,90},size={130,20},proc=NG1TransConv_MainButtonProc,title="NG1 Files to Trans" 433 // Button MainButton_4e,help={"Converts NG1 transmission data files to be interpreted as such"} 434 434 Button MainButton_4f,pos={180,120},size={130,20},proc=PRODIV_MainButtonProc,title="Make DIV file" 435 435 Button MainButton_4f,help={"Merges two stored workfiles (CORrected) into a DIV file, and saves the result"} … … 443 443 Button MainButton_4c,disable=1 444 444 // Button MainButton_4d,disable=1 445 Button MainButton_4e,disable=1445 // Button MainButton_4e,disable=1 446 446 Button MainButton_4f,disable=1 447 447 Button MainButton_4g,disable=1 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_MaskUtils.ipf
r1015 r1023 833 833 // H_Fill_VSANS_Attributes() 834 834 835 // fill in with VCALC simulation bits 836 // H_Fill_VSANS_wSim() 837 835 838 836 End 839 837 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Test_RAW_Panel.ipf
r1022 r1023 54 54 FakeTabClick(1) 55 55 FakeTabClick(0) 56 57 LogLinDisplayPref() // resets the display depending on the preference state 56 58 57 59 // either clear the status, or fake a click … … 69 71 70 72 end 73 74 Function LogLinDisplayPref() 75 76 // get the state of the log/lin button, and make sure preferences are obeyed 77 // log/lin current state is in the S_UserData string (0=linear, 1=log) 78 ControlInfo/W=VSANS_Data button_log 79 Variable curState 80 curState = str2num(S_UserData) 81 82 NVAR gLogScalingAsDefault = root:Packages:NIST:VSANS:Globals:gLogScalingAsDefault 83 if(curState != gLogScalingAsDefault) 84 STRUCT WMButtonAction ba 85 ba.eventCode = 2 //fake mouse click 86 LogLinButtonProc(ba) 87 endif 88 89 return(0) 90 end 91 71 92 72 93 // … … 92 113 End 93 114 115 94 116 // TODO 95 117 // 96 // -- fill in the proper window title in the DoWindow/T command 118 // -- now that the sliders work, label them and move them to a better location 119 // -- logical location for all of the buttons 120 // -- add raw data load button, load/draw mask button 121 // x- fill in the proper window title in the DoWindow/T command 97 122 // -- add help text for all of the controls 123 // -- tab order? can I set this? 98 124 // 99 125 Window VSANS_DataPanel() : Panel … … 126 152 127 153 TabControl tab0,pos={13,41},size={572,617},proc=VDataTabProc,tabLabel(0)="Front" 128 TabControl tab0,tabLabel(1)="Middle",tabLabel(2)="Back",value= 2 154 TabControl tab0,tabLabel(1)="Middle",tabLabel(2)="Back",value= 2,focusRing=0 129 155 130 156 // on the side … … 136 162 Button button_tab_p,pos={648,81},size={50,20},proc=Tab_p_ButtonProc,title="Tab >" 137 163 Button button_isolate,pos={606,114},size={70,20},proc=IsolateButtonProc,title="Isolate" 164 Button button_toWork,pos={770,113},size={70,20},proc=ToWorkFileButtonProc,title="to WORK" 138 165 139 166 TitleBox title_file,pos={606,178},size={76,20},variable= root:Packages:NIST:VSANS:Globals:gLastLoadedFile … … 142 169 143 170 Button button_tagFile,pos={603,412},size={70,20},proc=TagFileButtonProc,title="Tag File" 171 Button button_tagFile,disable=2 144 172 Button button_saveIQ,pos={720,412},size={70,20},proc=SaveIQ_ButtonProc,title="Save I(Q)" 145 173 Button button_BeamCtr,pos={603,450},size={70,20},proc=BeamCtrButtonProc,title="Beam Ctr" … … 212 240 213 241 // 214 // event code 4 = mouse moved 242 // event code 4: mouse moved 243 // event code 11: keyboard events 215 244 // 216 245 // mouse moved is the only event that I really care about for the data display. 217 246 // 218 // TODO 247 // TODO: 219 248 // -- figure out how to respond only to events in the main window 220 249 // -- figure out which is the correct image to respond "from" 250 // -- More complete documentation of how the hook is identifying what graph is "under" the mouse 251 // AND what assumptions are behind this identification 252 // 221 253 // 222 254 Function VSANSDataHook(s) … … 240 272 // TODO (Way in the future -- I could make the small graphs into "buttons" by responding to a "mouse up" (not down) 241 273 // that hits in one of the small graph areas, and treat that as a click on that tab 274 // -- instead of this, I can try to get the focus rectangle to work more easily to move with the TAB, 275 // if I can intercept the keystroke (event 11), see below. 242 276 // 243 277 break … … 378 412 break 379 413 414 case 11: // keyboard event 415 // TODO -- figure out why I'm not getting the TAB keystroke 416 // -- I want to be able to use the tab to change the focus only between File <.> and Tab > buttons, not everything 417 // see the help file section "Keyboard Events" for an example and "WMWinHookStruct" 418 419 //Print "key code = ",s.specialKeyCode 420 //hookresult = 1 //if non-zero, we handled it and Igor will ignore it 421 break 380 422 // And so on . . . 381 423 endswitch … … 384 426 End 385 427 428 429 // ******** 430 // 431 // this procedure does most of the work for drawing the panels, setting the proper log/lin 432 // scaling, the color scale, and the location based on the active tab 386 433 // 387 434 //lots to to here: … … 397 444 // x- remove the dependency on VCALC being initialized first, and using dummy waves from there... 398 445 // 399 // -- can I use "ReplaceWave" to do this?446 // 400 447 Function VDataTabProc(tca) : TabControl 401 448 STRUCT WMTabControlAction &tca … … 413 460 414 461 SVAR dataType = root:Packages:NIST:VSANS:Globals:gCurDispType 415 // make sure log scaling is correct 462 463 // make sure log scaling is correct 416 464 NVAR state = root:Packages:NIST:VSANS:Globals:gIsLogScale 417 465 if(State == 0) … … 428 476 // -- only works for "B", since for M and F panels, all 4 data sets are named "data" 429 477 // in their respective folders... 430 478 479 480 // get the slider values for the color mapping 481 Variable lo,hi,lo_B,hi_B 482 Variable lo_MT,lo_MB,lo_MR,lo_ML 483 Variable lo_FT,lo_FB,lo_FR,lo_FL 484 Variable hi_MT,hi_MB,hi_MR,hi_ML 485 Variable hi_FT,hi_FB,hi_FR,hi_FL 486 ControlInfo slider_lo 487 lo = V_Value 488 ControlInfo slider_hi 489 hi = V_Value 490 491 431 492 String tmpStr 432 493 Variable ii … … 448 509 if(V_flag == 0) // 0 == data is not displayed, so append it 449 510 AppendImage/W=VSANS_Data#det_panelsB det_B 450 ModifyImage/W=VSANS_Data#det_panelsB ''#0 ctab= {*,*,ColdWarm,0} 511 lo_B = lo*(WaveMax(det_B) - WaveMin(det_B)) + WaveMin(det_B) 512 hi_B = hi*(WaveMax(det_B) - WaveMin(det_B)) + WaveMin(det_B) 513 ModifyImage/W=VSANS_Data#det_panelsB ''#0 ctab= {lo_B,hi_B,ColdWarm,0} // don't autoscale {*,*,ColdWarm,0} 451 514 endif 452 515 MoveSubWindow/W=VSANS_Data#det_panelsB fnum=(50,185,517,620) … … 489 552 AppendImage/W=VSANS_Data#det_panelsM det_ML 490 553 AppendImage/W=VSANS_Data#det_panelsM det_MR 491 ModifyImage/W=VSANS_Data#det_panelsM ''#0 ctab= {*,*,ColdWarm,0} // ''#n means act on the nth image (there are 4) 492 ModifyImage/W=VSANS_Data#det_panelsM ''#1 ctab= {*,*,ColdWarm,0} 493 ModifyImage/W=VSANS_Data#det_panelsM ''#2 ctab= {*,*,ColdWarm,0} 494 ModifyImage/W=VSANS_Data#det_panelsM ''#3 ctab= {*,*,ColdWarm,0} 554 lo_MT = lo*(WaveMax(det_MT) - WaveMin(det_MT)) + WaveMin(det_MT) 555 hi_MT = hi*(WaveMax(det_MT) - WaveMin(det_MT)) + WaveMin(det_MT) 556 lo_MB = lo*(WaveMax(det_MB) - WaveMin(det_MB)) + WaveMin(det_MB) 557 hi_MB = hi*(WaveMax(det_MB) - WaveMin(det_MB)) + WaveMin(det_MB) 558 lo_ML = lo*(WaveMax(det_ML) - WaveMin(det_ML)) + WaveMin(det_ML) 559 hi_ML = hi*(WaveMax(det_ML) - WaveMin(det_ML)) + WaveMin(det_ML) 560 lo_MR = lo*(WaveMax(det_MR) - WaveMin(det_MR)) + WaveMin(det_MR) 561 hi_MR = hi*(WaveMax(det_MR) - WaveMin(det_MR)) + WaveMin(det_MR) 562 563 ModifyImage/W=VSANS_Data#det_panelsM ''#0 ctab= {lo_MT,hi_MT,ColdWarm,0} // ''#n means act on the nth image (there are 4) 564 ModifyImage/W=VSANS_Data#det_panelsM ''#1 ctab= {lo_MB,hi_MB,ColdWarm,0} 565 ModifyImage/W=VSANS_Data#det_panelsM ''#2 ctab= {lo_ML,hi_ML,ColdWarm,0} 566 ModifyImage/W=VSANS_Data#det_panelsM ''#3 ctab= {lo_MR,hi_MR,ColdWarm,0} 495 567 endif 496 568 MoveSubWindow/W=VSANS_Data#det_panelsM fnum=(50,185,517,620) … … 536 608 AppendImage/W=VSANS_Data#det_panelsF det_FL 537 609 AppendImage/W=VSANS_Data#det_panelsF det_FR 538 ModifyImage/W=VSANS_Data#det_panelsF ''#0 ctab= {*,*,ColdWarm,0} 539 ModifyImage/W=VSANS_Data#det_panelsF ''#1 ctab= {*,*,ColdWarm,0} 540 ModifyImage/W=VSANS_Data#det_panelsF ''#2 ctab= {*,*,ColdWarm,0} 541 ModifyImage/W=VSANS_Data#det_panelsF ''#3 ctab= {*,*,ColdWarm,0} 610 lo_FT = lo*(WaveMax(det_FT) - WaveMin(det_FT)) + WaveMin(det_FT) 611 hi_FT = hi*(WaveMax(det_FT) - WaveMin(det_FT)) + WaveMin(det_FT) 612 lo_FB = lo*(WaveMax(det_FB) - WaveMin(det_FB)) + WaveMin(det_FB) 613 hi_FB = hi*(WaveMax(det_FB) - WaveMin(det_FB)) + WaveMin(det_FB) 614 lo_FL = lo*(WaveMax(det_FL) - WaveMin(det_FL)) + WaveMin(det_FL) 615 hi_FL = hi*(WaveMax(det_FL) - WaveMin(det_FL)) + WaveMin(det_FL) 616 lo_FR = lo*(WaveMax(det_FR) - WaveMin(det_FR)) + WaveMin(det_FR) 617 hi_FR = hi*(WaveMax(det_FR) - WaveMin(det_FR)) + WaveMin(det_FR) 618 619 ModifyImage/W=VSANS_Data#det_panelsF ''#0 ctab= {lo_FT,hi_FT,ColdWarm,0} 620 ModifyImage/W=VSANS_Data#det_panelsF ''#1 ctab= {lo_FB,hi_FB,ColdWarm,0} 621 ModifyImage/W=VSANS_Data#det_panelsF ''#2 ctab= {lo_FL,hi_FL,ColdWarm,0} 622 ModifyImage/W=VSANS_Data#det_panelsF ''#3 ctab= {lo_FR,hi_FR,ColdWarm,0} 542 623 endif 543 624 MoveSubWindow/W=VSANS_Data#det_panelsF fnum=(50,185,517,620) … … 695 776 return 0 696 777 End 778 779 // 780 // if the data display is RAW, convert to the specified WORK data type 781 // 782 // TODO 783 // -- better error checking 784 // -- if the data type is not RAW, can I Copy Folder instead? 785 // 786 Function ToWorkFileButtonProc(ba) : ButtonControl 787 STRUCT WMButtonAction &ba 788 789 switch( ba.eventCode ) 790 case 2: // mouse up 791 // click code here 792 //Convert_to_Workfile(newtype, doadd) // a proc 793 Execute "Convert_to_Workfile()" 794 795 break 796 case -1: // control being killed 797 break 798 endswitch 799 800 return 0 801 End 802 697 803 698 804 // TODO … … 772 878 773 879 // TODO: 880 // x- link this to the preferences for the display. this is done in UpdateDisplayInformation (the main call) so that 881 // the panels are rescaled only once, rather than toggled three times (F, M, B) if I call from the tabProc 774 882 // -- come up with a better definition of the log lookup wave (> 1000 pts, what is the first point) 775 883 // -- make an equivalent linear wave … … 962 1070 if( sa.eventCode & 1 ) // value set 963 1071 Variable curval = sa.curval 1072 ControlInfo tab0 1073 FakeTabClick(V_Value) 1074 1075 // ControlInfo slider_lo 1076 // V_MakeImageLookupTables(10000,V_Value,curval) 964 1077 endif 965 1078 break … … 984 1097 if( sa.eventCode & 1 ) // value set 985 1098 Variable curval = sa.curval 986 endif 987 break 988 endswitch 989 990 return 0 991 End 992 993 1099 ControlInfo tab0 1100 FakeTabClick(V_Value) 1101 1102 // ControlInfo slider_hi 1103 // V_MakeImageLookupTables(10000,curval,V_Value) 1104 endif 1105 break 1106 endswitch 1107 1108 return 0 1109 End 1110 1111 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Utilities_General.ipf
r1022 r1023 177 177 Variable useIgorDraw // True to use Igor's own draw method rather than native 178 178 179 Variable num 179 Variable num,numToClean 180 180 181 181 // is there anything there to be killed? 182 182 num = V_CleanOutOneRawVSANS() 183 numToClean = num 183 184 if(num <= 0) 184 185 return(0) … … 215 216 216 217 KillWindow ProgressPanel 217 return( 0)218 return(numToClean) 218 219 End 219 220 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_VSANS_Preferences.ipf
r1022 r1023 272 272 CheckBox PrefCtrl_1m title="Do Tube Shadow Correction?",size={140,14},proc=V_DoTubeShadowCorPref 273 273 CheckBox PrefCtrl_1m value=root:Packages:NIST:VSANS:Globals:gDoTubeShadowCor,pos={255,200},help={"TURN OFF ONLY FOR DEBUGGING."} 274 CheckBox PrefCtrl_1n title="Do Tube Shadow Correction?",size={140,14},proc=V_DoMonitorNormPref275 CheckBox PrefCtrl_1n value=root:Packages:NIST:VSANS:Globals:gDoMonitorNormalization,pos={255,220},help={"TURN OFF ONLY FOR DEBUGGING."}274 // CheckBox PrefCtrl_1n title="Do Tube Shadow Correction?",size={140,14},proc=V_DoMonitorNormPref 275 // CheckBox PrefCtrl_1n value=root:Packages:NIST:VSANS:Globals:gDoMonitorNormalization,pos={255,220},help={"TURN OFF ONLY FOR DEBUGGING."} 276 276 277 277
Note: See TracChangeset
for help on using the changeset viewer.