Changeset 1126 for sans/Dev/trunk/NCNR_User_Procedures/Reduction
- Timestamp:
- Feb 11, 2019 2:44:55 PM (4 years ago)
- Location:
- sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_IQ_Annular.ipf
r1097 r1126 844 844 return(0) 845 845 End 846 847 848 // 849 // x- I want to mask out everything that is "out" of the annulus 850 // 851 // 0 = keep the point 852 // 1 = yes, mask the point 853 Function V_MarkAnnularOverlayPixels(qTotal,overlay,qCtr_ann,qWidth) 854 Wave qTotal,overlay 855 Variable qCtr_ann,qWidth 856 857 858 Variable xDim=DimSize(qTotal, 0) 859 Variable yDim=DimSize(qTotal, 1) 860 861 Variable ii,jj,exclude,qVal 862 863 // initialize the mask to == 1 == exclude everything 864 overlay = 1 865 866 // now give every opportunity to keep pixel in 867 for(ii=0;ii<xDim;ii+=1) 868 for(jj=0;jj<yDim;jj+=1) 869 //qTot = sqrt(qx[ii]^2 + qy[ii]^2+ qz[ii]^2) 870 qval = qTotal[ii][jj] 871 exclude = 1 872 873 // annulus as defined 874 if(V_CloseEnough(qval,qCtr_ann,qWidth)) 875 exclude = 0 876 endif 877 878 // set the mask value 879 overlay[ii][jj] = exclude 880 endfor 881 endfor 882 883 884 return(0) 885 End -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_MaskUtils.ipf
r1124 r1126 1132 1132 SetVariable setvar3,limits={0,359,1},value=root:Packages:NIST:VSANS:Globals:Mask:gSectorDQ 1133 1133 1134 PopupMenu popup4,pos={200,100},size={90,23.00}, proc=V_DummyPopMenuProc,title="Sector Side(s)"1134 PopupMenu popup4,pos={200,100},size={90,23.00},title="Sector Side(s)"//,proc=V_DummyPopMenuProc 1135 1135 PopupMenu popup4,mode=1,value= #"\"both;left;right;\"" 1136 1136 … … 1328 1328 1329 1329 1330 1331 Function V_DummyPopMenuProc(pa) : PopupMenuControl1332 STRUCT WMPopupAction &pa1333 1334 switch( pa.eventCode )1335 case 2: // mouse up1336 Variable popNum = pa.popNum1337 String popStr = pa.popStr1338 1339 DoAlert 0,"Fill in the dummy procedure"1340 1341 break1342 case -1: // control being killed1343 break1344 endswitch1345 1346 return 01347 End1330 // 1331 //Function V_DummyPopMenuProc(pa) : PopupMenuControl 1332 // STRUCT WMPopupAction &pa 1333 // 1334 // switch( pa.eventCode ) 1335 // case 2: // mouse up 1336 // Variable popNum = pa.popNum 1337 // String popStr = pa.popStr 1338 // 1339 // DoAlert 0,"Fill in the dummy procedure" 1340 // 1341 // break 1342 // case -1: // control being killed 1343 // break 1344 // endswitch 1345 // 1346 // return 0 1347 //End 1348 1348 1349 1349 … … 1519 1519 NVAR qWidth = root:Packages:NIST:VSANS:Globals:Mask:gAnnularDQ 1520 1520 1521 break 1522 1521 // loop over all of the panels 1522 // fill in the mask 1523 for(ii=0;ii<ItemsInList(ksDetectorListNoB);ii+=1) 1524 detStr = StringFromList(ii, ksDetectorListNoB, ";") 1525 Wave qTotal = $(str1+str2+detStr+":qTot_"+detStr) 1526 Wave w = V_getDetectorDataW(folderStr,detStr) //this is simply to get the correct wave scaling on the overlay 1527 Duplicate/O w $("root:Packages:NIST:VSANS:MSK:entry:instrument:detector_"+detStr+":AvgOverlay_"+detStr) 1528 Wave overlay = $("root:Packages:NIST:VSANS:MSK:entry:instrument:detector_"+detStr+":AvgOverlay_"+detStr) 1529 V_MarkAnnularOverlayPixels(qTotal,overlay,qCtr_ann,qWidth) 1530 endfor 1531 1532 break 1523 1533 default: 1524 1534 //do nothing … … 1623 1633 ControlInfo/W=VSANS_Det_Panels popup4 1624 1634 String side = S_Value 1625 NVAR phi _rad= root:Packages:NIST:VSANS:Globals:Mask:gSectorAngle1626 NVAR d phi_rad= root:Packages:NIST:VSANS:Globals:Mask:gSectorDQ1635 NVAR phi = root:Packages:NIST:VSANS:Globals:Mask:gSectorAngle 1636 NVAR delta = root:Packages:NIST:VSANS:Globals:Mask:gSectorDQ 1627 1637 1628 //String side = StringByKey("SIDE",avgStr,"=",";") 1629 //Variable phi_rad = (Pi/180)*NumberByKey("PHI",avgStr,"=",";") //in radians 1630 //Variable dphi_rad = (Pi/180)*NumberByKey("DPHI",avgStr,"=",";") 1631 V_QBinAllPanels_Sector(activeType,binType,collimationStr,side,phi_rad,dphi_rad) 1638 // convert the angles to radians before passing 1639 V_QBinAllPanels_Sector(activeType,binType,collimationStr,side,phi*pi/180,delta*pi/180) 1632 1640 V_PlotData_Panel() //this brings the plot window to the front, or draws it (ONLY) 1633 1641 V_Update1D_Graph(activeType,binType) //update the graph, data was already binned -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Menu.ipf
r1119 r1126 24 24 "Patch Detector Calibration",V_PatchDetectorCalibrationPanel() 25 25 "-" 26 "Show Mask for Averaging",V_Display_Four_Panels() 26 27 "Annular Binning",Annular_Binning() 27 28 "Write Annular Data",V_Write1DAnnular() -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Sector_Average.ipf
r1124 r1126 53 53 Variable yDim=DimSize(phi, 1) 54 54 55 Variable ii,jj,isIn,forward,mirror 56 57 // initialize the mask to keep everything 58 overlay = 0 59 55 Variable ii,jj,exclude,mirror_phiCtr,crossZero 56 57 // does the +- delta cross 0? 58 crossZero = 0 59 if((phiCtr - delta) < 0) 60 crossZero = 1 61 endif 62 if((phiCtr + delta) > 2*pi) 63 crossZero = 1 64 endif 65 // if "both", what is the mirror_phiCtr? 66 if(cmpstr(side,"both")==0) 67 if(phiCtr < pi) 68 mirror_phiCtr = phiCtr + pi 69 else 70 mirror_phiCtr = phiCtr - pi 71 endif 72 endif 73 74 // initialize the mask to == 1 == exclude everything 75 overlay = 1 76 77 78 // now give every opportunity to keep pixel in 60 79 for(ii=0;ii<xDim;ii+=1) 61 80 for(jj=0;jj<yDim;jj+=1) 62 81 //qTot = sqrt(qx[ii]^2 + qy[ii]^2+ qz[ii]^2) 63 82 phiVal = phi[ii][jj] 64 isIn = 065 66 isIn = V_CloseEnough(phiVal,phiCtr,delta)67 if( !isIn) // it's NOT in the sector, do something68 overlay[ii][jj] = 183 exclude = 1 84 85 // sector as defined 86 if(V_CloseEnough(phiVal,phiCtr,delta)) 87 exclude = 0 69 88 endif 70 71 // isIn = V_CloseEnough(phiVal,pi+phiCtr,delta) 72 // if(!isIn) // it's NOT in the sector, do something 73 // overlay[ii][jj] = 1 74 // endif 75 76 // 77 // if(phiVal < delta) 78 // forward = 1 //within forward sector 79 // else 80 // forward = 0 81 // Endif 82 // if((Pi - phiVal) < delta) 83 // mirror = 1 //within mirror sector 84 // else 85 // mirror = 0 86 // Endif 87 // //check if pixel lies within allowed sector(s) 88 // if(cmpstr(side,"both")==0) //both sectors 89 // if ( mirror || forward) 90 // //increment 91 // isIn = 1 92 // Endif 93 // else 94 // if(cmpstr(side,"right")==0) //forward sector only 95 // if(forward) 96 // //increment 97 // isIn = 1 98 // Endif 99 // else //mirror sector only 100 // if(mirror) 101 // //increment 102 // isIn = 1 103 // Endif 104 // Endif 105 // Endif //allowable sectors 106 // 107 108 89 //if sector crosses zero, pick up the rest of the sector 90 if(crossZero) 91 if(V_CloseEnough(phiVal-2*pi,phiCtr,delta)) 92 exclude = 0 93 endif 94 if(V_CloseEnough(phiVal+2*pi,phiCtr,delta)) 95 exclude = 0 96 endif 97 endif 98 99 // mirror phi if needed 100 if(cmpstr(side,"both")==0) 101 if(V_CloseEnough(phiVal,mirror_phiCtr,delta)) 102 exclude = 0 103 endif 104 endif 105 106 // if only right or left, exclude everything as needed 107 if(cmpstr(side,"right")==0) 108 //if phi is actually on the left 109 if(phiCtr > pi/2 && phiCtr < 3*pi/2) 110 exclude = 1 111 endif 112 endif 113 if(cmpstr(side,"left")==0) 114 //if phi is actually on the right 115 if( (phiCtr > 0 && phiCtr < pi/2) || (phiCtr > 3*pi/2 && phiCtr < 2*pi) ) 116 exclude = 1 117 endif 118 endif 119 120 // set the mask value 121 overlay[ii][jj] = exclude 109 122 endfor 110 123 endfor 111 124 125 112 126 return(0) 113 127 End -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Write_VSANS_QIS.ipf
r1121 r1126 548 548 ii=0 549 549 550 s_tic()551 550 // TODO 552 551 // this loop is the slow step. it takes Å 0.7 s for F or M panels, and Å 120 s for the Back panel (6144 pts vs. 1.12e6 pts) … … 560 559 // dum = V_get2DResolution(qval,phi,r_dist,type,detStr,collimationStr,SigmaQX,SigmaQY,fsubS) 561 560 561 v_tic() 562 562 do 563 563 V_get2DResolution(qval[ii],phi[ii],r_dist[ii],type,detStr,collimationStr,ret1,ret2,ret3) … … 567 567 ii+=1 568 568 while(ii<nq) 569 s_toc() 570 569 v_toc() 571 570 ////********************* 572 571 Duplicate/O qx_val,qx_val_s
Note: See TracChangeset
for help on using the changeset viewer.