- Timestamp:
- Nov 16, 2017 10:57:32 AM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_IQ_Utilities.ipf
r1064 r1073 40 40 // *** When other bin types are developed, DO NOT reassign these numbers. 41 41 // instead, skip the old numbers and assign new ones. 42 // old modes can be removed from the string constant ksBinTypeStr (above), but the 42 // 43 // - the numbers here in the switch can be out of order - it's fine 44 // 45 // old modes can be removed from the string constant ksBinTypeStr(n) (in V_Initialize.ipf), but the 43 46 // mode numbers are what many different binning, plotting, and reduction functions are 44 47 // switching on. In the future, it may be necessary to change the key (everywhere) to a string 45 48 // switch, but for now, stick with the numbers. 49 // 50 // Strconstant ksBinTypeStr = "F4-M4-B;F2-M2-B;F1-M1-B;F2-M1-B;F1-M2xTB-B;F2-M2xTB-B;SLIT-F2-M2-B;" 51 // 52 // 46 53 Function V_BinTypeStr2Num(binStr) 47 54 String binStr … … 49 56 Variable binType 50 57 strswitch(binStr) // string switch 51 case " One":58 case "F4-M4-B": 52 59 binType = 1 53 60 break // exit from switch 54 case " Two":61 case "F2-M2-B": 55 62 binType = 2 56 63 break // exit from switch 57 case "F our":64 case "F1-M1-B": 58 65 binType = 3 59 66 break // exit from switch 60 case "S lit Mode":67 case "SLIT-F2-M2-B": 61 68 binType = 4 62 69 break // exit from switch 63 70 71 case "F2-M1-B": 72 binType = 5 73 break 74 case "F1-M2xTB-B": 75 binType = 6 76 break 77 case "F2-M2xTB-B": 78 binType = 7 79 break 80 64 81 default: // optional default expression executed 65 82 binType = 0 66 83 Abort "Binning mode not found"// when no case matches 67 84 endswitch 85 68 86 return(binType) 69 87 end … … 86 104 // binType = V_GetBinningPopMode() 87 105 88 //// TODO: 89 // 90 // Back detector is handled spearately since there is nothing to combine 91 // 92 delQ = SetDeltaQ(folderStr,"B") 93 94 // dispatch based on binning type 95 if(binType == 1 || binType == 2 || binType == 3) 96 VC_fDoBinning_QxQy2D(folderStr, "B") //normal binning, nothing to combine 97 endif 98 99 // TODO -- this is only a temporary fix for slit mode 100 if(binType == 4) 101 /// this is for a tall, narrow slit mode 102 VC_fBinDetector_byRows(folderStr,"B") 103 endif 104 105 106 107 // these are the binning types where detectors are not combined 108 // other combined binning is below the loop 109 for(ii=0;ii<ItemsInList(ksDetectorListNoB);ii+=1) 110 detStr = StringFromList(ii, ksDetectorListNoB, ";") 106 // set delta Q for binning (used later inside VC_fDoBinning_QxQy2D) 107 for(ii=0;ii<ItemsInList(ksDetectorListAll);ii+=1) 108 detStr = StringFromList(ii, ksDetectorListAll, ";") 111 109 112 // set delta Q for binning 113 delQ = SetDeltaQ(folderStr,detStr) 110 delQ = SetDeltaQ(folderStr,detStr) // this sets (overwrites) the global value for each panel type 111 endfor 112 113 114 switch(binType) 115 case 1: 116 VC_fDoBinning_QxQy2D(folderStr,"FL") 117 VC_fDoBinning_QxQy2D(folderStr,"FR") 118 VC_fDoBinning_QxQy2D(folderStr,"FT") 119 VC_fDoBinning_QxQy2D(folderStr,"FB") 120 VC_fDoBinning_QxQy2D(folderStr,"ML") 121 VC_fDoBinning_QxQy2D(folderStr,"MR") 122 VC_fDoBinning_QxQy2D(folderStr,"MT") 123 VC_fDoBinning_QxQy2D(folderStr,"MB") 124 VC_fDoBinning_QxQy2D(folderStr, "B") 125 126 break 127 case 2: 128 VC_fDoBinning_QxQy2D(folderStr,"FLR") 129 VC_fDoBinning_QxQy2D(folderStr,"FTB") 130 VC_fDoBinning_QxQy2D(folderStr,"MLR") 131 VC_fDoBinning_QxQy2D(folderStr,"MTB") 132 VC_fDoBinning_QxQy2D(folderStr, "B") 133 134 break 135 case 3: 136 VC_fDoBinning_QxQy2D(folderStr,"MLRTB") 137 VC_fDoBinning_QxQy2D(folderStr,"FLRTB") 138 VC_fDoBinning_QxQy2D(folderStr, "B") 139 140 break 141 case 4: /// this is for a tall, narrow slit mode 142 VC_fBinDetector_byRows(folderStr,"FL") 143 VC_fBinDetector_byRows(folderStr,"FR") 144 VC_fBinDetector_byRows(folderStr,"ML") 145 VC_fBinDetector_byRows(folderStr,"MR") 146 VC_fBinDetector_byRows(folderStr,"B") 147 148 break 149 case 5: 150 VC_fDoBinning_QxQy2D(folderStr,"FTB") 151 VC_fDoBinning_QxQy2D(folderStr,"FLR") 152 VC_fDoBinning_QxQy2D(folderStr,"MLRTB") 153 VC_fDoBinning_QxQy2D(folderStr, "B") 114 154 115 // dispatch based on binning type 116 if(binType==1) 117 VC_fDoBinning_QxQy2D(folderStr,detStr) 118 endif 155 break 156 case 6: 157 VC_fDoBinning_QxQy2D(folderStr,"FLRTB") 158 VC_fDoBinning_QxQy2D(folderStr,"MLR") 159 VC_fDoBinning_QxQy2D(folderStr, "B") 119 160 120 // TODO -- this is only a temporary fix for slit mode 121 if(binType == 4) 122 /// this is for a tall, narrow slit mode 123 VC_fBinDetector_byRows(folderStr,detStr) 124 endif 161 break 162 case 7: 163 VC_fDoBinning_QxQy2D(folderStr,"FTB") 164 VC_fDoBinning_QxQy2D(folderStr,"FLR") 165 VC_fDoBinning_QxQy2D(folderStr,"MLR") 166 VC_fDoBinning_QxQy2D(folderStr, "B") 125 167 126 endfor 127 128 // bin in pairs 129 if(binType == 2) 130 VC_fDoBinning_QxQy2D(folderStr,"MLR") 131 VC_fDoBinning_QxQy2D(folderStr,"MTB") 132 VC_fDoBinning_QxQy2D(folderStr,"FLR") 133 VC_fDoBinning_QxQy2D(folderStr,"FTB") 134 endif 135 136 // bin everything on front or middle together 137 if(binType == 3) 138 VC_fDoBinning_QxQy2D(folderStr,"MLRTB") 139 VC_fDoBinning_QxQy2D(folderStr,"FLRTB") 140 endif 168 break 169 170 default: 171 Abort "Binning mode not found in V_QBinAllPanels_Circular"// when no case matches 172 endswitch 173 141 174 142 175 return(0) … … 239 272 // 240 273 // TODO: 241 // -- !!! Resolution waves are currently skipped - these must be added274 // x- !!! Resolution waves are currently skipped - these must be added 242 275 // 243 276 // x- this currently ignores the binning type (one, two, etc. ) … … 255 288 // root:Packages:NIST:VSANS:RAW:iBin_qxqy_FB 256 289 // 290 // Now, the extensions needed for each binType are handled in a loop using the strings 291 // defined globally for each of the numbered binTypes 292 // 257 293 // binType = 1 = one 258 294 // binType = 2 = two 259 295 // binType = 3 = four 260 296 // binType = 4 = Slit Mode 297 // binType = 5... 261 298 // 262 299 // if binType is passed in as -9999, get the binning mode from the popup … … 270 307 Variable binType 271 308 309 272 310 if(binType==-9999) 273 311 binType = V_GetBinningPopMode() 274 312 endif 275 313 314 String binTypeString = V_getBinTypeString(binType) 315 if(strlen(binTypeString) == 0) 316 DoAlert 0,"binTypeString is null in V_1DConcatenate" 317 return(0) 318 endif 319 276 320 // SetDataFolder $("root:Packages:NIST:VSANS:"+folderStr) 277 321 SetDataFolder $(pathStr+folderStr) … … 280 324 KillWaves/Z tmp_q,tmp_i,tmp_s,tmp_qb,tmp_sq,tmp_fs 281 325 326 String q_waveListStr="" 327 String i_waveListStr="" 328 String s_waveListStr="" 329 String sq_waveListStr="" 330 String qb_waveListStr="" 331 String fs_waveListStr="" 332 333 Variable num,ii 334 String item="" 335 336 //Generate string lists of the waves to be concatenated based on the 337 // binTypeString (a global string constant with the extensions) 338 // 339 282 340 NVAR gIgnoreDetB = root:Packages:NIST:VSANS:Globals:gIgnoreDetB 283 284 String waveListStr="" 285 if(binType == 1) 286 // q-values 287 waveListStr="" 288 if(!gIgnoreDetB) 289 waveListStr = "qBin_qxqy_B" + tagStr + ";" 341 if(!gIgnoreDetB) 342 q_waveListStr = "qBin_qxqy_B" + tagStr + ";" 343 i_waveListStr = "iBin_qxqy_B" + tagStr + ";" 344 s_waveListStr = "eBin_qxqy_B" + tagStr + ";" 345 sq_waveListStr = "sigmaQ_qxqy_B" + tagStr + ";" 346 qb_waveListStr = "qBar_qxqy_B" + tagStr + ";" 347 fs_waveListStr = "fSubS_qxqy_B" + tagStr + ";" 348 endif 349 350 num = ItemsInList(binTypeString, ";") 351 for(ii=0;ii<num;ii+=1) 352 item = StringFromList(ii, binTypeString ,";") 353 354 // "B" was handled outside the loop, be sure to skip here 355 if(cmpstr(item,"B") != 0) 356 q_waveListStr += "qBin_qxqy_" + item + tagStr + ";" 357 i_waveListStr += "iBin_qxqy_" + item + tagStr + ";" 358 s_waveListStr += "eBin_qxqy_" + item + tagStr + ";" 359 sq_waveListStr += "sigmaQ_qxqy_" + item + tagStr + ";" 360 qb_waveListStr += "qBar_qxqy_" + item + tagStr + ";" 361 fs_waveListStr += "fSubS_qxqy_" + item + tagStr + ";" 290 362 endif 291 waveListStr += "qBin_qxqy_MB" + tagStr + ";" 292 waveListStr += "qBin_qxqy_MT" + tagStr + ";" 293 waveListStr += "qBin_qxqy_ML" + tagStr + ";" 294 waveListStr += "qBin_qxqy_MR" + tagStr + ";" 295 waveListStr += "qBin_qxqy_FB" + tagStr + ";" 296 waveListStr += "qBin_qxqy_FT" + tagStr + ";" 297 waveListStr += "qBin_qxqy_FL" + tagStr + ";" 298 waveListStr += "qBin_qxqy_FR" + tagStr + ";" 299 300 Concatenate/NP/O waveListStr, tmp_q 301 302 //intensity 303 waveListStr="" 304 if(!gIgnoreDetB) 305 waveListStr = "iBin_qxqy_B" + tagStr + ";" 306 endif 307 waveListStr += "iBin_qxqy_MB" + tagStr + ";" 308 waveListStr += "iBin_qxqy_MT" + tagStr + ";" 309 waveListStr += "iBin_qxqy_ML" + tagStr + ";" 310 waveListStr += "iBin_qxqy_MR" + tagStr + ";" 311 waveListStr += "iBin_qxqy_FB" + tagStr + ";" 312 waveListStr += "iBin_qxqy_FT" + tagStr + ";" 313 waveListStr += "iBin_qxqy_FL" + tagStr + ";" 314 waveListStr += "iBin_qxqy_FR" + tagStr + ";" 315 // waveListStr = "iBin_qxqy_B;iBin_qxqy_MB;iBin_qxqy_MT;iBin_qxqy_ML;iBin_qxqy_MR;" 316 // waveListStr += "iBin_qxqy_FB;iBin_qxqy_FT;iBin_qxqy_FL;iBin_qxqy_FR;" 363 endfor 364 365 // concatenate each of the sets 366 367 Concatenate/NP/O q_waveListStr, tmp_q 368 369 Concatenate/NP/O i_waveListStr, tmp_i 317 370 318 Concatenate/NP/O waveListStr, tmp_i 319 320 //error 321 waveListStr="" 322 if(!gIgnoreDetB) 323 waveListStr = "eBin_qxqy_B" + tagStr + ";" 324 endif 325 waveListStr += "eBin_qxqy_MB" + tagStr + ";" 326 waveListStr += "eBin_qxqy_MT" + tagStr + ";" 327 waveListStr += "eBin_qxqy_ML" + tagStr + ";" 328 waveListStr += "eBin_qxqy_MR" + tagStr + ";" 329 waveListStr += "eBin_qxqy_FB" + tagStr + ";" 330 waveListStr += "eBin_qxqy_FT" + tagStr + ";" 331 waveListStr += "eBin_qxqy_FL" + tagStr + ";" 332 waveListStr += "eBin_qxqy_FR" + tagStr + ";" 333 // waveListStr = "eBin_qxqy_B;eBin_qxqy_MB;eBin_qxqy_MT;eBin_qxqy_ML;eBin_qxqy_MR;" 334 // waveListStr += "eBin_qxqy_FB;eBin_qxqy_FT;eBin_qxqy_FL;eBin_qxqy_FR;" 335 336 Concatenate/NP/O waveListStr, tmp_s 371 Concatenate/NP/O s_waveListStr, tmp_s 337 372 338 //sigma Q 339 waveListStr="" 340 if(!gIgnoreDetB) 341 waveListStr = "sigmaQ_qxqy_B" + tagStr + ";" 342 endif 343 waveListStr += "sigmaQ_qxqy_MB" + tagStr + ";" 344 waveListStr += "sigmaQ_qxqy_MT" + tagStr + ";" 345 waveListStr += "sigmaQ_qxqy_ML" + tagStr + ";" 346 waveListStr += "sigmaQ_qxqy_MR" + tagStr + ";" 347 waveListStr += "sigmaQ_qxqy_FB" + tagStr + ";" 348 waveListStr += "sigmaQ_qxqy_FT" + tagStr + ";" 349 waveListStr += "sigmaQ_qxqy_FL" + tagStr + ";" 350 waveListStr += "sigmaQ_qxqy_FR" + tagStr + ";" 351 // waveListStr = "sigmaQ_qxqy_B;sigmaQ_qxqy_MB;sigmaQ_qxqy_MT;sigmaQ_qxqy_ML;sigmaQ_qxqy_MR;" 352 // waveListStr += "sigmaQ_qxqy_FB;sigmaQ_qxqy_FT;sigmaQ_qxqy_FL;sigmaQ_qxqy_FR;" 353 354 Concatenate/NP/O waveListStr, tmp_sq 355 356 //Q bar 357 waveListStr="" 358 if(!gIgnoreDetB) 359 waveListStr = "qBar_qxqy_B" + tagStr + ";" 360 endif 361 waveListStr += "qBar_qxqy_MB" + tagStr + ";" 362 waveListStr += "qBar_qxqy_MT" + tagStr + ";" 363 waveListStr += "qBar_qxqy_ML" + tagStr + ";" 364 waveListStr += "qBar_qxqy_MR" + tagStr + ";" 365 waveListStr += "qBar_qxqy_FB" + tagStr + ";" 366 waveListStr += "qBar_qxqy_FT" + tagStr + ";" 367 waveListStr += "qBar_qxqy_FL" + tagStr + ";" 368 waveListStr += "qBar_qxqy_FR" + tagStr + ";" 369 // waveListStr = "qBar_qxqy_B;qBar_qxqy_MB;qBar_qxqy_MT;qBar_qxqy_ML;qBar_qxqy_MR;" 370 // waveListStr += "qBar_qxqy_FB;qBar_qxqy_FT;qBar_qxqy_FL;qBar_qxqy_FR;" 371 372 Concatenate/NP/O waveListStr, tmp_qb 373 374 //shadow fs 375 waveListStr="" 376 if(!gIgnoreDetB) 377 waveListStr = "fSubS_qxqy_B" + tagStr + ";" 378 endif 379 waveListStr += "fSubS_qxqy_MB" + tagStr + ";" 380 waveListStr += "fSubS_qxqy_MT" + tagStr + ";" 381 waveListStr += "fSubS_qxqy_ML" + tagStr + ";" 382 waveListStr += "fSubS_qxqy_MR" + tagStr + ";" 383 waveListStr += "fSubS_qxqy_FB" + tagStr + ";" 384 waveListStr += "fSubS_qxqy_FT" + tagStr + ";" 385 waveListStr += "fSubS_qxqy_FL" + tagStr + ";" 386 waveListStr += "fSubS_qxqy_FR" + tagStr + ";" 387 // waveListStr = "fSubS_qxqy_B;fSubS_qxqy_MB;fSubS_qxqy_MT;fSubS_qxqy_ML;fSubS_qxqy_MR;" 388 // waveListStr += "fSubS_qxqy_FB;fSubS_qxqy_FT;fSubS_qxqy_FL;fSubS_qxqy_FR;" 389 390 Concatenate/NP/O waveListStr, tmp_fs 373 Concatenate/NP/O sq_waveListStr, tmp_sq 374 375 Concatenate/NP/O qb_waveListStr, tmp_qb 376 377 Concatenate/NP/O fs_waveListStr, tmp_fs 391 378 392 endif 393 394 if(binType == 2) 395 // q-values 396 waveListStr="" 397 if(!gIgnoreDetB) 398 waveListStr = "qBin_qxqy_B" + tagStr + ";" 399 endif 400 waveListStr += "qBin_qxqy_MTB" + tagStr + ";" 401 waveListStr += "qBin_qxqy_MLR" + tagStr + ";" 402 waveListStr += "qBin_qxqy_FTB" + tagStr + ";" 403 waveListStr += "qBin_qxqy_FLR" + tagStr + ";" 404 405 // waveListStr = "qBin_qxqy_B;qBin_qxqy_MTB;qBin_qxqy_MLR;" 406 // waveListStr += "qBin_qxqy_FTB;qBin_qxqy_FLR;" 407 408 Concatenate/NP/O waveListStr, tmp_q 409 410 //intensity 411 waveListStr="" 412 if(!gIgnoreDetB) 413 waveListStr = "iBin_qxqy_B" + tagStr + ";" 414 endif 415 waveListStr += "iBin_qxqy_MTB" + tagStr + ";" 416 waveListStr += "iBin_qxqy_MLR" + tagStr + ";" 417 waveListStr += "iBin_qxqy_FTB" + tagStr + ";" 418 waveListStr += "iBin_qxqy_FLR" + tagStr + ";" 419 420 // waveListStr = "iBin_qxqy_B;iBin_qxqy_MTB;iBin_qxqy_MLR;" 421 // waveListStr += "iBin_qxqy_FTB;iBin_qxqy_FLR;" 422 423 Concatenate/NP/O waveListStr, tmp_i 424 425 //error 426 waveListStr="" 427 if(!gIgnoreDetB) 428 waveListStr = "eBin_qxqy_B" + tagStr + ";" 429 endif 430 waveListStr += "eBin_qxqy_MTB" + tagStr + ";" 431 waveListStr += "eBin_qxqy_MLR" + tagStr + ";" 432 waveListStr += "eBin_qxqy_FTB" + tagStr + ";" 433 waveListStr += "eBin_qxqy_FLR" + tagStr + ";" 434 435 // waveListStr = "eBin_qxqy_B;eBin_qxqy_MTB;eBin_qxqy_MLR;" 436 // waveListStr += "eBin_qxqy_FTB;eBin_qxqy_FLR;" 437 438 Concatenate/NP/O waveListStr, tmp_s 439 440 // sigma Q 441 waveListStr="" 442 if(!gIgnoreDetB) 443 waveListStr = "sigmaQ_qxqy_B" + tagStr + ";" 444 endif 445 waveListStr += "sigmaQ_qxqy_MTB" + tagStr + ";" 446 waveListStr += "sigmaQ_qxqy_MLR" + tagStr + ";" 447 waveListStr += "sigmaQ_qxqy_FTB" + tagStr + ";" 448 waveListStr += "sigmaQ_qxqy_FLR" + tagStr + ";" 449 450 // waveListStr = "sigmaQ_qxqy_B;sigmaQ_qxqy_MTB;sigmaQ_qxqy_MLR;" 451 // waveListStr += "sigmaQ_qxqy_FTB;sigmaQ_qxqy_FLR;" 452 453 Concatenate/NP/O waveListStr, tmp_sq 454 455 // Q bar 456 waveListStr="" 457 if(!gIgnoreDetB) 458 waveListStr = "qBar_qxqy_B" + tagStr + ";" 459 endif 460 waveListStr += "qBar_qxqy_MTB" + tagStr + ";" 461 waveListStr += "qBar_qxqy_MLR" + tagStr + ";" 462 waveListStr += "qBar_qxqy_FTB" + tagStr + ";" 463 waveListStr += "qBar_qxqy_FLR" + tagStr + ";" 464 465 // waveListStr = "qBar_qxqy_B;qBar_qxqy_MTB;qBar_qxqy_MLR;" 466 // waveListStr += "qBar_qxqy_FTB;qBar_qxqy_FLR;" 467 468 Concatenate/NP/O waveListStr, tmp_qb 469 470 // shadow fs 471 waveListStr="" 472 if(!gIgnoreDetB) 473 waveListStr = "fSubS_qxqy_B" + tagStr + ";" 474 endif 475 waveListStr += "fSubS_qxqy_MTB" + tagStr + ";" 476 waveListStr += "fSubS_qxqy_MLR" + tagStr + ";" 477 waveListStr += "fSubS_qxqy_FTB" + tagStr + ";" 478 waveListStr += "fSubS_qxqy_FLR" + tagStr + ";" 479 480 // waveListStr = "fSubS_qxqy_B;fSubS_qxqy_MTB;fSubS_qxqy_MLR;" 481 // waveListStr += "fSubS_qxqy_FTB;fSubS_qxqy_FLR;" 482 483 Concatenate/NP/O waveListStr, tmp_fs 484 485 endif 486 487 if(binType == 3) 488 // q-values 489 waveListStr="" 490 if(!gIgnoreDetB) 491 waveListStr = "qBin_qxqy_B" + tagStr + ";" 492 endif 493 waveListStr += "qBin_qxqy_MLRTB" + tagStr + ";" 494 waveListStr += "qBin_qxqy_FLRTB" + tagStr + ";" 495 496 // waveListStr = "qBin_qxqy_B;qBin_qxqy_MLRTB;qBin_qxqy_FLRTB;" 497 498 Concatenate/NP/O waveListStr, tmp_q 499 500 //intensity 501 waveListStr="" 502 if(!gIgnoreDetB) 503 waveListStr = "iBin_qxqy_B" + tagStr + ";" 504 endif 505 waveListStr += "iBin_qxqy_MLRTB" + tagStr + ";" 506 waveListStr += "iBin_qxqy_FLRTB" + tagStr + ";" 507 508 // waveListStr = "iBin_qxqy_B;iBin_qxqy_MLRTB;iBin_qxqy_FLRTB;" 509 510 Concatenate/NP/O waveListStr, tmp_i 511 512 //error 513 waveListStr="" 514 if(!gIgnoreDetB) 515 waveListStr = "eBin_qxqy_B" + tagStr + ";" 516 endif 517 waveListStr += "eBin_qxqy_MLRTB" + tagStr + ";" 518 waveListStr += "eBin_qxqy_FLRTB" + tagStr + ";" 519 520 // waveListStr = "eBin_qxqy_B;eBin_qxqy_MLRTB;eBin_qxqy_FLRTB;" 521 522 Concatenate/NP/O waveListStr, tmp_s 523 524 // sigma Q 525 waveListStr="" 526 if(!gIgnoreDetB) 527 waveListStr = "sigmaQ_qxqy_B" + tagStr + ";" 528 endif 529 waveListStr += "sigmaQ_qxqy_MLRTB" + tagStr + ";" 530 waveListStr += "sigmaQ_qxqy_FLRTB" + tagStr + ";" 531 532 // waveListStr = "sigmaQ_qxqy_B;sigmaQ_qxqy_MLRTB;sigmaQ_qxqy_FLRTB;" 533 534 Concatenate/NP/O waveListStr, tmp_sq 535 536 // Q bar 537 waveListStr="" 538 if(!gIgnoreDetB) 539 waveListStr = "qBar_qxqy_B" + tagStr + ";" 540 endif 541 waveListStr += "qBar_qxqy_MLRTB" + tagStr + ";" 542 waveListStr += "qBar_qxqy_FLRTB" + tagStr + ";" 543 544 // waveListStr = "qBar_qxqy_B;qBar_qxqy_MLRTB;qBar_qxqy_FLRTB;" 545 546 Concatenate/NP/O waveListStr, tmp_qb 547 548 // shadow fs 549 waveListStr="" 550 if(!gIgnoreDetB) 551 waveListStr = "fSubS_qxqy_B" + tagStr + ";" 552 endif 553 waveListStr += "fSubS_qxqy_MLRTB" + tagStr + ";" 554 waveListStr += "fSubS_qxqy_FLRTB" + tagStr + ";" 555 556 // waveListStr = "fSubS_qxqy_B;fSubS_qxqy_MLRTB;fSubS_qxqy_FLRTB;" 557 558 Concatenate/NP/O waveListStr, tmp_fs 559 endif 560 561 // TODO - This is the identical set of waves as for the case of binType = 1. 562 // they have the same names, but are averaged differently since it's slit mode. 563 // I have separated this, since in practice the TB panels are probably best to ignore 564 // and NOT include in the averaging since the Qy range is so limited. 565 if(binType == 4) 566 // q-values 567 waveListStr="" 568 if(!gIgnoreDetB) 569 waveListStr = "qBin_qxqy_B" + tagStr + ";" 570 endif 571 // waveListStr += "qBin_qxqy_MB" + tagStr + ";" 572 // waveListStr += "qBin_qxqy_MT" + tagStr + ";" 573 waveListStr += "qBin_qxqy_ML" + tagStr + ";" 574 waveListStr += "qBin_qxqy_MR" + tagStr + ";" 575 // waveListStr += "qBin_qxqy_FB" + tagStr + ";" 576 // waveListStr += "qBin_qxqy_FT" + tagStr + ";" 577 waveListStr += "qBin_qxqy_FL" + tagStr + ";" 578 waveListStr += "qBin_qxqy_FR" + tagStr + ";" 579 // waveListStr = "qBin_qxqy_B;qBin_qxqy_MB;qBin_qxqy_MT;qBin_qxqy_ML;qBin_qxqy_MR;" 580 // waveListStr += "qBin_qxqy_FB;qBin_qxqy_FT;qBin_qxqy_FL;qBin_qxqy_FR;" 581 582 Concatenate/NP/O waveListStr, tmp_q 583 584 //intensity 585 waveListStr="" 586 if(!gIgnoreDetB) 587 waveListStr = "iBin_qxqy_B" + tagStr + ";" 588 endif 589 // waveListStr += "iBin_qxqy_MB" + tagStr + ";" 590 // waveListStr += "iBin_qxqy_MT" + tagStr + ";" 591 waveListStr += "iBin_qxqy_ML" + tagStr + ";" 592 waveListStr += "iBin_qxqy_MR" + tagStr + ";" 593 // waveListStr += "iBin_qxqy_FB" + tagStr + ";" 594 // waveListStr += "iBin_qxqy_FT" + tagStr + ";" 595 waveListStr += "iBin_qxqy_FL" + tagStr + ";" 596 waveListStr += "iBin_qxqy_FR" + tagStr + ";" 597 // waveListStr = "iBin_qxqy_B;iBin_qxqy_MB;iBin_qxqy_MT;iBin_qxqy_ML;iBin_qxqy_MR;" 598 // waveListStr += "iBin_qxqy_FB;iBin_qxqy_FT;iBin_qxqy_FL;iBin_qxqy_FR;" 599 600 Concatenate/NP/O waveListStr, tmp_i 601 602 //error 603 waveListStr="" 604 if(!gIgnoreDetB) 605 waveListStr = "eBin_qxqy_B" + tagStr + ";" 606 endif 607 // waveListStr += "eBin_qxqy_MB" + tagStr + ";" 608 // waveListStr += "eBin_qxqy_MT" + tagStr + ";" 609 waveListStr += "eBin_qxqy_ML" + tagStr + ";" 610 waveListStr += "eBin_qxqy_MR" + tagStr + ";" 611 // waveListStr += "eBin_qxqy_FB" + tagStr + ";" 612 // waveListStr += "eBin_qxqy_FT" + tagStr + ";" 613 waveListStr += "eBin_qxqy_FL" + tagStr + ";" 614 waveListStr += "eBin_qxqy_FR" + tagStr + ";" 615 // waveListStr = "eBin_qxqy_B;eBin_qxqy_MB;eBin_qxqy_MT;eBin_qxqy_ML;eBin_qxqy_MR;" 616 // waveListStr += "eBin_qxqy_FB;eBin_qxqy_FT;eBin_qxqy_FL;eBin_qxqy_FR;" 617 618 Concatenate/NP/O waveListStr, tmp_s 619 620 //sigma Q 621 waveListStr="" 622 if(!gIgnoreDetB) 623 waveListStr = "sigmaQ_qxqy_B" + tagStr + ";" 624 endif 625 // waveListStr += "sigmaQ_qxqy_MB" + tagStr + ";" 626 // waveListStr += "sigmaQ_qxqy_MT" + tagStr + ";" 627 waveListStr += "sigmaQ_qxqy_ML" + tagStr + ";" 628 waveListStr += "sigmaQ_qxqy_MR" + tagStr + ";" 629 // waveListStr += "sigmaQ_qxqy_FB" + tagStr + ";" 630 // waveListStr += "sigmaQ_qxqy_FT" + tagStr + ";" 631 waveListStr += "sigmaQ_qxqy_FL" + tagStr + ";" 632 waveListStr += "sigmaQ_qxqy_FR" + tagStr + ";" 633 // waveListStr = "sigmaQ_qxqy_B;sigmaQ_qxqy_MB;sigmaQ_qxqy_MT;sigmaQ_qxqy_ML;sigmaQ_qxqy_MR;" 634 // waveListStr += "sigmaQ_qxqy_FB;sigmaQ_qxqy_FT;sigmaQ_qxqy_FL;sigmaQ_qxqy_FR;" 635 636 Concatenate/NP/O waveListStr, tmp_sq 637 638 //Q bar 639 waveListStr="" 640 if(!gIgnoreDetB) 641 waveListStr = "qBar_qxqy_B" + tagStr + ";" 642 endif 643 // waveListStr += "qBar_qxqy_MB" + tagStr + ";" 644 // waveListStr += "qBar_qxqy_MT" + tagStr + ";" 645 waveListStr += "qBar_qxqy_ML" + tagStr + ";" 646 waveListStr += "qBar_qxqy_MR" + tagStr + ";" 647 // waveListStr += "qBar_qxqy_FB" + tagStr + ";" 648 // waveListStr += "qBar_qxqy_FT" + tagStr + ";" 649 waveListStr += "qBar_qxqy_FL" + tagStr + ";" 650 waveListStr += "qBar_qxqy_FR" + tagStr + ";" 651 // waveListStr = "qBar_qxqy_B;qBar_qxqy_MB;qBar_qxqy_MT;qBar_qxqy_ML;qBar_qxqy_MR;" 652 // waveListStr += "qBar_qxqy_FB;qBar_qxqy_FT;qBar_qxqy_FL;qBar_qxqy_FR;" 653 654 Concatenate/NP/O waveListStr, tmp_qb 655 656 //shadow fs 657 waveListStr="" 658 if(!gIgnoreDetB) 659 waveListStr = "fSubS_qxqy_B" + tagStr + ";" 660 endif 661 // waveListStr += "fSubS_qxqy_MB" + tagStr + ";" 662 // waveListStr += "fSubS_qxqy_MT" + tagStr + ";" 663 waveListStr += "fSubS_qxqy_ML" + tagStr + ";" 664 waveListStr += "fSubS_qxqy_MR" + tagStr + ";" 665 // waveListStr += "fSubS_qxqy_FB" + tagStr + ";" 666 // waveListStr += "fSubS_qxqy_FT" + tagStr + ";" 667 waveListStr += "fSubS_qxqy_FL" + tagStr + ";" 668 waveListStr += "fSubS_qxqy_FR" + tagStr + ";" 669 // waveListStr = "fSubS_qxqy_B;fSubS_qxqy_MB;fSubS_qxqy_MT;fSubS_qxqy_ML;fSubS_qxqy_MR;" 670 // waveListStr += "fSubS_qxqy_FB;fSubS_qxqy_FT;fSubS_qxqy_FL;fSubS_qxqy_FR;" 671 672 Concatenate/NP/O waveListStr, tmp_fs 673 674 endif 379 675 380 676 381 // Can't kill here, since they are still needed to sort and write out! … … 711 416 712 417 713 // TODO 714 // (appears to be unused, in favor of the version that uses the global strings) 715 // needs: 716 // -- trim the beamstop out (based on shadow?) 717 // -- trim out zero q from the file (bad actor in analysis functions) 718 // -- trim num from the highQ end or lowQ end? 719 // -- splits the res wave into individual waves in anticipation of concatenation 720 // -- or -- deal with the res wave after? 721 // 722 // -- make a copy of the waves? 723 // -- then, what is the concatenate function looking for?? 724 // 725 Function V_Trim1DData(dataFolder,binType,nBeg,nEnd) 726 String dataFolder 727 Variable binType,nBeg,nEnd 728 729 Variable npt,ii 730 SetDataFolder $("root:Packages:NIST:VSANS:"+dataFolder) 731 732 Printf "%d points removed from beginning, %d points from the end (of each set) before concatenating\r",nbeg,nend 733 734 // for each binType block: 735 // declare the waves 736 // make a copy of the waves?? 737 // //Break out resolution wave into separate waves 738 // delete the beginning points from everything 739 // trim off the last nEnd points from everything 740 // DeletePoints num-nEnd,nEnd, qw,iw,sw 741 // // delete all points where the shadow is < 0.98 742 ////Put resolution contents back??? 743 744 if(binType == 1) 745 Wave/Z q_fb = qBin_qxqy_FB 746 Wave/Z q_ft = qBin_qxqy_FT 747 Wave/Z q_fl = qBin_qxqy_FL 748 Wave/Z q_fr = qBin_qxqy_FR 749 Wave/Z q_mb = qBin_qxqy_MB 750 Wave/Z q_mt = qBin_qxqy_MT 751 Wave/Z q_ml = qBin_qxqy_ML 752 Wave/Z q_mr = qBin_qxqy_MR 753 Wave/Z q_b = qBin_qxqy_B 754 755 Wave/Z i_fb = iBin_qxqy_FB 756 Wave/Z i_ft = iBin_qxqy_FT 757 Wave/Z i_fl = iBin_qxqy_FL 758 Wave/Z i_fr = iBin_qxqy_FR 759 Wave/Z i_mb = iBin_qxqy_MB 760 Wave/Z i_mt = iBin_qxqy_MT 761 Wave/Z i_ml = iBin_qxqy_ML 762 Wave/Z i_mr = iBin_qxqy_MR 763 Wave/Z i_b = iBin_qxqy_B 764 765 Wave/Z s_fb = eBin_qxqy_FB 766 Wave/Z s_ft = eBin_qxqy_FT 767 Wave/Z s_fl = eBin_qxqy_FL 768 Wave/Z s_fr = eBin_qxqy_FR 769 Wave/Z s_mb = eBin_qxqy_MB 770 Wave/Z s_mt = eBin_qxqy_MT 771 Wave/Z s_ml = eBin_qxqy_ML 772 Wave/Z s_mr = eBin_qxqy_MR 773 Wave/Z s_b = eBin_qxqy_B 774 775 776 777 DeletePoints 0,nBeg, q_fb,q_ft,q_fl,q_fr,q_mb,q_mt,q_ml,q_mr,q_b 778 DeletePoints 0,nBeg, i_fb,i_ft,i_fl,i_fr,i_mb,i_mt,i_ml,i_mr,i_b 779 DeletePoints 0,nBeg, s_fb,s_ft,s_fl,s_fr,s_mb,s_mt,s_ml,s_mr,s_b 780 //since each set may have a different number of points 781 npt = numpnts(q_fb) 782 DeletePoints npt-nEnd,nEnd, q_fb,i_fb,s_fb 783 784 npt = numpnts(q_ft) 785 DeletePoints npt-nEnd,nEnd, q_ft,i_ft,s_ft 786 787 npt = numpnts(q_fl) 788 DeletePoints npt-nEnd,nEnd, q_fl,i_fl,s_fl 789 790 npt = numpnts(q_fr) 791 DeletePoints npt-nEnd,nEnd, q_fr,i_fr,s_fr 792 793 npt = numpnts(q_mb) 794 DeletePoints npt-nEnd,nEnd, q_mb,i_mb,s_mb 795 796 npt = numpnts(q_mt) 797 DeletePoints npt-nEnd,nEnd, q_mt,i_mt,s_mt 798 799 npt = numpnts(q_ml) 800 DeletePoints npt-nEnd,nEnd, q_ml,i_ml,s_ml 801 802 npt = numpnts(q_mr) 803 DeletePoints npt-nEnd,nEnd, q_mr,i_mr,s_mr 804 805 npt = numpnts(q_b) 806 DeletePoints npt-nEnd,nEnd, q_b,i_b,s_b 807 808 endif 809 810 if(binType == 2) 811 Wave/Z q_ftb = qBin_qxqy_FTB 812 Wave/Z q_flr = qBin_qxqy_FLR 813 Wave/Z q_mtb = qBin_qxqy_MTB 814 Wave/Z q_mlr = qBin_qxqy_MLR 815 Wave/Z q_b = qBin_qxqy_B 816 817 Wave/Z i_ftb = iBin_qxqy_FTB 818 Wave/Z i_flr = iBin_qxqy_FLR 819 Wave/Z i_mtb = iBin_qxqy_MTB 820 Wave/Z i_mlr = iBin_qxqy_MLR 821 Wave/Z i_b = iBin_qxqy_B 822 823 Wave/Z s_ftb = eBin_qxqy_FTB 824 Wave/Z s_flr = eBin_qxqy_FLR 825 Wave/Z s_mtb = eBin_qxqy_MTB 826 Wave/Z s_mlr = eBin_qxqy_MLR 827 Wave/Z s_b = eBin_qxqy_B 828 829 830 DeletePoints 0,nBeg, q_ftb,q_flr,q_mtb,q_mlr,q_b 831 DeletePoints 0,nBeg, i_ftb,i_flr,i_mtb,i_mlr,i_b 832 DeletePoints 0,nBeg, s_ftb,s_flr,s_mtb,s_mlr,s_b 833 //since each set may have a different number of points 834 npt = numpnts(q_ftb) 835 DeletePoints npt-nEnd,nEnd, q_ftb,i_ftb,s_ftb 836 837 npt = numpnts(q_flr) 838 DeletePoints npt-nEnd,nEnd, q_flr,i_flr,s_flr 839 840 npt = numpnts(q_mtb) 841 DeletePoints npt-nEnd,nEnd, q_mtb,i_mtb,s_mtb 842 843 npt = numpnts(q_mlr) 844 DeletePoints npt-nEnd,nEnd, q_mlr,i_mlr,s_mlr 845 846 npt = numpnts(q_b) 847 DeletePoints npt-nEnd,nEnd, q_b,i_b,s_b 848 849 850 endif 851 852 if(binType == 3) 853 Wave/Z q_flrtb = qBin_qxqy_FLRTB 854 Wave/Z q_mlrtb = qBin_qxqy_MLRTB 855 Wave/Z q_b = qBin_qxqy_B 856 857 Wave/Z i_flrtb = iBin_qxqy_FLRTB 858 Wave/Z i_mlrtb = iBin_qxqy_MLRTB 859 Wave/Z i_b = iBin_qxqy_B 860 861 Wave/Z s_flrtb = eBin_qxqy_FLRTB 862 Wave/Z s_mlrtb = eBin_qxqy_MLRTB 863 Wave/Z s_b = eBin_qxqy_B 864 865 DeletePoints 0,nBeg, q_flrtb,q_mlrtb,q_b 866 DeletePoints 0,nBeg, i_flrtb,i_mlrtb,i_b 867 DeletePoints 0,nBeg, s_flrtb,s_mlrtb,s_b 868 //since each set may have a different number of points 869 npt = numpnts(q_flrtb) 870 DeletePoints npt-nEnd,nEnd, q_flrtb,i_flrtb,s_flrtb 871 872 npt = numpnts(q_mlrtb) 873 DeletePoints npt-nEnd,nEnd, q_mlrtb,i_mlrtb,s_mlrtb 874 875 npt = numpnts(q_b) 876 DeletePoints npt-nEnd,nEnd, q_b,i_b,s_b 877 878 endif 879 880 // TODO - This is the identical set of waves as for the case of binType = 1. 881 // they have the same names, but are averaged differently since it's slit mode. 882 // I have separated this, since in practice the TB panels are probably best to ignore 883 // and NOT include in the averaging since the Qy range is so limited. 884 if(binType == 4) 885 Wave/Z q_fb = qBin_qxqy_FB 886 Wave/Z q_ft = qBin_qxqy_FT 887 Wave/Z q_fl = qBin_qxqy_FL 888 Wave/Z q_fr = qBin_qxqy_FR 889 Wave/Z q_mb = qBin_qxqy_MB 890 Wave/Z q_mt = qBin_qxqy_MT 891 Wave/Z q_ml = qBin_qxqy_ML 892 Wave/Z q_mr = qBin_qxqy_MR 893 Wave/Z q_b = qBin_qxqy_B 894 895 Wave/Z i_fb = iBin_qxqy_FB 896 Wave/Z i_ft = iBin_qxqy_FT 897 Wave/Z i_fl = iBin_qxqy_FL 898 Wave/Z i_fr = iBin_qxqy_FR 899 Wave/Z i_mb = iBin_qxqy_MB 900 Wave/Z i_mt = iBin_qxqy_MT 901 Wave/Z i_ml = iBin_qxqy_ML 902 Wave/Z i_mr = iBin_qxqy_MR 903 Wave/Z i_b = iBin_qxqy_B 904 905 Wave/Z s_fb = eBin_qxqy_FB 906 Wave/Z s_ft = eBin_qxqy_FT 907 Wave/Z s_fl = eBin_qxqy_FL 908 Wave/Z s_fr = eBin_qxqy_FR 909 Wave/Z s_mb = eBin_qxqy_MB 910 Wave/Z s_mt = eBin_qxqy_MT 911 Wave/Z s_ml = eBin_qxqy_ML 912 Wave/Z s_mr = eBin_qxqy_MR 913 Wave/Z s_b = eBin_qxqy_B 914 915 DeletePoints 0,nBeg, q_fb,q_ft,q_fl,q_fr,q_mb,q_mt,q_ml,q_mr,q_b 916 DeletePoints 0,nBeg, i_fb,i_ft,i_fl,i_fr,i_mb,i_mt,i_ml,i_mr,i_b 917 DeletePoints 0,nBeg, s_fb,s_ft,s_fl,s_fr,s_mb,s_mt,s_ml,s_mr,s_b 918 //since each set may have a different number of points 919 npt = numpnts(q_fb) 920 DeletePoints npt-nEnd,nEnd, q_fb,i_fb,s_fb 921 922 npt = numpnts(q_ft) 923 DeletePoints npt-nEnd,nEnd, q_ft,i_ft,s_ft 924 925 npt = numpnts(q_fl) 926 DeletePoints npt-nEnd,nEnd, q_fl,i_fl,s_fl 927 928 npt = numpnts(q_fr) 929 DeletePoints npt-nEnd,nEnd, q_fr,i_fr,s_fr 930 931 npt = numpnts(q_mb) 932 DeletePoints npt-nEnd,nEnd, q_mb,i_mb,s_mb 933 934 npt = numpnts(q_mt) 935 DeletePoints npt-nEnd,nEnd, q_mt,i_mt,s_mt 936 937 npt = numpnts(q_ml) 938 DeletePoints npt-nEnd,nEnd, q_ml,i_ml,s_ml 939 940 npt = numpnts(q_mr) 941 DeletePoints npt-nEnd,nEnd, q_mr,i_mr,s_mr 942 943 npt = numpnts(q_b) 944 DeletePoints npt-nEnd,nEnd, q_b,i_b,s_b 945 946 endif 947 948 SetDataFolder root: 949 return(0) 950 end 951 952 953 954 / 418 // 955 419 Proc V_Load_Data_ITX() 956 420 V_Load_itx("","",0,0) … … 1050 514 // Duplicate/O $("root:"+n2), $w2 1051 515 1052 516 // no resolution matrix to make 1053 517 1054 518 … … 1056 520 End 1057 521 522 523 524 // string function to select the correct string constant 525 // that corresponds to the selected binType. This string constant 526 // contains the list of extensions to be used for plotting, saving, etc. 527 // 528 // returns null string if no match 529 // 530 Function/S V_getBinTypeString(binType) 531 Variable binType 532 533 String detListStr="" 534 if(binType == 1) 535 detListStr = ksBinType1 536 endif 537 if(binType == 2) 538 detListStr = ksBinType2 539 endif 540 if(binType == 3) 541 detListStr = ksBinType3 542 endif 543 if(binType == 4) 544 detListStr = ksBinType4 545 endif 546 if(binType == 5) 547 detListStr = ksBinType5 548 endif 549 if(binType == 6) 550 detListStr = ksBinType6 551 endif 552 if(binType == 7) 553 detListStr = ksBinType7 554 endif 555 556 557 return(detListStr) 558 End 1058 559 1059 560 // given strings of the number of points to remove, loop over the detectors … … 1067 568 String nBegStr,nEndStr 1068 569 1069 String detListStr 1070 if(binType == 1) 1071 detListStr = ksBinType1 1072 endif 1073 if(binType == 2) 1074 detListStr = ksBinType2 1075 endif 1076 if(binType == 3) 1077 detListStr = ksBinType3 1078 endif 1079 if(binType == 4) 1080 detListStr = ksBinType4 1081 endif 570 String detListStr="" 571 572 detListStr = V_getBinTypeString(binType) //the list of extensions 1082 573 if(strlen(detListStr)==0) 1083 574 return(0)
Note: See TracChangeset
for help on using the changeset viewer.