- Timestamp:
- May 7, 2018 1:14:22 PM (5 years ago)
- Location:
- sans/Dev/trunk/NCNR_User_Procedures
- Files:
-
- 1 added
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
sans/Dev/trunk/NCNR_User_Procedures/Common/Packages/PlotManager/PlotUtilsMacro_v40.ipf
r1095 r1099 366 366 // but, since it's a Proc, it is not compiled, so missing functions aren't flagged as a compile error 367 367 if (exists("NCNR_VSANS")==6) //defined in the main VSANS #includes file. 368 369 370 371 368 DoAlert 0,"**Treating data as VSANS data**" 369 Duplicate/O $w3,$(baseStr+"_dQv") //save a copy for VSANS 370 $(baseStr+"_dQv") = -$(baseStr+"_dQv") 371 V_USANS_CalcWeights(baseStr,dQv) 372 372 else 373 374 373 DoAlert 0,"Treating data as USANS (normal slit-smeared data)" 374 USANS_CalcWeights(baseStr,dQv) 375 375 endif 376 376 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_DetectorBinning_Slit.ipf
r1098 r1099 199 199 iBin_qxqy[ii] = sum_inten/sum_n //the average value 200 200 201 // if(numtype(iBin_qxqy[ii]) == 2) 202 // print "asdfasdf" 203 // endif 204 201 205 avesq = (sum_inten/sum_n)^2 202 206 aveisq = sum_inten2/sum_n … … 240 244 241 245 DeletePoints val, nq-val, iBin_qxqy,qBin_qxqy,eBin_qxqy 246 247 248 // utility function to remove NaN values from the waves 249 V_RemoveNaNsQIS(qBin_qxqy, iBin_qxqy, eBin_qxqy) 242 250 243 251 // work forwards? this doesn't work... -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VC_DetectorBinning_Utils.ipf
r1098 r1099 1396 1396 val -= 1 1397 1397 while(val>0) 1398 1399 // utility function to remove NaN values from the waves 1400 V_RemoveNaNsQIS(qBin_qxqy, iBin_qxqy, eBin_qxqy) 1401 1398 1402 1399 1403 // TODO: -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/VSANS_Includes.ipf
r1098 r1099 123 123 #include "V_WB_BroadPeak" 124 124 #include "V_WB_GaussSpheres" 125 #include "V_WB_Beaucage" 126 125 127 126 128 #include "V_Utilities_Comparisons" -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Combine_1D.ipf
r1097 r1099 155 155 // ControlInfo/W=V_1D_Combine popup1 156 156 // String dataFldrStr = S_Value 157 157 NVAR gIgnoreBackDet = root:Packages:NIST:VSANS:Globals:gIgnoreDetB 158 158 SVAR curDispType = root:Packages:NIST:VSANS:Globals:gCurDispType 159 159 String dataFldrStr = "root:Packages:NIST:VSANS:"+curDispType … … 165 165 for(ii=0;ii<num;ii+=1) 166 166 detStr = panelStr[ii] 167 Wave/Z iw = $("root:ToTrim:iBin_qxqy_"+detStr+"_trim") 168 Wave/Z iw_orig = $(dataFldrStr+":iBin_qxqy_"+detStr) 169 // Wave/Z iw = $("iBin_qxqy_"+detStr) 170 // Wave/Z ew = $("eBin_qxqy_"+detStr) 171 if(WaveExists(iw) && WaveExists(iw_orig)) 172 173 // DeletePoints 0,nBeg, qw,iw,ew 174 // start fresh 175 iw = iw_orig 176 177 p1 = begW[ii] 178 iw[0,p1-1] = NaN 167 if(gIgnoreBackDet && cmpstr(detStr,"B") == 0) 168 // do nothing 169 else 170 Wave/Z iw = $("root:ToTrim:iBin_qxqy_"+detStr+"_trim") 171 Wave/Z iw_orig = $(dataFldrStr+":iBin_qxqy_"+detStr) 172 // Wave/Z iw = $("iBin_qxqy_"+detStr) 173 // Wave/Z ew = $("eBin_qxqy_"+detStr) 174 if(WaveExists(iw) && WaveExists(iw_orig)) 179 175 180 Variable npt 181 npt = numpnts(iw) 182 // DeletePoints npt-nEnd,nEnd, qw,iw,ew 183 p2 = EndW[ii] 184 iw[npt-p2,npt-1] = NaN 185 176 // DeletePoints 0,nBeg, qw,iw,ew 177 // start fresh 178 iw = iw_orig 179 Variable npt 180 npt = numpnts(iw) 181 182 p1 = begW[ii] 183 if(p1 > 0 && p1 < npt-1) 184 iw[0,p1-1] = NaN 185 endif 186 187 // DeletePoints npt-nEnd,nEnd, qw,iw,ew 188 p2 = EndW[ii] 189 190 if(p2 > 0 && p2 < npt-1) 191 iw[npt-p2,npt-1] = NaN 192 endif 193 endif 186 194 endif 187 188 195 endfor 189 196 -
sans/Dev/trunk/NCNR_User_Procedures/Reduction/VSANS/V_Utilities_General.ipf
r1097 r1099 1510 1510 end 1511 1511 1512 1513 1514 1515 1512 // from WM procedure, extended to three waves for I(q) data sets 1513 // 1514 // RemoveNaNsQIS(theQWave, theIWave, theSWave) 1515 // Removes all points in an XYZ triple if any of the three waves has the value NaN. 1516 // A NaN represents a blank or missing value. 1517 // Returns the number of points removed. 1518 Function V_RemoveNaNsQIS(theXWave, theYWave, theZWave) 1519 Wave theXWave 1520 Wave theYWave 1521 Wave theZWave 1522 1523 Variable p, numPoints, numNaNs 1524 Variable xval, yval, zval 1525 1526 numNaNs = 0 1527 p = 0 // the loop index 1528 numPoints = numpnts(theXWave) // number of times to loop 1529 1530 do 1531 xval = theXWave[p] 1532 yval = theYWave[p] 1533 zval = theZWave[p] 1534 if ((numtype(xval)==2) %| (numtype(yval)==2) %| (numtype(zval)==2) ) // either is NaN? 1535 numNaNs += 1 1536 else // if not an outlier 1537 theXWave[p - numNaNs] = xval // copy to input wave 1538 theYWave[p - numNaNs] = yval // copy to input wave 1539 theZWave[p - numNaNs] = zval // copy to input wave 1540 endif 1541 p += 1 1542 while (p < numPoints) 1543 1544 // Truncate the wave 1545 DeletePoints numPoints-numNaNs, numNaNs, theXWave, theYWave, theZWave 1546 1547 return(numNaNs) 1548 End 1549 1550
Note: See TracChangeset
for help on using the changeset viewer.