Changeset 1097
- Timestamp:
- Apr 24, 2018 3:55:39 PM (4 years ago)
- Location:
- sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS
- Files:
-
- 1 added
- 14 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_DetectorBinning_Q.ipf
r1095 r1097 477 477 478 478 String folderStr = "VCALC" 479 String collimationStr="pinhole" // TODO: read this from the VCALC panel 479 480 480 481 switch(binType) 481 482 case 1: 482 VC_fDoBinning_QxQy2D(folderStr,"FL" )483 VC_fDoBinning_QxQy2D(folderStr,"FR" )484 VC_fDoBinning_QxQy2D(folderStr,"FT" )485 VC_fDoBinning_QxQy2D(folderStr,"FB" )483 VC_fDoBinning_QxQy2D(folderStr,"FL",collimationStr) 484 VC_fDoBinning_QxQy2D(folderStr,"FR",collimationStr) 485 VC_fDoBinning_QxQy2D(folderStr,"FT",collimationStr) 486 VC_fDoBinning_QxQy2D(folderStr,"FB",collimationStr) 486 487 // VC_fDoBinning_QxQy2D(folderStr,"ML") 487 488 // VC_fDoBinning_QxQy2D(folderStr,"MR") … … 492 493 break 493 494 case 2: 494 VC_fDoBinning_QxQy2D(folderStr,"FLR" )495 VC_fDoBinning_QxQy2D(folderStr,"FTB" )495 VC_fDoBinning_QxQy2D(folderStr,"FLR",collimationStr) 496 VC_fDoBinning_QxQy2D(folderStr,"FTB",collimationStr) 496 497 // VC_fDoBinning_QxQy2D(folderStr,"MLR") 497 498 // VC_fDoBinning_QxQy2D(folderStr,"MTB") … … 501 502 case 3: 502 503 // VC_fDoBinning_QxQy2D(folderStr,"MLRTB") 503 VC_fDoBinning_QxQy2D(folderStr,"FLRTB" )504 VC_fDoBinning_QxQy2D(folderStr,"FLRTB",collimationStr) 504 505 // VC_fDoBinning_QxQy2D(folderStr, "B") 505 506 … … 514 515 break 515 516 case 5: 516 VC_fDoBinning_QxQy2D(folderStr,"FTB" )517 VC_fDoBinning_QxQy2D(folderStr,"FLR" )517 VC_fDoBinning_QxQy2D(folderStr,"FTB",collimationStr) 518 VC_fDoBinning_QxQy2D(folderStr,"FLR",collimationStr) 518 519 // VC_fDoBinning_QxQy2D(folderStr,"MLRTB") 519 520 // VC_fDoBinning_QxQy2D(folderStr, "B") … … 521 522 break 522 523 case 6: 523 VC_fDoBinning_QxQy2D(folderStr,"FLRTB" )524 VC_fDoBinning_QxQy2D(folderStr,"FLRTB",collimationStr) 524 525 // VC_fDoBinning_QxQy2D(folderStr,"MLR") 525 526 // VC_fDoBinning_QxQy2D(folderStr, "B") … … 527 528 break 528 529 case 7: 529 VC_fDoBinning_QxQy2D(folderStr,"FTB" )530 VC_fDoBinning_QxQy2D(folderStr,"FLR" )530 VC_fDoBinning_QxQy2D(folderStr,"FTB",collimationStr) 531 VC_fDoBinning_QxQy2D(folderStr,"FLR",collimationStr) 531 532 // VC_fDoBinning_QxQy2D(folderStr,"MLR") 532 533 // VC_fDoBinning_QxQy2D(folderStr, "B") … … 956 957 957 958 String folderStr = "VCALC" 959 String collimationStr="pinhole" // TODO: fill this in from the VCALC panel 958 960 959 961 switch(binType) … … 963 965 // VC_fDoBinning_QxQy2D(folderStr,"FT") 964 966 // VC_fDoBinning_QxQy2D(folderStr,"FB") 965 VC_fDoBinning_QxQy2D(folderStr,"ML" )966 VC_fDoBinning_QxQy2D(folderStr,"MR" )967 VC_fDoBinning_QxQy2D(folderStr,"MT" )968 VC_fDoBinning_QxQy2D(folderStr,"MB" )967 VC_fDoBinning_QxQy2D(folderStr,"ML",collimationStr) 968 VC_fDoBinning_QxQy2D(folderStr,"MR",collimationStr) 969 VC_fDoBinning_QxQy2D(folderStr,"MT",collimationStr) 970 VC_fDoBinning_QxQy2D(folderStr,"MB",collimationStr) 969 971 // VC_fDoBinning_QxQy2D(folderStr, "B") 970 972 … … 973 975 // VC_fDoBinning_QxQy2D(folderStr,"FLR") 974 976 // VC_fDoBinning_QxQy2D(folderStr,"FTB") 975 VC_fDoBinning_QxQy2D(folderStr,"MLR" )976 VC_fDoBinning_QxQy2D(folderStr,"MTB" )977 VC_fDoBinning_QxQy2D(folderStr,"MLR",collimationStr) 978 VC_fDoBinning_QxQy2D(folderStr,"MTB",collimationStr) 977 979 // VC_fDoBinning_QxQy2D(folderStr, "B") 978 980 979 981 break 980 982 case 3: 981 VC_fDoBinning_QxQy2D(folderStr,"MLRTB" )983 VC_fDoBinning_QxQy2D(folderStr,"MLRTB",collimationStr) 982 984 // VC_fDoBinning_QxQy2D(folderStr,"FLRTB") 983 985 // VC_fDoBinning_QxQy2D(folderStr, "B") … … 995 997 // VC_fDoBinning_QxQy2D(folderStr,"FTB") 996 998 // VC_fDoBinning_QxQy2D(folderStr,"FLR") 997 VC_fDoBinning_QxQy2D(folderStr,"MLRTB" )999 VC_fDoBinning_QxQy2D(folderStr,"MLRTB",collimationStr) 998 1000 // VC_fDoBinning_QxQy2D(folderStr, "B") 999 1001 … … 1001 1003 case 6: 1002 1004 // VC_fDoBinning_QxQy2D(folderStr,"FLRTB") 1003 VC_fDoBinning_QxQy2D(folderStr,"MLR" )1005 VC_fDoBinning_QxQy2D(folderStr,"MLR",collimationStr) 1004 1006 // VC_fDoBinning_QxQy2D(folderStr, "B") 1005 1007 … … 1008 1010 // VC_fDoBinning_QxQy2D(folderStr,"FTB") 1009 1011 // VC_fDoBinning_QxQy2D(folderStr,"FLR") 1010 VC_fDoBinning_QxQy2D(folderStr,"MLR" )1012 VC_fDoBinning_QxQy2D(folderStr,"MLR",collimationStr) 1011 1013 // VC_fDoBinning_QxQy2D(folderStr, "B") 1012 1014 … … 1359 1361 1360 1362 String folderStr = "VCALC" 1363 String collimationStr="pinhole" // TODO: fill this in from the VCALC panel 1361 1364 1362 1365 switch(binType) … … 1370 1373 // VC_fDoBinning_QxQy2D(folderStr,"MT") 1371 1374 // VC_fDoBinning_QxQy2D(folderStr,"MB") 1372 VC_fDoBinning_QxQy2D(folderStr, "B" )1375 VC_fDoBinning_QxQy2D(folderStr, "B",collimationStr) 1373 1376 1374 1377 break … … 1378 1381 // VC_fDoBinning_QxQy2D(folderStr,"MLR") 1379 1382 // VC_fDoBinning_QxQy2D(folderStr,"MTB") 1380 VC_fDoBinning_QxQy2D(folderStr, "B" )1383 VC_fDoBinning_QxQy2D(folderStr, "B",collimationStr) 1381 1384 1382 1385 break … … 1384 1387 // VC_fDoBinning_QxQy2D(folderStr,"MLRTB") 1385 1388 // VC_fDoBinning_QxQy2D(folderStr,"FLRTB") 1386 VC_fDoBinning_QxQy2D(folderStr, "B" )1389 VC_fDoBinning_QxQy2D(folderStr, "B",collimationStr) 1387 1390 1388 1391 break … … 1399 1402 // VC_fDoBinning_QxQy2D(folderStr,"FLR") 1400 1403 // VC_fDoBinning_QxQy2D(folderStr,"MLRTB") 1401 VC_fDoBinning_QxQy2D(folderStr, "B" )1404 VC_fDoBinning_QxQy2D(folderStr, "B",collimationStr) 1402 1405 1403 1406 break … … 1405 1408 // VC_fDoBinning_QxQy2D(folderStr,"FLRTB") 1406 1409 // VC_fDoBinning_QxQy2D(folderStr,"MLR") 1407 VC_fDoBinning_QxQy2D(folderStr, "B" )1410 VC_fDoBinning_QxQy2D(folderStr, "B",collimationStr) 1408 1411 1409 1412 break … … 1412 1415 // VC_fDoBinning_QxQy2D(folderStr,"FLR") 1413 1416 // VC_fDoBinning_QxQy2D(folderStr,"MLR") 1414 VC_fDoBinning_QxQy2D(folderStr, "B" )1417 VC_fDoBinning_QxQy2D(folderStr, "B",collimationStr) 1415 1418 1416 1419 break -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_DetectorBinning_Utils.ipf
r1095 r1097 785 785 // 786 786 // folderStr = WORK folder, type = the binning type (may include multiple detectors) 787 Function VC_fDoBinning_QxQy2D(folderStr,type )788 String folderStr,type 787 Function VC_fDoBinning_QxQy2D(folderStr,type,collimationStr) 788 String folderStr,type,collimationStr 789 789 790 790 Variable nSets = 0 … … 1480 1480 // 1481 1481 1482 1483 ii=0 1484 do 1485 V_getResolution(qBin_qxqy[ii],lambda,lambdaWidth,DDet,apOff,S1,S2,L1,L2,BS,del_r,usingLenses,ret1,ret2,ret3) 1486 sigmaq[ii] = ret1 1487 qbar[ii] = ret2 1488 fsubs[ii] = ret3 1489 ii+=1 1490 while(ii<nq) 1491 1492 1493 1482 // possible values are: 1483 // 1484 // pinhole 1485 // pinhole_whiteBeam 1486 // narrowSlit 1487 // narrowSlit_whiteBeam 1488 // convergingPinholes 1489 1490 if(cmpstr(collimationStr,"pinhole") == 0) 1491 1492 ii=0 1493 do 1494 V_getResolution(qBin_qxqy[ii],lambda,lambdaWidth,DDet,apOff,S1,S2,L1,L2,BS,del_r,usingLenses,ret1,ret2,ret3) 1495 sigmaq[ii] = ret1 1496 qbar[ii] = ret2 1497 fsubs[ii] = ret3 1498 ii+=1 1499 while(ii<nq) 1500 1501 endif 1502 1503 1504 if(cmpstr(collimationStr,"pinhole_whiteBeam") == 0) 1505 1506 // set lambdaWidth == 0 so that the gaussian resolution calculates only the geometry contribution. 1507 // the white beam distribution will need to be flagged some other way 1508 // 1509 lambdaWidth = 0 1510 1511 ii=0 1512 do 1513 V_getResolution(qBin_qxqy[ii],lambda,lambdaWidth,DDet,apOff,S1,S2,L1,L2,BS,del_r,usingLenses,ret1,ret2,ret3) 1514 sigmaq[ii] = ret1 1515 qbar[ii] = ret2 1516 fsubs[ii] = ret3 1517 ii+=1 1518 while(ii<nq) 1519 1520 endif 1521 1522 if(cmpstr(collimationStr,"convergingPinholes") == 0) 1523 1524 // set usingLenses == 1 so that the Gaussian resolution calculation will be for a focus condition 1525 // 1526 usingLenses = 1 1527 1528 ii=0 1529 do 1530 V_getResolution(qBin_qxqy[ii],lambda,lambdaWidth,DDet,apOff,S1,S2,L1,L2,BS,del_r,usingLenses,ret1,ret2,ret3) 1531 sigmaq[ii] = ret1 1532 qbar[ii] = ret2 1533 fsubs[ii] = ret3 1534 ii+=1 1535 while(ii<nq) 1536 1537 endif 1538 1494 1539 SetDataFolder root: 1495 1540 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_VCALCPanel_MockUp.ipf
r1093 r1097 335 335 workTypeStr = "root:Packages:NIST:VSANS:"+type 336 336 337 String collimationStr = "pinhole" //TODO: fill this in from the VCALC panel 338 337 339 // dispatch based on the string, not on the number of selection in the pop string 338 V_QBinAllPanels_Circular(type,V_BinTypeStr2Num(popStr) )340 V_QBinAllPanels_Circular(type,V_BinTypeStr2Num(popStr),collimationStr) 339 341 340 342 sprintf str,"(\"%s\",%d,\"%s\")",workTypeStr,V_BinTypeStr2Num(popStr),winStr -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VSANS_Includes.ipf
r1095 r1097 124 124 #include "V_GaussSpheres_WB" 125 125 126 #include "V_Utilities_Comparisons" 126 127 127 128 128 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Combine_1D.ipf
r1080 r1097 222 222 // 223 223 SVAR dispType = root:Packages:NIST:VSANS:Globals:gCurDispType 224 224 String collimationStr="pinhole" //TODO: where do I get this information from ? does it matter here? 225 225 226 226 // dispatch based on the string, not on the number of selection in the pop string 227 V_QBinAllPanels_Circular(dispType,binType )227 V_QBinAllPanels_Circular(dispType,binType,collimationStr) 228 228 229 229 String workTypeStr -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_DataPlotting.ipf
r1081 r1097 409 409 410 410 // dispatch based on the string, not on the number of selection in the pop string 411 V_QBinAllPanels_Circular(type,V_BinTypeStr2Num(popStr)) 411 variable binType = V_BinTypeStr2Num(popStr) 412 String collimationStr="pinhole" //TODO: where do I get this information from ? does it matter here? 413 if(binType == 4) 414 // narrow slits 415 V_QBinAllPanels_Slit(type,binType) 416 else 417 V_QBinAllPanels_Circular(type,binType,collimationStr) 418 endif 419 412 420 413 421 String str,winStr="V_1D_Data",workTypeStr -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_HDF5_Read.ipf
r1094 r1097 28 28 end 29 29 30 //Function/S proto_V_get_STR(str)31 //String str32 //return("")33 //end30 Function/S proto_V_get_STR(str) 31 String str 32 return("") 33 end 34 34 35 35 Proc Dump_V_getFP(fname) -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_IQ_Annular.ipf
r1095 r1097 79 79 End 80 80 81 ProcV_Phi_Graph_Proc(folderStr,detGroup)81 Function V_Phi_Graph_Proc(folderStr,detGroup) 82 82 String folderStr,detGroup 83 83 … … 96 96 97 97 if(cmpstr(detGroup,"F") == 0) 98 wave iPhiBin_qxqy_FLRTB=iPhiBin_qxqy_FLRTB 99 wave phiBin_qxqy_FLRTB=phiBin_qxqy_FLRTB 100 wave ePhiBin_qxqy_FLRTB=ePhiBin_qxqy_FLRTB 101 98 102 AppendToGraph iPhiBin_qxqy_FLRTB vs phiBin_qxqy_FLRTB 99 103 // Display /W=(35,45,572,419)/N=V_Phi_Graph /K=1 iPhiBin_qxqy_FLRTB vs phiBin_qxqy_FLRTB … … 106 110 endif 107 111 if(cmpstr(detGroup,"M") == 0) 112 wave iPhiBin_qxqy_MLRTB=iPhiBin_qxqy_MLRTB 113 wave phiBin_qxqy_MLRTB=phiBin_qxqy_MLRTB 114 wave ePhiBin_qxqy_MLRTB=ePhiBin_qxqy_MLRTB 115 108 116 AppendToGraph iPhiBin_qxqy_MLRTB vs phiBin_qxqy_MLRTB 109 117 ModifyGraph mode=4 … … 115 123 endif 116 124 if(cmpstr(detGroup,"B") == 0) 125 wave iPhiBin_qxqy_B=iPhiBin_qxqy_B 126 wave phiBin_qxqy_B=phiBin_qxqy_B 127 wave ePhiBin_qxqy_B=ePhiBin_qxqy_B 128 117 129 AppendToGraph iPhiBin_qxqy_B vs phiBin_qxqy_B 118 130 ModifyGraph mode=4 … … 718 730 String dataSetFolderParent,basestr 719 731 732 SVAR gProtoStr = root:Packages:NIST:VSANS:Globals:Protocols:gProtoStr 733 Wave/T proto=$("root:Packages:NIST:VSANS:Globals:Protocols:"+gProtoStr) 734 735 SVAR samFiles = root:Packages:NIST:VSANS:Globals:Protocols:gSAM 736 720 737 //make sure the waves exist 721 738 722 739 if(WaveExists(pw) == 0) 723 740 SetDataFolder root: 724 Abort " qis missing"741 Abort "phi is missing" 725 742 endif 726 743 if(WaveExists(iw) == 0) … … 732 749 Abort "s is missing" 733 750 endif 751 if(WaveExists(proto) == 0) 752 SetDataFolder root: 753 Abort "protocol information is missing." 754 endif 734 755 // if(WaveExists(resw) == 0) 756 // SetDataFolder root: 735 757 // Abort "Resolution information is missing." 736 758 // endif … … 755 777 // 756 778 779 780 // no beg/end trimming is used for annular data 781 782 //// if the "default" trimming is used, the proto[] values will be null 783 //// fill them in with the default values 784 // String protoStr7,protoStr8 785 // if(strlen(proto[7]) == 0) 786 // protoStr7 = "(Default) "+ ksBinTrimBegDefault 787 // else 788 // protoStr7 = proto[7] 789 // endif 790 // if(strlen(proto[8]) == 0) 791 // protoStr8 = "(Default) "+ ksBinTrimEndDefault 792 // else 793 // protoStr8 = proto[8] 794 // endif 795 796 797 757 798 PathInfo catPathName 758 799 fullPath = S_Path + saveName … … 761 802 762 803 fprintf refnum,"Annular data written from folder %s on %s\r\n",folderStr,(date()+" "+time()) 804 805 806 //insert protocol information here 807 //-1 list of sample files 808 //0 - bkg 809 //1 - emp 810 //2 - div 811 //3 - mask 812 //4 - abs params c2-c5 813 //5 - average params 814 //6 - DRK (unused in VSANS) 815 //7 - beginning trim points 816 //8 - end trim points 817 fprintf refnum, "SAM: %s\r\n",samFiles 818 fprintf refnum, "BGD: %s\r\n",proto[0] 819 fprintf refnum, "EMP: %s\r\n",Proto[1] 820 fprintf refnum, "DIV: %s\r\n",Proto[2] 821 fprintf refnum, "MASK: %s\r\n",Proto[3] 822 fprintf refnum, "ABS Parameters (3-6): %s\r\n",Proto[4] 823 fprintf refnum, "Average Choices: %s\r\n",Proto[5] 824 // fprintf refnum, "Beginning Trim Points: %s\r\n",ProtoStr7 825 // fprintf refnum, "End Trim Points: %s\r\n",ProtoStr8 826 763 827 764 828 // TODO -- make this work for 6-columns (or??) -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_IQ_Utilities.ipf
r1095 r1097 92 92 // -- AND need to write the routine for binning_SlitMode 93 93 // 94 Function V_QBinAllPanels_Circular(folderStr,binType )94 Function V_QBinAllPanels_Circular(folderStr,binType,collimationStr) 95 95 String folderStr 96 96 Variable binType 97 String collimationStr 97 98 98 99 // do the back, middle, and front separately … … 114 115 switch(binType) 115 116 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" )117 VC_fDoBinning_QxQy2D(folderStr,"FL",collimationStr) 118 VC_fDoBinning_QxQy2D(folderStr,"FR",collimationStr) 119 VC_fDoBinning_QxQy2D(folderStr,"FT",collimationStr) 120 VC_fDoBinning_QxQy2D(folderStr,"FB",collimationStr) 121 VC_fDoBinning_QxQy2D(folderStr,"ML",collimationStr) 122 VC_fDoBinning_QxQy2D(folderStr,"MR",collimationStr) 123 VC_fDoBinning_QxQy2D(folderStr,"MT",collimationStr) 124 VC_fDoBinning_QxQy2D(folderStr,"MB",collimationStr) 125 VC_fDoBinning_QxQy2D(folderStr, "B",collimationStr) 125 126 126 127 break 127 128 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" )129 VC_fDoBinning_QxQy2D(folderStr,"FLR",collimationStr) 130 VC_fDoBinning_QxQy2D(folderStr,"FTB",collimationStr) 131 VC_fDoBinning_QxQy2D(folderStr,"MLR",collimationStr) 132 VC_fDoBinning_QxQy2D(folderStr,"MTB",collimationStr) 133 VC_fDoBinning_QxQy2D(folderStr, "B",collimationStr) 133 134 134 135 break 135 136 case 3: 136 VC_fDoBinning_QxQy2D(folderStr,"MLRTB" )137 VC_fDoBinning_QxQy2D(folderStr,"FLRTB" )138 VC_fDoBinning_QxQy2D(folderStr, "B" )137 VC_fDoBinning_QxQy2D(folderStr,"MLRTB",collimationStr) 138 VC_fDoBinning_QxQy2D(folderStr,"FLRTB",collimationStr) 139 VC_fDoBinning_QxQy2D(folderStr, "B",collimationStr) 139 140 140 141 break … … 148 149 break 149 150 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" )151 VC_fDoBinning_QxQy2D(folderStr,"FTB",collimationStr) 152 VC_fDoBinning_QxQy2D(folderStr,"FLR",collimationStr) 153 VC_fDoBinning_QxQy2D(folderStr,"MLRTB",collimationStr) 154 VC_fDoBinning_QxQy2D(folderStr, "B",collimationStr) 154 155 155 156 break 156 157 case 6: 157 VC_fDoBinning_QxQy2D(folderStr,"FLRTB" )158 VC_fDoBinning_QxQy2D(folderStr,"MLR" )159 VC_fDoBinning_QxQy2D(folderStr, "B" )158 VC_fDoBinning_QxQy2D(folderStr,"FLRTB",collimationStr) 159 VC_fDoBinning_QxQy2D(folderStr,"MLR",collimationStr) 160 VC_fDoBinning_QxQy2D(folderStr, "B",collimationStr) 160 161 161 162 break 162 163 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" )164 VC_fDoBinning_QxQy2D(folderStr,"FTB",collimationStr) 165 VC_fDoBinning_QxQy2D(folderStr,"FLR",collimationStr) 166 VC_fDoBinning_QxQy2D(folderStr,"MLR",collimationStr) 167 VC_fDoBinning_QxQy2D(folderStr, "B",collimationStr) 167 168 168 169 break … … 175 176 return(0) 176 177 End 178 179 180 // 181 // TODO -- binType == 4 (slit mode) should be the only case to end up here 182 // -- new logic in calling routines to dispatch to proper routine 183 // -- AND need to write the routine for binning_SlitMode 184 // 185 Function V_QBinAllPanels_Slit(folderStr,binType) 186 String folderStr 187 Variable binType 188 189 // do the back, middle, and front separately 190 191 // figure out the binning type (where is it set?) 192 Variable ii,delQ 193 String detStr 194 195 // binType = V_GetBinningPopMode() 196 197 // set delta Q for binning (used later inside VC_fDoBinning_QxQy2D) 198 for(ii=0;ii<ItemsInList(ksDetectorListAll);ii+=1) 199 detStr = StringFromList(ii, ksDetectorListAll, ";") 200 201 delQ = V_SetDeltaQ(folderStr,detStr) // this sets (overwrites) the global value for each panel type 202 endfor 203 204 205 switch(binType) 206 case 1: 207 208 break 209 case 2: 210 211 break 212 case 3: 213 214 break 215 case 4: /// this is for a tall, narrow slit mode 216 VC_fBinDetector_byRows(folderStr,"FL") 217 VC_fBinDetector_byRows(folderStr,"FR") 218 VC_fBinDetector_byRows(folderStr,"ML") 219 VC_fBinDetector_byRows(folderStr,"MR") 220 VC_fBinDetector_byRows(folderStr,"B") 221 222 break 223 case 5: 224 225 break 226 case 6: 227 228 break 229 case 7: 230 231 break 232 233 default: 234 Abort "Binning mode not found in V_QBinAllPanels_Slit"// when no case matches 235 endswitch 236 237 238 return(0) 239 End 240 241 177 242 178 243 // concatenates and sorts the 1D data in "type" WORK folder -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Marquee_Operations.ipf
r1094 r1097 348 348 y2 = V_top 349 349 350 // Print x1,x2,y1,y2 351 350 352 // NOTE: 351 353 // this function MODIFIES x and y values on return, converting them to panel coordinates … … 359 361 sprintf boxStr,"%d;%d;%d;%d;",x1,x2,y1,y2 360 362 363 // Print x1,x2,y1,y2 364 361 365 SVAR gCurrentFile = root:Packages:NIST:VSANS:Globals:gLastLoadedFile //for the status of the display 362 366 … … 369 373 // Print "err/counts = ",ct_err/count 370 374 371 endif 372 End 375 // kill the file from RawVSANS so that the updated box coordinates will be re-read in 376 // 377 V_KillNamedDataFolder(gCurrentFile) 378 endif 379 End -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Protocol_Reduction.ipf
r1095 r1097 782 782 newList = V_RemoveEXTFromList(newlist,"ave") // remove the ave files 783 783 newList = V_RemoveEXTFromList(newlist,"abs") // remove the abs files 784 newList = V_RemoveEXTFromList(newlist,"phi") // remove the phi files 784 785 newList = V_RemoveEXTFromList(newlist,"pxp") // remove the pxp files 785 786 newList = V_RemoveEXTFromList(newlist,"DS_Store") // remove the DS_Store file (OSX only) … … 828 829 newList = V_RemoveEXTFromList(newlist,"ave") // remove the ave files 829 830 newList = V_RemoveEXTFromList(newlist,"abs") // remove the abs files 831 newList = V_RemoveEXTFromList(newlist,"phi") // remove the phi files 830 832 newList = V_RemoveEXTFromList(newlist,"pxp") // remove the pxp files 831 833 newList = V_RemoveEXTFromList(newlist,"DS_Store") // remove the DS_Store file (OSX only) … … 1285 1287 1286 1288 // Prompt av_typ, "Type of Average",popup,"Circular;Sector;Rectangular;Annular;2D_ASCII;QxQy_ASCII;PNG_Graphic;Sector_PlusMinus;" 1287 Prompt av_typ, "Type of Average",popup,"Circular; Annular;"1289 Prompt av_typ, "Type of Average",popup,"Circular;Narrow_Slit;Annular;" 1288 1290 1289 1291 // comment out above line in DEMO_MODIFIED version, and uncomment the line below (to disable PNG save) … … 1308 1310 // TODO: 1309 1311 // hard wired value 1310 String autoPlot = " No"1312 String autoPlot = "Yes" 1311 1313 1312 1314 … … 2309 2311 Endif 2310 2312 2311 //convert the folder to linear scale before averaging, then revert by calling the window hook 2312 // (not needed for VSANS, data is always linear scale) 2313 2314 // bin and plot the data 2315 2313 //convert the folder to linear scale before averaging, then revert by calling the window hook 2314 // (not needed for VSANS, data is always linear scale) 2315 2316 2316 // 2317 2317 // x- need to convert BINTYPE keyword into a numerical value to pass … … 2333 2333 endif 2334 2334 2335 2336 // identify the collimation type 2337 // this will be a string used to determine how the resolution information is to be calculated 2338 // and written to the reduced data file 2339 // 2340 // possible values are: 2341 // 2342 // pinhole 2343 // pinhole_whiteBeam 2344 // narrowSlit 2345 // narrowSlit_whiteBeam 2346 // convergingPinholes 2347 // 2348 2349 String collimationStr 2350 collimationStr = V_IdentifyCollimation(activeType) 2351 2352 2353 2354 //////////////////////////////////////// 2355 // dispatch to averaging and resolution 2356 ///////////////////////////////////////// 2335 2357 // 2336 2358 // TODO: … … 2348 2370 case "none": 2349 2371 //still do nothing 2372 // set binType and binTypeStr to bad flags 2373 binTypeStr = "none" 2374 binType = -999999 2350 2375 break 2376 2377 case "Circular": 2378 V_QBinAllPanels_Circular(activeType,binType,collimationStr) // this does a default circular average 2379 break 2380 2381 case "Sector": 2382 // CircularAverageTo1D(activeType) 2383 break 2384 case "Sector_PlusMinus": 2385 // Sector_PlusMinus1D(activeType) 2386 break 2387 case "Rectangular": 2388 // RectangularAverageTo1D(activeType) 2389 break 2390 2391 case "Annular": 2392 String detGroup = StringByKey("DETGROUP",prot[5],"=",";") 2393 Variable qCtr_Ann = NumberByKey("QCENTER",prot[5],"=",";") 2394 Variable qWidth = NumberByKey("QDELTA",prot[5],"=",";") 2395 V_QBinAllPanels_Annular(activeType,detGroup,qCtr_Ann,qWidth) 2396 break 2397 2398 case "Narrow_Slit": 2399 V_QBinAllPanels_Slit(activeType,binType) // this does a tall, narrow slit average 2400 break 2401 2351 2402 case "2D_ASCII": 2352 2403 //do nothing … … 2358 2409 //do nothing 2359 2410 break 2360 case "Rectangular":2361 // RectangularAverageTo1D(activeType)2362 break2363 case "Annular":2364 // AnnularAverageTo1D(activeType)2365 String detGroup = StringByKey("DETGROUP",prot[5],"=",";")2366 Variable qCtr_Ann = NumberByKey("QCENTER",prot[5],"=",";")2367 Variable qWidth = NumberByKey("QDELTA",prot[5],"=",";")2368 V_QBinAllPanels_Annular(activeType,detGroup,qCtr_Ann,qWidth)2369 break2370 case "Circular":2371 2372 V_QBinAllPanels_Circular(activeType,binType) // this does a default circular average2373 break2374 case "Sector":2375 // CircularAverageTo1D(activeType)2376 break2377 case "Sector_PlusMinus":2378 // Sector_PlusMinus1D(activeType)2379 break2380 2411 default: 2381 2412 //do nothing 2382 2413 endswitch 2383 2414 2384 // DONE 2385 // x- this call will bin the active type, then the next call bins the active type 2386 // x- then later, I dispatch to bin the active type... 2387 // x- !!!need to split out the panel draw and the binning calls from V_PlotData_Panel 2388 // 2389 // TODO: 2390 // -- BAD logic here, skipping the normal graph if annular is chosen. Go back and see how I do this 2391 // in SANS for a better and more foolproof way to do this 2392 // x- don't draw the graph if "none" is the average type! 2393 // 2394 if(cmpstr(av_type,"Annular") != 0 && (cmpstr(av_type,"none") != 0) ) 2395 V_PlotData_Panel() //this brings the plot window to the front, or draws it (ONLY) 2396 V_Update1D_Graph(activeType,binType) //update the graph, data was already binned 2397 endif 2398 ///// end of averaging dispatch 2399 2415 2416 2417 //////////////////////// 2418 // plotting of the data, another strswitch (with an if() out front) 2419 //////////////////////// 2420 2421 String doPlot = StringByKey("PLOT",prot[5],"=",";") 2422 2423 If( (cmpstr(doPlot,"Yes")==0) && (cmpstr(av_type,"none") != 0) ) 2424 2425 strswitch(av_type) //dispatch to the proper routine to PLOT 1D data 2426 case "none": 2427 //still do nothing 2428 break 2429 2430 case "Circular": 2431 V_PlotData_Panel() //this brings the plot window to the front, or draws it (ONLY) 2432 V_Update1D_Graph(activeType,binType) //update the graph, data was already binned 2433 break 2434 case "Sector": 2435 // CircularAverageTo1D(activeType) 2436 break 2437 case "Sector_PlusMinus": 2438 // Sector_PlusMinus1D(activeType) 2439 break 2440 case "Rectangular": 2441 // RectangularAverageTo1D(activeType) 2442 break 2443 2444 case "Annular": 2445 V_Phi_Graph_Proc(activeType,detGroup) 2446 break 2447 2448 case "Narrow_Slit": 2449 // these are the same plotting routines as for standard circular average 2450 V_PlotData_Panel() //this brings the plot window to the front, or draws it (ONLY) 2451 V_Update1D_Graph(activeType,binType) //update the graph, data was already binned 2452 break 2453 2454 case "2D_ASCII": 2455 //do nothing 2456 break 2457 case "QxQy_ASCII": 2458 //do nothing 2459 break 2460 case "PNG_Graphic": 2461 //do nothing 2462 break 2463 default: 2464 //do nothing 2465 endswitch 2466 2467 endif // end of plotting switch 2468 2469 2470 2471 //////////////////// 2472 //save data if desired - dispatch as needed 2473 //////////////////// 2400 2474 2401 2475 // 2402 2476 // x- how do I get the sample file name? 2403 2477 // local variable samFileLoaded is the file name loaded (contains the extension) 2404 // 2405 //save data if desired - dispatch as needed 2478 // 2406 2479 String fullpath = "", newfileName="" 2407 2480 String saveType = StringByKey("SAVE",prot[5],"=",";") //does user want to save data? … … 2416 2489 exten = "AVE" 2417 2490 endif 2418 if(cmpstr(av_type,"2D_ASCII") == 0)2419 exten = "ASC"2420 endif2421 if(cmpstr(av_type,"QxQy_ASCII") == 0)2422 exten = "DAT"2423 endif2491 // if(cmpstr(av_type,"2D_ASCII") == 0) 2492 // exten = "ASC" 2493 // endif 2494 // if(cmpstr(av_type,"QxQy_ASCII") == 0) 2495 // exten = "DAT" 2496 // endif 2424 2497 2425 2498 // // add an "x" to the file extension if the output is XML … … 2455 2528 strswitch(av_type) 2456 2529 case "Annular": 2457 // WritePhiave_W_Protocol(activeType,fullPath,dialog)2458 2530 V_fWrite1DAnnular("root:Packages:NIST:VSANS:",activeType,detGroup,newFileName+".phi") 2459 2531 Print "data written to: "+ newFileName+".phi" 2460 2532 2461 2533 break 2462 case "2D_ASCII": 2534 2535 case "Circular": //in SANS, this was the default, but is dangerous, so make it explicit here 2536 case "Sector": // TODO: this falls through - which luckily works for now... 2537 case "Rectangular": // TODO: this falls through - which luckily works for now... 2538 case "Narrow_Slit": // TODO: this falls through - which luckily works for now... 2539 2540 // no VSANS support of XML output at this point 2541 // if (useXMLOutput == 1) 2542 // WriteXMLWaves_W_Protocol(activeType,fullPath,dialog) 2543 // else 2544 // WriteWaves_W_Protocol(activeType,fullpath,dialog) 2545 // endif 2546 // 2547 if(cmpstr(saveType,"Yes - Concatenate")==0) 2548 V_Trim1DDataStr(activeType,binType,prot[7],prot[8]) // x- passing null strings uses global or default trim values 2549 2550 V_ConcatenateForSave("root:Packages:NIST:VSANS:",activeType,"",binType) // this removes q=0 point, concatenates, sorts 2551 V_Write1DData("root:Packages:NIST:VSANS:",activeType,newFileName+"."+exten) //don't pass the full path, just the name 2552 endif 2553 2554 if(cmpstr(saveType,"Yes - Individual")==0) 2555 // remove the q=0 point from the back detector, if it's there 2556 // does not trim any other points from the data 2557 V_RemoveQ0_B(activeType) 2558 V_Write1DData_ITX("root:Packages:NIST:VSANS:",activeType,newFileName,binType) 2559 endif 2560 Print "data written to: "+ newFileName+"."+exten 2561 2562 break 2563 2564 2565 case "2D_ASCII": 2463 2566 // Fast2DExport(activeType,fullPath,dialog) 2464 2567 break … … 2469 2572 // SaveAsPNG(activeType,fullpath,dialog) 2470 2573 break 2471 case "Circular": //in SANS, this was the default, but is dangerous, so make it explicit here 2472 // if (useXMLOutput == 1) 2473 // WriteXMLWaves_W_Protocol(activeType,fullPath,dialog) 2474 // else 2475 // WriteWaves_W_Protocol(activeType,fullpath,dialog) 2476 // endif 2477 // 2478 // x- get the trim strings from somewhere-- from the file or from the protocol?? 2479 // then replace the null strings being passed 2480 2481 if(cmpstr(saveType,"Yes - Concatenate")==0) 2482 V_Trim1DDataStr(activeType,binType,prot[7],prot[8]) // x- passing null strings uses global or default trim values 2483 2484 V_ConcatenateForSave("root:Packages:NIST:VSANS:",activeType,"",binType) // this removes q=0 point, concatenates, sorts 2485 V_Write1DData("root:Packages:NIST:VSANS:",activeType,newFileName+"."+exten) //don't pass the full path, just the name 2486 else 2487 // remove the q=0 point from the back detector, if it's there 2488 // does not trim any of the data 2489 V_RemoveQ0_B(activeType) 2490 V_Write1DData_ITX("root:Packages:NIST:VSANS:",activeType,newFileName,binType) 2491 endif 2492 Print "data written to: "+ newFileName+"."+exten 2493 2494 break 2574 2495 2575 default: 2496 2576 DoAlert 0, "av_type not found in dispatch to write file" 2497 2498 2577 endswitch 2499 2578 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Transmission.ipf
r1096 r1097 42 42 String/G gEmptyBoxCoord="1;2;3;4;",gEmptyPanel="ENTER PANEL" 43 43 String/G gSamMatchList = "_none_" 44 String/G gTransMatchList = "_none_" 44 45 45 46 … … 56 57 // ShowTools/A 57 58 PopupMenu popup_0,pos={16.00,359.00},size={104.00,23.00},fstyle=1,fsize=12,proc=V_TSamFilePopMenuProc,title="Sample" 58 PopupMenu popup_0,mode=1,popvalue="_none_",value= #"root:Packages:NIST:VSANS:Globals:Transmission:gSamMatchList 59 PopupMenu popup_0,mode=1,popvalue="_none_",value= #"root:Packages:NIST:VSANS:Globals:Transmission:gSamMatchList" 59 60 PopupMenu popup_1,pos={12.00,229.00},size={195.00,23.00},fstyle=1,fsize=12,proc=V_TTransmFilePopMenuProc,title="Transmission" 60 PopupMenu popup_1,mode=1,popvalue=" sans3584.nxs.ngv",value= V_getFilePurposeList("TRANSMISSION",0)61 PopupMenu popup_1,mode=1,popvalue="_none_",value = #"root:Packages:NIST:VSANS:Globals:Transmission:gTransMatchList"//value= V_getFilePurposeList("TRANSMISSION",0) 61 62 PopupMenu popup_2,pos={17.00,79.00},size={188.00,23.00},fstyle=1,fsize=12,proc=V_TEmpBeamPopMenuProc,title="Open Beam" 62 PopupMenu popup_2,mode=1,popvalue="sans 3584.nxs.ngv",value= V_getFileIntentList("OPEN BEAM",0)63 PopupMenu popup_2,mode=1,popvalue="sans1.nxs.ngv",value= V_getFileIntentList("OPEN BEAM",0) 63 64 Button button_0,pos={34.00,499.00},size={100.00,20.00},proc=V_CalcTransmButtonProc,title="Calculate" 64 65 Button button_2,pos={349.00,13.00},size={30.00,20.00},proc=V_HelpTransmButtonProc,title="?" … … 156 157 return(0) 157 158 158 // switch( pa.eventCode )159 // case 2: // mouse up160 // Variable popNum = pa.popNum161 // String popStr = pa.popStr162 //163 // Variable ii,np164 //165 // WAVE/T fileNameW = root:Packages:NIST:VSANS:CatVSHeaderInfo:Filenames166 // WAVE/T labelW = root:Packages:NIST:VSANS:CatVSHeaderInfo:Labels167 // WAVE groupIDW = root:Packages:NIST:VSANS:CatVSHeaderInfo:Group_ID168 // WAVE transmW = root:Packages:NIST:VSANS:CatVSHeaderInfo:Transmission169 // WAVE/T intentW = root:Packages:NIST:VSANS:CatVSHeaderInfo:Intent170 //171 // // TODO172 // // I don't have a wave for the transmission error value, so it's not displayed here173 // // -- do I read it in, or just ignore it...174 // np = numpnts(labelW) //fileNameW is LONGER - so don't use numpnts(fileWave)175 // for(ii=0;ii<np;ii+=1)176 // if(cmpstr(fileNameW[ii],popStr)==0)177 //178 // SetVariable setvar_0,value=labelW[ii]179 // SetVariable setvar_1,value=groupIDW[ii]180 // SetVariable setvar_7,value=transmW[ii]181 // break //found, get out182 // endif183 // endfor184 //185 // // loop back through to find the transmission file with the matching group id186 // // TODO x- set the popup string to the matching name on exit187 // Variable targetID = groupIDW[ii]188 //// String list = V_getFilePurposeList("TRANSMISSION",0)189 // String list = V_getFileIntentPurposeList("SAMPLE","TRANSMISSION",0)190 //191 // WAVE/T purposeW = root:Packages:NIST:VSANS:CatVSHeaderInfo:Purpose192 // for(ii=0;ii<np;ii+=1)193 // if(cmpstr(purposeW[ii],"TRANSMISSION")==0 && cmpstr(intentW[ii],"SAMPLE")==0 && groupIDW[ii] == targetID)194 // Print "transmission file match at ",filenameW[ii]195 // SetVariable setvar_2,value=labelW[ii]196 // SetVariable setvar_3,value=groupIDW[ii]197 // PopupMenu popup_1,mode=WhichListItem(fileNameW[ii], list )+1,popValue=fileNameW[ii]198 // break199 // endif200 // endfor201 //202 // // now loop back through to find the empty beam file203 // // TODO204 // // x- fill in the XY box205 // // x- Detector Panel field is hard-wired for "B"206 // // -- do I use "EMPTY BEAM", "OPEN BEAM" or both?? I think "OPEN BEAM" is what NICE will use in a drop-down menu207 // //208 //// list = V_getFileIntentList("EMPTY BEAM",0)209 // list = V_getFileIntentList("OPEN BEAM",0)210 //211 // for(ii=0;ii<np;ii+=1)212 // if(cmpstr(intentW[ii],"OPEN BEAM")==0)213 // Print "Open beam match at ",filenameW[ii]214 // SetVariable setvar_4,value=labelW[ii]215 // PopupMenu popup_2,mode=WhichListItem(fileNameW[ii], list )+1,popValue=fileNameW[ii]216 //217 //// SetVariable setvar_6,value =_STR:"ML"218 //219 // WAVE boxCoord = V_getBoxCoordinates(filenameW[ii])220 // Print boxCoord221 // SetVariable setvar_5,value=_STR:V_NumWave2List(boxCoord,";")222 //223 //224 // break225 // endif226 // endfor227 //228 // break229 // case -1: // control being killed230 // break231 // endswitch232 233 return 0234 159 End 235 160 … … 255 180 gTrnGrpID = V_getSample_GroupID(popStr) 256 181 257 SVAR gSamMatchList = root:Packages:NIST:VSANS:Globals:Transmission:gSamMatchList258 String quote = "\""259 gSamMatchList = quote + V_getFileIntentPurposeIDList("SAMPLE","SCATTERING",gTrnGrpID,0) + quote182 // SVAR gSamMatchList = root:Packages:NIST:VSANS:Globals:Transmission:gSamMatchList 183 // String quote = "\"" 184 // gSamMatchList = quote + V_getFileIntentPurposeIDList("SAMPLE","SCATTERING",gTrnGrpID,0) + quote 260 185 // this resets a global string, since I can't pass a parameter (only constants) in value=fn() 261 186 // PopupMenu popup_0,mode=1,value=#gSamMatchList … … 279 204 // and be sure to add in the empty cell, since it's not a "sample" 280 205 retStr += V_getFileIntentPurposeIDList("EMPTY CELL","SCATTERING",gTrnGrpID,0) 281 282 return(retStr) 206 207 // now filter through the string to refine the list to only scattering files that match 208 // the transmission file conditions 209 String newList="",item 210 Variable num,ii 211 212 String transStr 213 ControlInfo popup_1 //the transmission file popup 214 transStr = S_Value 215 216 num=ItemsInList(retStr) 217 for(ii=0;ii<num;ii+=1) 218 item = StringFromList(ii, retStr,";") 219 if(V_Scatter_Match_Trans(transStr,item)) 220 newList += item + ";" 221 endif 222 endfor 223 224 return(newList) 225 End 226 227 228 Function/S V_getTransListForPopup() 229 230 String retStr = V_getFilePurposeList("TRANSMISSION",0) 231 232 // now filter through the string to refine the list to only transmission files that match 233 // the open beam file conditions 234 String newList="",item 235 Variable num,ii 236 237 String openStr 238 ControlInfo popup_2 //the open beam popup 239 openStr = S_Value 240 241 num=ItemsInList(retStr) 242 for(ii=0;ii<num;ii+=1) 243 item = StringFromList(ii, retStr,";") 244 if(V_Trans_Match_Open(openStr,item)) 245 newList += item + ";" 246 endif 247 endfor 248 249 return(newList) 250 283 251 End 284 252 … … 301 269 String detStr = V_getReduction_BoxPanel(popStr) 302 270 SetVariable setvar_6,value =_STR:detStr 271 272 PopupMenu popup_1,mode=1,value=V_getTransListForPopup() 303 273 304 274 break -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Utilities_General.ipf
r1095 r1097 101 101 // "as needed" means that when an operation is done that needs to ensure 102 102 // a fresh read from disk, it must take care of the kill. 103 // x- the ksBaseDFPath needs to be removed. It's currently pointing to RawVSANS, which is104 // really not used as intended anymore.103 // 104 // ksBaseDFPath points to RawVSANS 105 105 // 106 106 // -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Write_VSANS_QIS.ipf
r1073 r1097 37 37 Wave/T proto=$("root:Packages:NIST:VSANS:Globals:Protocols:"+gProtoStr) 38 38 39 SVAR samFiles = root:Packages:NIST:VSANS:Globals:Protocols:gSAM 39 40 40 41 //make sure the waves exist … … 115 116 //7 - beginning trim points 116 117 //8 - end trim points 117 //fprintf refnum, "SAM: %s\r\n",samFiles118 fprintf refnum, "SAM: %s\r\n",samFiles 118 119 fprintf refnum, "BGD: %s\r\n",proto[0] 119 120 fprintf refnum, "EMP: %s\r\n",Proto[1]
Note: See TracChangeset
for help on using the changeset viewer.