Changeset 1078 for sans/Dev/trunk
- Timestamp:
- Jan 5, 2018 10:32:55 AM (5 years ago)
- Location:
- sans/Dev/trunk/NCNR_User_Procedures
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Common/Packages/PlotManager/PlotUtilsMacro_v40.ipf
r1039 r1078 360 360 //$(baseStr+"_res")[][3] = $w0[p] //Qvalues 361 361 dQv = -$w3[0] 362 363 //TODO: be sure that this works correctly and can be included in either 364 // a VSANS reduction experiment, or a standalone analysis package 365 #if (exists("NCNR_VSANS")==6) //defined in the main #includes file. 366 DoAlert 0,"**Treating data as VSANS data**" 367 Duplicate/O $w3,$(baseStr+"_dQv") //save a copy for VSANS 368 $(baseStr+"_dQv") = -$(baseStr+"_dQv") 369 V_USANS_CalcWeights(baseStr,dQv) 370 #else 371 DoAlert 0,"Treating data as USANS (normal slit-smeared data)" 372 USANS_CalcWeights(baseStr,dQv) 373 #endif 374 362 375 363 USANS_CalcWeights(baseStr,dQv)364 376 365 377 endif -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_DetectorBinning_Slit.ipf
r1077 r1078 175 175 // eBin_qxqy = tmp[0][p] 176 176 177 Variable ii,jj,ntube,n pix,sum_inten, sum_n, sum_inten2,avesq,aveisq,var,mask_val177 Variable ii,jj,ntube,nYpix,sum_inten, sum_n, sum_inten2,avesq,aveisq,var,mask_val 178 178 ntube = DimSize(inten,0) 179 n pix = DimSize(inten,1)179 nYpix = DimSize(inten,1) 180 180 181 181 for(ii=0;ii<ntube;ii+=1) … … 184 184 sum_inten2 = 0 185 185 186 for(jj=0;jj<n pix;jj+=1)186 for(jj=0;jj<nYpix;jj+=1) 187 187 val = inten[ii][jj] 188 188 if(isVCALC || maskMissing) // mask_val == 0 == keep, mask_val == 1 = YES, mask out the point … … 199 199 iBin_qxqy[ii] = sum_inten/sum_n //the average value 200 200 201 avesq = sum_inten201 avesq = (sum_inten/sum_n)^2 202 202 aveisq = sum_inten2/sum_n 203 203 var = aveisq-avesq … … 211 211 212 212 //TODO: use only the Qx component in the y-center of the detector, not Qtotal 213 qBin_qxqy = abs(qx[p][npix/2]) 214 215 // if the detectors are "L", then the values are all negative... 216 qBin_qxqy = abs(qBin_qxqy) 213 // if the detectors are "L", then the values are all negative, so take the absolute value here 214 qBin_qxqy = abs(qx[p][nYpix/2]) 217 215 218 216 // for the L panels, sort the q-values (and data) after the abs() step, otherwise the data is reversed 219 // won't hurt to sort the R data217 // won't hurt to sort the R panel data 220 218 Sort qBin_qxqy, qBin_qxqy,iBin_qxqy,eBin_qxqy 221 222 // not needed to corrrect data, but put in the file??? 223 delQy = abs(qy[0][npix-1] - qy[0][0]) // TODO: do I use dQ for the height of the panel? 219 220 221 // TODO: do I use dQ for the height of the panel? 222 // TODO : do I use 1/2 of dQ due to the symmetry of my smearing calculation? 223 delQy = abs(qy[0][nYpix-1] - qy[0][0]) 224 224 225 // iBin_qxqy *= delQy 225 226 // eBin_qxqy *= delQy … … 247 248 // DeletePoints 0, val, iBin_qxqy,qBin_qxqy,eBin_qxqy 248 249 249 250 // TODO:251 // -- calculate the slit resolution here. don't really have any idea how to represent this in VSANS252 // since it's not an infinite slit, and not anything that I expect could be represented as a Gaussian253 250 254 251 // TODO: … … 266 263 Wave fsubs = $(folderPath+":"+"fSubS_qxqy_"+detStr) 267 264 268 // TODO 269 // -- these are DUMMY VALUES!!! 270 sigmaq = -delQy 271 qbar = -delQy 272 fsubs = -delQy 265 // TODO: 266 // -- calculate the slit resolution here. don't really have any idea how to represent this in VSANS 267 // since it's not an infinite slit, and not anything that I expect could be represented as a Gaussian 268 // -- there is also wavelength smearing present 269 270 // ASSUMPTION: As a first approximation, ignore the wavelength smearing component 271 // TODO : do I use 1/2 of dQy due to the symmetry of my smearing calculation? 272 sigmaq = -delQy/2 273 qbar = -delQy/2 274 fsubs = -delQy/2 273 275 274 276 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VSANS_Includes.ipf
r1076 r1078 111 111 #include "V_Attenuation" 112 112 113 // for loading of slit-smeared VSANS data 114 // and generating the smearing matrix 115 #include "V_USANS_SlitSmearing_v40" 113 116 114 117 115 118 116 119 120 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_DIVUtils.ipf
r1075 r1078 33 33 34 34 35 36 35 37 /// TODO: 36 38 // -- need a way to view the DIV data (each panel) and see the stats on the values … … 50 52 // Basic function: 51 53 // -- Setup_VSANS_DIV_Struct() 52 // -- then, reduce the data (to the COR level?) 53 // -- next, V_NormalizeDIV() (one panel at a time, using the mask) 54 // -- next, V_CopyDIVToSave() -or- V_CopyDIVToSave_OnePanel() 55 // -- last, Save_VSANS_DIV_Nexus() 56 // 57 58 59 60 61 62 63 64 Proc V_NormalizeDIV_proc(type,detStr) 65 String type,detStr 66 V_NormalizeDIV_onePanel(type,detStr) 54 // 55 // -- Clear the DIV data folder: V_KillWavesInFolder("DIV") 56 // 57 // -- reduce the data (to the COR level?) 58 59 // -- V_NormalizeDIV() (one panel at a time, using the mask) 60 // -- V_CopyDIVToSave() -or- V_CopyDIVToSave_OnePanel() 61 62 // -- Save_VSANS_DIV_Nexus() 63 // 64 65 66 // 67 // Simple panel to walk through the steps of generating a DIV file 68 // 69 Proc DIV_Setup_Panel() : Panel 70 PauseUpdate; Silent 1 // building window... 71 NewPanel /W=(1207,593,1444,953)/N=DIV_Setup_Panel/K=1 72 DoWindow/C DIV_Setup_Panel 73 Button button0,pos={54.00,10.00},size={120.00,20.00},proc=V_DIVSetupButtonProc,title="Setup Folder" 74 Button button1,pos={54.00,40.00},size={120.00,20.00},proc=V_DIVClearOldButtonProc,title="Clear Old DIV" 75 76 DrawText 36,110,"Reduce data for one carriage" 77 DrawText 36,200,"Repeat for the other carriage" 78 Button button1_2,pos={74.00,130.00},size={120.00,20.00},proc=V_DIVMaskButtonProc,title="Mask for DIV" 79 Button button2,pos={74.00,160.00},size={120.00,20.00},proc=V_DIVNormalizeButtonProc,title="Normalize+Copy" 80 81 DrawText 36,290,"Once data for both carriages has\rbeen normalized, save the file" 82 83 Button button3,pos={54.00,300.00},size={120.00,20.00},proc=V_DIVSaveButtonProc,title="Save DIV" 84 EndMacro 85 86 87 88 // set up the folder structure for the DIV file to fill in 89 Function V_DIVSetupButtonProc(ba) : ButtonControl 90 STRUCT WMButtonAction &ba 91 92 switch( ba.eventCode ) 93 case 2: // mouse up 94 // click code here 95 Execute "Setup_VSANS_DIV_Struct()" 96 break 97 case -1: // control being killed 98 break 99 endswitch 100 101 return 0 102 End 103 104 105 // clear out whatever is in the current DIV folder to ensure that it is not 106 // accidentally applied during the reduction of the DIV file 107 // 108 Function V_DIVClearOldButtonProc(ba) : ButtonControl 109 STRUCT WMButtonAction &ba 110 111 switch( ba.eventCode ) 112 case 2: // mouse up 113 // click code here 114 V_KillWavesInFolder("DIV") 115 break 116 case -1: // control being killed 117 break 118 endswitch 119 120 return 0 121 End 122 123 124 Function V_DIVNormalizeButtonProc(ba) : ButtonControl 125 STRUCT WMButtonAction &ba 126 127 switch( ba.eventCode ) 128 case 2: // mouse up 129 // click code here 130 Execute "V_NormalizeDIV_proc()" 131 break 132 case -1: // control being killed 133 break 134 endswitch 135 136 return 0 137 End 138 139 Function V_DIVMaskButtonProc(ba) : ButtonControl 140 STRUCT WMButtonAction &ba 141 142 switch( ba.eventCode ) 143 case 2: // mouse up 144 // click code here 145 Execute "V_Edit_a_Mask()" 146 break 147 case -1: // control being killed 148 break 149 endswitch 150 151 return 0 152 End 153 154 Function V_DIVSaveButtonProc(ba) : ButtonControl 155 STRUCT WMButtonAction &ba 156 157 switch( ba.eventCode ) 158 case 2: // mouse up 159 // click code here 160 Execute "Save_VSANS_DIV_Nexus()" 161 break 162 case -1: // control being killed 163 break 164 endswitch 165 166 return 0 167 End 168 169 170 171 172 Proc V_NormalizeDIV_proc(reducedFolderType,carriageStr) 173 String reducedFolderType="SAM",carriageStr="F" 174 if(cmpstr(carriageStr,"F")==0) 175 V_NormalizeDIV_onePanel(reducedFolderType,"FL") 176 V_NormalizeDIV_onePanel(reducedFolderType,"FR") 177 V_NormalizeDIV_onePanel(reducedFolderType,"FT") 178 V_NormalizeDIV_onePanel(reducedFolderType,"FB") 179 else 180 V_NormalizeDIV_onePanel(reducedFolderType,"ML") 181 V_NormalizeDIV_onePanel(reducedFolderType,"MR") 182 V_NormalizeDIV_onePanel(reducedFolderType,"MT") 183 V_NormalizeDIV_onePanel(reducedFolderType,"MB") 184 endif 185 67 186 end 187 68 188 69 189 // Normalizes a single panel … … 406 526 Display/W=(10,45,210,425)/HOST=# 407 527 AppendImage/T/G=1 :Packages:NIST:VSANS:RAW:entry:instrument:detector_FL:data // /G=1 flag prevents interpretation as RGB so 3, 4 slices display correctly 528 408 529 ModifyImage data ctab= {*,*,ColdWarm,0} 409 530 ModifyImage data ctabAutoscale=3 … … 675 796 end 676 797 798 // if there is no operation called, immediately exit 799 // 677 800 // if there is a simple operation called, do it 801 // TODO -- if there are more than these two simple operations, a more sophisticated switch will be necessary 802 // 678 803 Function V_DoDIVOperation() 679 804 … … 732 857 733 858 734 //735 // Simple panel to walk through the steps of generating a DIV file736 //737 738 739 740 741 Proc DIV_Setup_Panel() : Panel742 PauseUpdate; Silent 1 // building window...743 NewPanel /W=(1207,593,1444,953)/N=DIV_Setup_Panel/K=1744 DoWindow/C DIV_Setup_Panel745 Button button0,pos={54.00,10.00},size={120.00,20.00},proc=V_DIVSetupButtonProc,title="Setup Folder"746 Button button1,pos={54.00,100.00},size={120.00,20.00},proc=V_DIVNormalizeButtonProc,title="Normalize"747 Button button2,pos={54.00,200.00},size={120.00,20.00},proc=V_DIVSaveButtonProc,title="Save DIV"748 EndMacro749 750 // set up the folder structure for the DIV file to fill in751 Function V_DIVSetupButtonProc(ba) : ButtonControl752 STRUCT WMButtonAction &ba753 754 switch( ba.eventCode )755 case 2: // mouse up756 // click code here757 Execute "Setup_VSANS_DIV_Struct()"758 break759 case -1: // control being killed760 break761 endswitch762 763 return 0764 End765 766 767 Function V_DIVNormalizeButtonProc(ba) : ButtonControl768 STRUCT WMButtonAction &ba769 770 switch( ba.eventCode )771 case 2: // mouse up772 // click code here773 Execute "V_NormalizeDIV_proc()"774 break775 case -1: // control being killed776 break777 endswitch778 779 return 0780 End781 782 Function V_DIVSaveButtonProc(ba) : ButtonControl783 STRUCT WMButtonAction &ba784 785 switch( ba.eventCode )786 case 2: // mouse up787 // click code here788 Execute "Save_VSANS_DIV_Nexus()"789 break790 case -1: // control being killed791 break792 endswitch793 794 return 0795 End -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_DetectorCorrections.ipf
r1076 r1078 160 160 // both beam conditions (+/- 0.0 mm). FTB was +/- 0.8 mm, MTB +/- 2 mm 161 161 if(cmpstr(detStr,"FL") == 0 || cmpstr(detStr,"FR") == 0) 162 gap = 3. 2 //mm162 gap = 3.8 //mm (measured, JB 1/4/18) 163 163 endif 164 164 if(cmpstr(detStr,"FT") == 0 || cmpstr(detStr,"FB") == 0) … … 166 166 endif 167 167 if(cmpstr(detStr,"ML") == 0 || cmpstr(detStr,"MR") == 0) 168 gap = 5. 4 //mm168 gap = 5.9 //mm (measured, JB 1/4/18) 169 169 endif 170 170 if(cmpstr(detStr,"MT") == 0 || cmpstr(detStr,"MB") == 0) … … 1228 1228 Wave data_err = V_getDetectorDataErrW("ABS",detStr) 1229 1229 1230 data *= s 1*s2*s3*s41230 data *= scale 1231 1231 data_err = sqrt(scale^2*data_err^2 + scale^2*data^2*(kappa_err^2/s_izero^2 +trans_err^2/w_trans^2)) 1232 1232 endfor 1233 1233 1234 1234 //********* 15APR02 1235 // DO NOT correct for atenuators here - the COR step already does this, putting all of the data on eequal1235 // DO NOT correct for atenuators here - the COR step already does this, putting all of the data on equal 1236 1236 // footing (zero atten) before doing the subtraction. 1237 1237
Note: See TracChangeset
for help on using the changeset viewer.